New submission from Xinmeng Xia <[email protected]>:
There is a bug in lib2to3. When dealing with this project "struts-scan" by
2to3,the following bug will show up.
Traceback (most recent call last):
File "/home/xxm/Desktop/instrument/datasetpy3/struts-scan/struts-scan.py",
line 18, in <module>
sys.setdefaultencoding('utf-8')
AttributeError: module 'sys' has no attribute 'setdefaultencoding'
"sys.setdefaultencoding('utf-8')" is not dealt with by lib2to3. In Python3,
there is no such API "setdefaultencoding" for "sys".
A possible solution to improve 2to3 is to delete this line
"sys.setdefaultencoding('utf-8')" when converting Python2 projects
----------
components: 2to3 (2.x to 3.x conversion tool)
files: struts-scan.py
messages: 348716
nosy: xxm
priority: normal
severity: normal
status: open
title: 2to3 set default encoding
type: compile error
versions: Python 3.7
Added file: https://bugs.python.org/file48514/struts-scan.py
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37715>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com