mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Skip newline in binary mode
This commit is contained in:
parent
2cf80c1595
commit
6cf93e8fc4
1 changed files with 1 additions and 1 deletions
|
@ -163,7 +163,7 @@ def atomic_open(filename, mode='w'):
|
|||
'dir': os.path.dirname(filename),
|
||||
'delete': False,
|
||||
}
|
||||
if six.PY3:
|
||||
if six.PY3 and 'b' not in mode:
|
||||
kwargs['newline'] = ''
|
||||
ntf = tempfile.NamedTemporaryFile(mode, **kwargs)
|
||||
return _AtomicWFile(ntf, ntf.name, filename)
|
||||
|
|
Loading…
Add table
Reference in a new issue