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.abspath(os.devnull) returns \\\\nul should be nul? #52157
Comments
I encountered this when somebody used: logging.basicConfig(level=logging.CRITICAL, the logging code apparently calls os.path.abspath(filename) somewhere, |
Seems fine to me, does not raise any errors. My OS is OS X Snow Leopard. I checked it in python 2.5, 2.6, 2.7 too, no issues raised. Shashwat-Anands-MacBook-Pro:test l0nwlf$ python2.6
Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os,logging
>>> logging.basicConfig(level=logging.CRITICAL,
... format='%(asctime)s %(levelname)-8s %(message)s',
... datefmt='%a, %d %b %Y %H:%M:%S',
... filename=os.devnull,
... filemode='w')
>>> |
From the bug report, it look likes its specific to windows, not OS X. |
nul is a special "dos device" I suggest that normpath() be changed to consider \\.\ as a special prefix, and keep it intact when it appears at the start of the path. See also |
This bug does not exhibit in Python 3.1.1. |
Attaching a test against trunk which elicits the error reported in this bug. |
Followed Amaury's suggestion in r83368. \\.\ and \\?\ as prefixes now cause normpath() to return the argument as-is. |
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: