Nick Coghlan <ncogh...@gmail.com> added the comment:

Taking a closer look at the four affected cases, I've changed my mind - the 
patch looks reasonable, go ahead and add it (as the new output actually still 
makes sense in the RunMainFromImporter case)

However, additional test cases should be added to test_cmd_line_script, at 
least for the two that are fairly easy to test:

- runpy import failure: shadow the stdlib by creating a runpy.py that raises 
RuntimeError at the top level
- runpy attribute lookup failure: shadow the stdlib with an empty runpy.py

I have no idea how you could force the latter two errors, though, so I'm fine 
with leaving those paths untested (while tests would be great if you can figure 
out some way to make the decoding and argument construction steps fail, I 
expect the use of the surrogateescape error handler will make that very hard to 
do).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14439>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to