[issue5595] os.path.ismount (ntpath) gives UnboundLocalError for any input

Michael Newman report at bugs.python.org
Sun Mar 29 14:39:53 CEST 2009


New submission from Michael Newman <michael.b.newman at gmail.com>:

os.path.ismount gives UnboundLocalError for any input in Python 3.0:

Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os.path
>>> os.path
<module 'ntpath' from 'C:\python30\lib\ntpath.py'>
UnboundLocalError: local variable 'p' referenced before assignment
>>> os.path.ismount("C:\\")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\python30\lib\ntpath.py", line 260, in ismount
    seps = _get_bothseps(p)
UnboundLocalError: local variable 'p' referenced before assignment
>>> os.path.ismount("C:\\windows")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\python30\lib\ntpath.py", line 260, in ismount
    seps = _get_bothseps(p)
UnboundLocalError: local variable 'p' referenced before assignment

It works fine in Python 2.6:
Python 2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os.path
>>> os.path
<module 'ntpath' from 'C:\python26\lib\ntpath.pyc'>
>>> os.path.ismount("C:\\")
True
>>> os.path.ismount("C:\\windows")
False

----------
components: Library (Lib)
messages: 84382
nosy: mnewman
severity: normal
status: open
title: os.path.ismount (ntpath) gives UnboundLocalError for any input
versions: Python 3.0

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5595>
_______________________________________


More information about the Python-bugs-list mailing list