Message285253
Although we don't currently have binaries under venv/scripts, that might change in the future. The logic could be changed to:
with open(srcfile, 'rb') as f:
data = f.read()
if not srcfile.endswith('.exe'):
try:
data = data.decode('utf-8')
data = self.replace_variables(data, context)
data = data.encode('utf-8')
except UnicodeError as e:
data = None
logger.warning('unable to copy script %r, '
'may be binary: %s', srcfile, e)
if data is not None:
with open(dstfile, 'wb') as f:
f.write(data)
shutil.copymode(srcfile, dstfile)
All the files in the nt subdirectory have CRLF endings, and the above should preserve them (whatever they are). |
|
Date |
User |
Action |
Args |
2017-01-11 18:23:00 | vinay.sajip | set | recipients:
+ vinay.sajip, paul.moore, tim.golden, zach.ware, steve.dower, evan_, Josh Wilson |
2017-01-11 18:23:00 | vinay.sajip | set | messageid: <1484158980.43.0.345349532878.issue29213@psf.upfronthosting.co.za> |
2017-01-11 18:23:00 | vinay.sajip | link | issue29213 messages |
2017-01-11 18:23:00 | vinay.sajip | create | |
|