Mercurial > hg
comparison mercurial/archival.py @ 36036:788b2e8530ae
py3: use raw string for file open mode
Otherwise the module importer rewrites it to bytes on Python 3,
which angers Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2137
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 11 Feb 2018 10:52:13 -0800 |
parents | 533f04d4cb6d |
children | b72c6ff4e4c0 |
comparison
equal
deleted
inserted
replaced
36035:95791b275b73 | 36036:788b2e8530ae |
---|---|
216 if not isinstance(dest, str): | 216 if not isinstance(dest, str): |
217 try: | 217 try: |
218 dest.tell() | 218 dest.tell() |
219 except (AttributeError, IOError): | 219 except (AttributeError, IOError): |
220 dest = tellable(dest) | 220 dest = tellable(dest) |
221 self.z = zipfile.ZipFile(dest, 'w', | 221 self.z = zipfile.ZipFile(dest, r'w', |
222 compress and zipfile.ZIP_DEFLATED or | 222 compress and zipfile.ZIP_DEFLATED or |
223 zipfile.ZIP_STORED) | 223 zipfile.ZIP_STORED) |
224 | 224 |
225 # Python's zipfile module emits deprecation warnings if we try | 225 # Python's zipfile module emits deprecation warnings if we try |
226 # to store files with a date before 1980. | 226 # to store files with a date before 1980. |