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.
Created on 2014年12月06日 23:37 by Arfrever, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue23003.diff | berker.peksag, 2014年12月07日 14:07 | review | ||
| Messages (3) | |||
|---|---|---|---|
| msg232259 - (view) | Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) | Date: 2014年12月06日 23:37 | |
Usage of some functions from traceback module can result in AttributeError exception in Python 3, while simply printing/returning something with None in Python 2. This regression was introduced in Python 3.0. $ python2.7 -c 'import traceback; print(traceback.print_exc())' None None $ python2.7 -c 'import traceback; print(traceback.print_exception(None, None, None))' None None $ python2.7 -c 'import traceback; print(traceback.format_exc())' None $ python2.7 -c 'import traceback; print(traceback.format_exception(None, None, None))' ['None\n'] $ python3.5 -c 'import traceback; print(traceback.print_exc())' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib64/python3.5/traceback.py", line 252, in print_exc print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain) File "/usr/lib64/python3.5/traceback.py", line 169, in print_exception for line in _format_exception_iter(etype, value, tb, limit, chain): File "/usr/lib64/python3.5/traceback.py", line 146, in _format_exception_iter for value, tb in values: File "/usr/lib64/python3.5/traceback.py", line 125, in _iter_chain context = exc.__context__ AttributeError: 'NoneType' object has no attribute '__context__' $ python3.5 -c 'import traceback; print(traceback.print_exception(None, None, None))' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib64/python3.5/traceback.py", line 169, in print_exception for line in _format_exception_iter(etype, value, tb, limit, chain): File "/usr/lib64/python3.5/traceback.py", line 146, in _format_exception_iter for value, tb in values: File "/usr/lib64/python3.5/traceback.py", line 125, in _iter_chain context = exc.__context__ AttributeError: 'NoneType' object has no attribute '__context__' $ python3.5 -c 'import traceback; print(traceback.format_exc())' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib64/python3.5/traceback.py", line 256, in format_exc return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain)) File "/usr/lib64/python3.5/traceback.py", line 181, in format_exception return list(_format_exception_iter(etype, value, tb, limit, chain)) File "/usr/lib64/python3.5/traceback.py", line 146, in _format_exception_iter for value, tb in values: File "/usr/lib64/python3.5/traceback.py", line 125, in _iter_chain context = exc.__context__ AttributeError: 'NoneType' object has no attribute '__context__' $ python3.5 -c 'import traceback; print(traceback.format_exception(None, None, None))' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib64/python3.5/traceback.py", line 181, in format_exception return list(_format_exception_iter(etype, value, tb, limit, chain)) File "/usr/lib64/python3.5/traceback.py", line 146, in _format_exception_iter for value, tb in values: File "/usr/lib64/python3.5/traceback.py", line 125, in _iter_chain context = exc.__context__ AttributeError: 'NoneType' object has no attribute '__context__' |
|||
| msg237522 - (view) | Author: Berker Peksag (berker.peksag) * (Python committer) | Date: 2015年03月08日 09:07 | |
This is no longer an issue after issue 17911. |
|||
| msg264766 - (view) | Author: Andy Edwards (jedwards1211) | Date: 2016年05月03日 20:49 | |
I'm seeing this issue in Python 2.7.... Andys-MacBook-Pro:jcore-api-py andy$ which python /Library/Frameworks/Python.framework/Versions/2.7/bin/python Andys-MacBook-Pro:jcore-api-py andy$ python setup.py test running test running egg_info writing requirements to jcore_api.egg-info/requires.txt writing jcore_api.egg-info/PKG-INFO writing top-level names to jcore_api.egg-info/top_level.txt writing dependency_links to jcore_api.egg-info/dependency_links.txt reading manifest file 'jcore_api.egg-info/SOURCES.txt' writing manifest file 'jcore_api.egg-info/SOURCES.txt' running build_ext ..................... ---------------------------------------------------------------------- Ran 21 tests in 3.423s OK Andys-MacBook-Pro:jcore-api-py andy$ python setup.py test running test running egg_info writing requirements to jcore_api.egg-info/requires.txt writing jcore_api.egg-info/PKG-INFO writing top-level names to jcore_api.egg-info/top_level.txt writing dependency_links to jcore_api.egg-info/dependency_links.txt reading manifest file 'jcore_api.egg-info/SOURCES.txt' writing manifest file 'jcore_api.egg-info/SOURCES.txt' running build_ext ..................... ---------------------------------------------------------------------- Ran 21 tests in 3.422s OK Exception in thread jcore.io receiver: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "/Users/andy/jcore-api-py/jcore_api/_connection.py", line 104, in _run_recv_thread traceback.print_exc() AttributeError: 'NoneType' object has no attribute 'print_exc' |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:10 | admin | set | github: 67192 |
| 2016年05月03日 20:49:45 | jedwards1211 | set | nosy:
+ jedwards1211 messages: + msg264766 |
| 2015年08月17日 15:50:12 | vstinner | set | superseder: traceback: add a new thin class storing a traceback without storing local variables |
| 2015年03月08日 09:07:35 | berker.peksag | set | status: open -> closed resolution: out of date messages: + msg237522 stage: patch review -> resolved |
| 2014年12月07日 16:02:33 | r.david.murray | set | nosy:
+ r.david.murray |
| 2014年12月07日 14:07:05 | berker.peksag | set | files:
+ issue23003.diff nosy: + berker.peksag keywords: + patch type: behavior stage: patch review |
| 2014年12月06日 23:44:58 | Arfrever | set | assignee: georg.brandl nosy: + georg.brandl |
| 2014年12月06日 23:37:27 | Arfrever | create | |