[issue15931] inspect.findsource fails after directory change

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Yes. I'll create an issue for that. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue15931] inspect.findsource fails after directory change

2014-01-29 Thread R. David Murray
R. David Murray added the comment: __file__ is absolute for imports, yes. I didn't check co_filename, maybe that needs to be fixed too. -- ___ Python tracker ___ __

[issue15931] inspect.findsource fails after directory change

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Hm, maybe just for the imports? This simple script, run it directly: test.py: def foo(): pass print(foo.__code__.co_filename) "$ python3.4 test.py" will still print relative path "test.py". Hence, if you do 'os.chdir' in the above script, the introspect

[issue15931] inspect.findsource fails after directory change

2014-01-29 Thread R. David Murray
R. David Murray added the comment: Note that this is fixed in 3.4. That is, in 3.4 __file__ paths are made absolute when the import happens. -- ___ Python tracker ___ _

[issue15931] inspect.findsource fails after directory change

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Sadly, there is nothing we can do about it, as we simply don't have absolute paths in __file__ attributes in your case. -- nosy: +yselivanov resolution: -> rejected status: open -> closed ___ Python tracker

[issue15931] inspect.findsource fails after directory change

2012-09-12 Thread R. David Murray
Changes by R. David Murray : -- nosy: +r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue15931] inspect.findsource fails after directory change

2012-09-12 Thread Gabor Kovacs
New submission from Gabor Kovacs: The attached script works in 2.6(.4) but not in 2.7(.3); the script cannot locate its own source code if invoked by relative path and work directory has changed. If line 8 uncommented, everything is fine due to caching. I think this is related to issue #4050