[Python-Dev] file open in python interpreter

Nick Coghlan ncoghlan at gmail.com
Tue Nov 4 10:25:24 CET 2008


adrian golding wrote:
> hi all,
> 
> (benjamin and nick thank you!) i have another question to ask something
> about permissions for the python interpreter.  in my earlier post, i was
> saying i want to measure the python script before it is parsed.  what
> happens is that i will write the measurement of that script file to
> another file (call is 'measurereq') i have, it gives a Permission denied
> error.
> 
> i have modified other programs to do the same measurement (eg, modified
> Bash to measure .sh files) and it works fine.  So i am suspecting it has
> something to do with the python files. ie, i'm thinking the Permission
> denied error is not because of i'm unable to write on my 'measurereq'
> file, but its because i'm unable to measure (read) the python file.
> 
> any clues? how can i go around this?

You're getting out of python-dev territory now - I'm happy to help with
some tips on interpreter internals, but I'm not going to attempt to
debug-from-afar a modified version of the interpreter (particularly when
the problem relates to file permission issues which are highly OS and
file system dependent).

That said, the usual debugging tactic of divide and conquer (e.g. adding
trace calls to figure out exactly which step is failing, or just
calculating the hash without attempting to write it to disk) will
probably be your friend.

Failing that, you might want to try asking for further assistance on
comp.lang.python (aka python-list at python.org).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------


More information about the Python-Dev mailing list