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 xxm
Recipients xxm
Date 2019-07-30.06:11:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1564467105.65.0.60061017687.issue37715@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2019-07-30 06:11:45xxmsetrecipients: + xxm
2019-07-30 06:11:45xxmsetmessageid: <1564467105.65.0.60061017687.issue37715@roundup.psfhosted.org>
2019-07-30 06:11:45xxmlinkissue37715 messages
2019-07-30 06:11:45xxmcreate