New submission from Yury Selivanov:

There are many issues on tracker related to the relative paths in co_filename. 
Most of them are about introspection functions in inspect module--which are 
usually broken after 'os.chdir'. 

Test case: create a file t.py:

   def foo(): pass
   print(foo.__code__.co_filename)

Execute it with '$ python t.py' -> it will print 't.py'.

Ideally, when executing a python file, interpreter should expand all relative 
paths for __file__ and __code__.co_filename attributes.

----------
messages: 209699
nosy: r.david.murray, yselivanov
priority: normal
severity: normal
stage: needs patch
status: open
title: __code__. co_filename should always be an absolute path
type: behavior
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20443>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to