mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format (#17418)
This commit is contained in:
parent
016b0280b8
commit
a62ad4730c
4 changed files with 21 additions and 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
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue