Vinay Sajip added the comment: 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). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29213> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com