This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vinay.sajip
Recipients Josh Wilson, evan_, paul.moore, steve.dower, tim.golden, vinay.sajip, zach.ware
Date 2017-01-11.18:23:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1484158980.43.0.345349532878.issue29213@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2017-01-11 18:23:00vinay.sajipsetrecipients: + vinay.sajip, paul.moore, tim.golden, zach.ware, steve.dower, evan_, Josh Wilson
2017-01-11 18:23:00vinay.sajipsetmessageid: <1484158980.43.0.345349532878.issue29213@psf.upfronthosting.co.za>
2017-01-11 18:23:00vinay.sajiplinkissue29213 messages
2017-01-11 18:23:00vinay.sajipcreate