[issue24670] os.chdir breaks result of os.path.abspath(__file__) and os.path.realpath(__file__)

2020-07-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: I interpret Serhiy's comment as 'not a bug'. In any case, the linked issue changed __file__ to an absolute path, and 2.7 is frozen. -- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed

[issue24670] os.chdir breaks result of os.path.abspath(__file__) and os.path.realpath(__file__)

2020-06-05 Thread Brett Cannon
Change by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24670] os.chdir breaks result of os.path.abspath(__file__) and os.path.realpath(__file__)

2015-07-20 Thread Daniel al. LordBlick
Changes by Daniel al. LordBlick lordbl...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24670 ___ ___

[issue24670] os.chdir breaks result of os.path.abspath(__file__) and os.path.realpath(__file__)

2015-07-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The issue is not in os.path, but in __file__ been relative path. If you change current work directory, __file__ is no longer valid path to source file. Things are even worse with zipimport. When you will archive the script in the ZIP file and run this ZIP

[issue24670] os.chdir breaks result of os.path.abspath(__file__) and os.path.realpath(__file__)

2015-07-20 Thread Daniel al. LordBlick
Daniel al. LordBlick added the comment: If so, then should be internally __file__ edit by zipimport and/or os.cwd? It's simple string in file.__dict__['__file__']… Is exist some class representing internal file? Then any cwd operation should be wraped by it. -- components: +Interpreter

[issue24670] os.chdir breaks result of os.path.abspath(__file__) and os.path.realpath(__file__)

2015-07-19 Thread LordBlick
New submission from LordBlick: The use of methods path.chdir () corrupts the subsequent ability to detect the file path which is interpreted. I've made simple example, which is atached: $ cd ~/tmp $ ./test_os_path.py abspath:~/tmp/test_os_path.py weak abspath: ~/tmp/test_os_path.py