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 nheron
Recipients nheron
Date 2010-02-02.22:50:02
SpamBayes Score 2.4946711e-13
Marked as misclassified No
Message-id <1265151004.56.0.531784942224.issue7842@psf.upfronthosting.co.za>
In-reply-to
Content
when a syntax error is generated in py_compile.compile(), the wrong arguments are passed to the new PyCompileError exception which in turn passes the wrong args to traceback.format_exception_only() producing the wrong output.

this was fixed in the py3k branch (Revision 56901) but is still broken in 2.6 and 2.7
the attached patch has the same fix but applied to the trunk.

here's a simple test case..

f = open('broken.py','w')
f.write("1 = a  #<-- obvious syntax err\n")
f.close()
import py_compile
py_compile.compile('broken.py')
History
Date User Action Args
2010-02-02 22:50:04nheronsetrecipients: + nheron
2010-02-02 22:50:04nheronsetmessageid: <1265151004.56.0.531784942224.issue7842@psf.upfronthosting.co.za>
2010-02-02 22:50:03nheronlinkissue7842 messages
2010-02-02 22:50:02nheroncreate