[New-bugs-announce] [issue24504] os.listdir() error if the last folder starts not with the capital letter

Denis Gordeev report at bugs.python.org
Wed Jun 24 23:44:37 CEST 2015


New submission from Denis Gordeev:

My code is:
mypath = 'Z:\Pr Files\norma'
file_list = [ f for f in listdir(mypath) if isfile(join(mypath,f))]

Error:
Traceback (most recent call last):
  File "C:\Documents and Settings\Administrator\Desktop\uni\click zhenilo workshop\noise.py", line 13, in <module>
    file_list = [ f for f in listdir(mypath) if isfile(join(mypath,f))]
WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: 'Z:\\Pr Files\norma/*.*'

It works all right, if the path is:
mypath = 'Z:\Pr Files\Norma'

----------
components: Windows
messages: 245777
nosy: Denis Gordeev, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: os.listdir() error if the last folder starts not with the capital letter
versions: Python 2.7

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


More information about the New-bugs-announce mailing list