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.

Title: glob doesn't return unicode with unicode parameter
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, gradha, lcantey, orsenthil, pitrou
Priority: normal Keywords:

Created on 2007-08-20 07:08 by gradha, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg32666 - (view) Author: Grzegorz Adam Hankiewicz (gradha) Date: 2007-08-20 07:08
Unless I'm not understanding a previous bug report, I see this is a regression of
Here's an interactive session with 2.5.1 on WXP:

In [1]: import sys

In [2]: sys.version
Out[2]: '2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]'

In [3]: import glob

In [4]: glob.glob(u"*txt")
Out[4]: ['hola.txt', 'ma\xf1ana.txt']

In [5]: glob.glob(u"./*txt")
Out[5]: [u'.\\hola.txt', u'.\\ma\xf1ana.txt']
msg32667 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2007-08-21 17:31
This seems very much windows specific (someone needs to test on mac/other os as well). On linux, verified that glob unicode-in, unicode-out works fine.

msg55305 - (view) Author: Grzegorz Adam Hankiewicz (gradha) Date: 2007-08-26 09:29
Previous bug report would be now
msg71707 - (view) Author: Lee Cantey (lcantey) Date: 2008-08-22 00:17
Updated original report with the following:

2.5.1 (r251:54863, Jul 10 2008, 17:24:48)

Fails for me with 2.5.1 on Linux, OS X, and Windows.

>>> glob.glob("*")
['t.txt', 't\xd0\xb4.txt', 't\xe2\xbd\x94.txt']
>>> glob.glob(u"*")
['t.txt', 't\xd0\xb4.txt', 't\xe2\xbd\x94.txt']
>>> glob.glob(u"./*")
[u'./t.txt', u'./t\u0434.txt', u'./t\u2f54.txt']
msg71754 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-22 15:57
Seems fixed on 2.6.

Python 2.6b3+ (trunk, Aug 22 2008, 11:27:51) [MSC v.1500 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import glob
>>> glob.glob("*.py")
['', '']
>>> glob.glob(u"*.py")
[u'', u'']
>>> glob.glob(u"./*.py")
[u'.\\', u'.\\']
msg76992 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-12-05 09:29
I see the same as Antoine, this is fixed in 2.6.
Date User Action Args
2022-04-11 14:56:26adminsetgithub: 45330
2008-12-05 09:29:55georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg76992
nosy: + georg.brandl
2008-08-22 15:57:27pitrousetnosy: + pitrou
messages: + msg71754
2008-08-22 00:17:08lcanteysetnosy: + lcantey
messages: + msg71707
2007-08-26 09:29:15gradhasettype: behavior
messages: + msg55305
2007-08-20 07:08:14gradhacreate