[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
realpath:   ~/tmp/subtemp/test_os_path.py
weak realpath:  ~/tmp/subtemp/test_os_path.py
$ cd /usr
$ ~/tmp/test_os_path.py
abspath:~/tmp/test_os_path.py
weak abspath:   ~/tmp/test_os_path.py
realpath:   ~/tmp/subtemp/test_os_path.py
weak realpath:  ~/tmp/subtemp/test_os_path.py
$ cd ~
$ tmp/test_os_path.py
abspath:~/tmp/test_os_path.py
weak abspath:   ~/tmp/tmp/test_os_path.py
realpath:   ~/tmp/subtemp/test_os_path.py
weak realpath:  ~/tmp/tmp/test_os_path.py

--
components: Library (Lib)
files: test_os_path.py
messages: 246942
nosy: LordBlick
priority: normal
severity: normal
status: open
title: os.chdir breaks result of os.path.abspath(__file__) and 
os.path.realpath(__file__)
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file39951/test_os_path.py

___
Python tracker 
<http://bugs.python.org/issue24670>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 :


--
nosy: +serhiy.storchaka

___
Python tracker 
<http://bugs.python.org/issue24670>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 .__dict__['__file__']…
Is exist some class representing internal file? Then any cwd operation should 
be wraped by it.

--
components: +Interpreter Core

___
Python tracker 
<http://bugs.python.org/issue24670>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com