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 christian.heimes
Recipients JosephArmbruster, christian.heimes
Date 2007-11-14.16:22:05
SpamBayes Score 0.0083113145
Marked as misclassified No
Message-id <1195057326.63.0.133880388113.issue1442@psf.upfronthosting.co.za>
In-reply-to
Content
I've a far better patch that uses Python's infrastructure to report the
error:

Index: Modules/main.c
===================================================================
--- Modules/main.c      (Revision 58966)
+++ Modules/main.c      (Arbeitskopie)
@@ -132,6 +132,16 @@
                        (void) PyRun_SimpleFileExFlags(fp, startup, 0, cf);
                        PyErr_Clear();
                        fclose(fp);
+               } else {
+                       int save_errno;
+
+                       save_errno = errno;
+                       PySys_WriteStderr("Could not open PYTHONSTARTUP\n");
+                       errno = save_errno;
+                       PyErr_SetFromErrnoWithFilename(PyExc_IOError,
+                                       startup);
+                       PyErr_Print();
+                       PyErr_Clear();
                }
        }
 }


$ ./python
Python 3.0a1+ (py3k:58966M, Nov 14 2007, 17:17:06)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Could not open PYTHONSTARTUP
IOError: [Errno 2] No such file or directory:
'/home/heimes/.python/startup.py'
>>>                      

Fixed in r58969 (py3k)
History
Date User Action Args
2007-11-14 16:22:06christian.heimessetspambayes_score: 0.00831131 -> 0.0083113145
recipients: + christian.heimes, JosephArmbruster
2007-11-14 16:22:06christian.heimessetspambayes_score: 0.00831131 -> 0.00831131
messageid: <1195057326.63.0.133880388113.issue1442@psf.upfronthosting.co.za>
2007-11-14 16:22:06christian.heimeslinkissue1442 messages
2007-11-14 16:22:06christian.heimescreate