Message73859
| Author |
vstinner |
| Recipients |
vstinner |
| Date |
2008年09月26日.16:26:50 |
| SpamBayes Score |
2.5944435e-10 |
| Marked as misclassified |
No |
| Message-id |
<1222446412.69.0.774213600705.issue3975@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Here is a new version of _Py_DisplaySourceLine() using
PyTokenizer_FindEncoding() to read the coding header, and
PyFile_FromFd() to create an "unicode-awake" file. The code could be
optimized, but it least it displays correctly the file line ;-)
The code is based on the original _Py_DisplaySourceLine() and
call_find_module() (import.c).
Notes:
* The code is young and new, it might be delayed until python 3.1
* Some functions may raise new exceptions (eg. MemoryError). I don't
know how Python will react if an exception is raised during
PyTraceBack_Print() ?
* The return code is 0 for success, but is it -1 or 1 for an error? It
looks like error is "result != 0", so both -1 and 1 should be valid. I
used -1. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2008年09月26日 16:26:52 | vstinner | set | recipients:
+ vstinner |
| 2008年09月26日 16:26:52 | vstinner | set | messageid: <1222446412.69.0.774213600705.issue3975@psf.upfronthosting.co.za> |
| 2008年09月26日 16:26:51 | vstinner | link | issue3975 messages |
| 2008年09月26日 16:26:51 | vstinner | create |
|