New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os.path.realpath() get the wrong result #48904
Comments
I found the problem when i install a small tool which I wrote on the import os and I ran the python script on two different machines,but the version another is But obviously the first one os.path.realpath(...) should be |
An issue with Python 2.3, can this be closed or is it still a problem with Python 2.7 or any of the Python 3 versions? |
No such issue on python 2.6, 2.7, 3.2. >>> print(os.path.realpath('/Users/l0nwlf/Desktop/tmp/../decotest.lnk'))
/Users/l0nwlf/Desktop/decotest.lnk
I think this issue can be closed.
However, I came with a different issue while testing on 2.6, trunk and 3.2.
>>> print(os.path.realpath('~/Desktop/tmp/../decotest.lnk'))
/Volumes/CoreHD/py3k/~/Desktop/decotest.lnk |
Your different issue looks like a correct result to me. ~ is not automatically expanded. |
By different issue I meant expected but non-useful output. |
I can confirm this works correctly on 32 bit Linux under 2.6.4. Since it is unlikely the width matters to this issue I'm going to close it. If anyone has a case where it fails we can reopen. |
Somebody long ago made the decision that ~ is only expanded if you call expanduser. I don't think this decision is likely to get changed. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: