glob.glob unicode bug or feature

Neil Hodgson nhodgson at bigpond.net.au
Sun Aug 1 20:09:46 EDT 2004


Peter Otten:
> Neil Hodgson wrote:
> ...
> >         return glob1(type(dirname)(os.curdir), basename)
> ...
> I should have tried before posting. Now you point it out it seems I've
> changed a piece of dead code. Or am I missing something ...again?

   It took quite a few examples for me to be convinced that the code is
dead. "leve" has submitted a bug and "nnorwitz" a patch to the Python bug
tracker and it works for me:

 def glob1(dirname, pattern):
     if not dirname: dirname = os.curdir
+    if isinstance(pattern, unicode): dirname = unicode(dirname)

http://sourceforge.net/tracker/index.php?func=detail&aid=1001604&group_id=5470&atid=305470

   Neil






More information about the Python-list mailing list