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 JosephArmbruster
Recipients JosephArmbruster
Date 2007-11-14.04:07:24
SpamBayes Score 0.13755962
Marked as misclassified No
Message-id <1195013244.94.0.813010409666.issue1442@psf.upfronthosting.co.za>
In-reply-to
Content
Trunk revision: 58963

Description:  No warning or error is reported it a file pointed to by
PYTHONSTARTUP is not readable.

Request:  To display a warning so that the user may be notified.

Note:  Errors that may occur in PyRun_SimpleFileExFlags are being cast
away, may be worthwhile to report an error for those as well (unless
this was avoided for good reason :-)

Suggestion:

static void RunStartupFile(PyCompilerFlags *cf)
{
  char *startup = Py_GETENV("PYTHONSTARTUP");
  if (startup != NULL && startup[0] != '\0') {
    FILE *fp = fopen(startup, "r");
    if (fp != NULL) {
      (void) PyRun_SimpleFileExFlags(fp, startup, 0, cf);
      PyErr_Clear();
      fclose(fp);
    }
    else {
      fprintf(stderr,"Warning: Could not read startup file %s\n",startup);
    }
  }
}
History
Date User Action Args
2007-11-14 04:07:25JosephArmbrustersetspambayes_score: 0.13756 -> 0.13755962
recipients: + JosephArmbruster
2007-11-14 04:07:24JosephArmbrustersetspambayes_score: 0.13756 -> 0.13756
messageid: <1195013244.94.0.813010409666.issue1442@psf.upfronthosting.co.za>
2007-11-14 04:07:24JosephArmbrusterlinkissue1442 messages
2007-11-14 04:07:24JosephArmbrustercreate