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.

classification
Title: Improve error reporting when Python opens source code
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: dyoo, loewis
Priority: normal Keywords: patch

Created on 2004-08-18 22:04 by dyoo, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
diff dyoo, 2004-08-18 22:04 diff against Python 2.3.3's Modules/main.c
main.c.diff dyoo, 2004-08-18 22:24 unified diff against Python 2.3.3's Modules/main.c
Messages (3)
msg46733 - (view) Author: Danny Yoo (dyoo) Date: 2004-08-18 22:04
Python gives the slightly unhelpful error message:
"can't open file %s" when given a bad file name.

Here's a patch to make Python's error reporting a
little more explicit when a user accidently mistypes
the name of a source file.  It's just a simple call to
strerror().  The patch is made against the Python-2.3.3
release.

msg46734 - (view) Author: Danny Yoo (dyoo) Date: 2004-08-18 22:24
Logged In: YES 
user_id=49843

Modified the patch to more closely match error output from
Python.  Now prints "[Errno %d]" as well as the strerror().
msg46735 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-08-19 11:08
Logged In: YES 
user_id=21627

Thanks for the patch, applied as main.c 1.83. Some systems
don't have strerror, which I also took into account.
History
Date User Action Args
2022-04-11 14:56:06adminsetgithub: 40783
2004-08-18 22:04:54dyoocreate