This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/13345] ~ expansion broken for "source" with .py files


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]