diff options
author | Matthew Rollings <1211162+stealthcopter@users.noreply.github.com> | 2019-12-02 22:25:21 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2019-12-02 22:25:21 (GMT) |
commit | a62ad4730c9b575f140f24074656c0257c86a09a (patch) | |
tree | 2fe5664ba3d3bf745bda95c2539e4c25e3535380 /Lib/uu.py | |
parent | 016b0280b8a97bc26e97c6a8dd5fb8fad5fe72e4 (diff) | |
download | cpython-a62ad4730c9b575f140f24074656c0257c86a09a.zip cpython-a62ad4730c9b575f140f24074656c0257c86a09a.tar.gz cpython-a62ad4730c9b575f140f24074656c0257c86a09a.tar.bz2 |
bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format (#17418)
Diffstat (limited to 'Lib/uu.py')
-rwxr-xr-x | Lib/uu.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -73,6 +73,13 @@ def encode(in_file, out_file, name=None, mode=None, *, backtick=False): name = '-' if mode is None: mode = 0o666 + + # + # Remove newline chars from name + # + name = name.replace('\n','\\n') + name = name.replace('\r','\\r') + # # Write the data # |