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.

classification
Title: activate.ps1 in venv for Windows should encoded with BOM
Type: crash Stage:
Components: Windows Versions: Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: paul.moore, steve.dower, tim.golden, zach.ware, 정한솔
Priority: normal Keywords:

Created on 2019-04-12 08:27 by 정한솔, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg340014 - (view) Author: 정한솔 (정한솔) Date: 2019-04-12 08:27
"activate.ps1" (venv) is currently encoded as UTF8 without BOM. But this cause an error if path of an environment contains non-ASCII characters. It seems Powershell can't recognize UTF8 without BOM. If I changed encoding of activate.ps1 to UTF8-BOM, it works well.

So I think activate.ps1 should be encoded as UTF8-BOM.

https://stackoverflow.com/questions/14482253/utf8-script-in-powershell-outputs-incorrect-characters
msg340092 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-04-12 18:06
Seems reasonable.

The most reliable way to do this will be to override the copy function for this file in venv and write it out with "utf-8-sig" encoding. There are many ways that git will break things like this, so I wouldn't trust it to simply accept a modified file.
History
Date User Action Args
2022-04-11 14:59:13adminsetgithub: 80790
2019-04-12 18:06:53steve.dowersetmessages: + msg340092
2019-04-12 08:33:33xtreaksetnosy: + tim.golden, steve.dower, zach.ware, paul.moore

components: + Windows
versions: + Python 3.8, - Python 3.6
2019-04-12 08:27:01정한솔create