This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/13345] ~ expansion broken for "source" with .py files
- From: "pmuldoon at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Thu, 27 Oct 2011 14:09:34 +0000
- Subject: [Bug python/13345] ~ expansion broken for "source" with .py files
- Auto-submitted: auto-generated
- References: <bug-13345-4717@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=13345
Phil Muldoon <pmuldoon at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pmuldoon at redhat dot com
AssignedTo|unassigned at sourceware |pmuldoon at redhat dot com
|dot org |
--- Comment #1 from Phil Muldoon <pmuldoon at redhat dot com> 2011-10-27 14:09:34 UTC ---
The problem here is that the "~" (home) is being passed to:
python.c
171 python_file = PyFile_FromString (filename_copy, "r");
which returns NULL, and then this NULL is passed to:
173 PyRun_SimpleFile (PyFile_AsFile (python_file), filename);
Which ends up just reading bogus data.
There are a few problems here. First we are not error-checking the return from
PyFile_FromString. Second, the tilde needs to be expanded (if you give it an
absolute path, it successfully reads and parses the file). And third, a
separate bug is suppressing the error message. If you turn "set python
print-stack on" you should see something like:
IOError: [Errno 2] No such file or directory: '~/helloworld.py'
I'll work on these three issues, and will post a patch when I have a solution.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.