This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: os.listdir bug
Type: Stage: resolved
Components: Windows Versions: Python 3.1
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ezio.melotti, guxianminer
Priority: normal Keywords:

Created on 2011-12-26 05:38 by guxianminer, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (6)
msg150252 - (view) Author: wang (guxianminer) Date: 2011-12-26 05:38
when I use os.list the return value is like this:
['some.xml', '\ufeff9158.xml']
but the file name have not the '\ufeff'.
because this problem the script can't runing.
msg150254 - (view) Author: wang (guxianminer) Date: 2011-12-26 05:48
only I double click the script file generate this problem.
in IDE not this problem.
msg150255 - (view) Author: wang (guxianminer) Date: 2011-12-26 05:54
I mean in IDLE can run ok.
the '\ufeff' is still have.
msg150256 - (view) Author: wang (guxianminer) Date: 2011-12-26 05:54
I mean in IDLE can run ok.
the '\ufeff' is still have.
msg150257 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-12-26 06:05
U+FFEF is a Unicode ZERO WIDTH NO-BREAK SPACE / BYTE ORDER MARK.  I'm not sure what is it doing in the file name but this doesn't seem a bug in os.listdir.
msg150258 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-12-26 06:08
s/U+FFEF/U+FEFF/
See also http://unicode.org/faq/utf_bom.html#bom1
History
Date User Action Args
2022-04-11 14:57:25adminsetgithub: 57871
2011-12-26 06:08:01ezio.melottisetmessages: + msg150258
2011-12-26 06:05:34ezio.melottisetstatus: open -> closed

nosy: + ezio.melotti
messages: + msg150257

resolution: not a bug
stage: resolved
2011-12-26 05:56:10guxianminersetcomponents: + Windows
2011-12-26 05:54:37guxianminersetmessages: + msg150256
2011-12-26 05:54:33guxianminersetmessages: + msg150255
2011-12-26 05:48:40guxianminersetmessages: + msg150254
2011-12-26 05:38:46guxianminercreate