-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
paver crash if open UTF-8 file on Windows 7 #182
Comments
Thanks for the report! Looks like an easy fix, I'll just try to add a test as well |
Hi, how this is going? I just start using paver in my environment, Python 3.7 on Windows10, and faces this issue. As a counter measure, I put the magic comment on the top of the pavement.py. Thank you in advance! |
Hi, this fell off my radar a bit, mostly as I’ve been looking into pruning the repo to drop py2 support. Good poke, lemme find some time to work on the next release. Of course, PR welcome if interested :)
… On 18 Aug 2020, at 10:24, Toshihiko Ichida ***@***.***> wrote:
Hi, how this is going?
I just start using paver in my environment, Python 3.7 on Windows10, and faces this issue.
Python 3.* uses UTF-8 as the default source code encoding, so UTF-8 seems good.
As a counter measure, I put the magic comment on the top of the pavement.py.
But I'm looking forward for the update.
Thank you in advance!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#182 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAK4FKGX6TLXUEUANJCCBDSBI3FHANCNFSM4ECNAWTQ>.
|
I've replace paver in my environment with
Now it works fine with Python3 default source encoding, thanks ! |
[Error description]
run the UTF-8 pavement.py in attached zip file under Python 3.6 on Windows 7, it will cause crash as below :
Traceback (most recent call last):
File "d:\program files\python\python3\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "d:\program files\python\python3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "D:\Program Files\Python\Python3\Scripts\paver.exe_main.py", line 9, in
File "d:\program files\python\python3\lib\site-packages\paver\tasks.py", line 891, in main
_launch_pavement(args)
File "d:\program files\python\python3\lib\site-packages\paver\tasks.py", line 856, in _launch_pavement
source = pf.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 54: illegal multibyte sequence
[Reason]
On Windows 7, the default encoding of open() is not UTF-8 but the system's code page setting.
[Resolution]
Before
It should detect the file encoding of <environment.pavement_file>, then use
to open the file.
pavement.zip
The text was updated successfully, but these errors were encountered: