classification
Title: BytesWarning in glob.glob
Type: behavior Stage: resolved
Components: Library (Lib), Windows Versions: Python 3.2, Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: pitrou, python-dev, serhiy.storchaka
Priority: normal Keywords:

Created on 2012-12-16 13:20 by pitrou, last changed 2012-12-16 15:14 by pitrou. This issue is now closed.

Messages (4)
msg177596 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-12-16 13:20
This failure appeared on one of the Windows buildbots:

======================================================================
ERROR: test_glob_magic_in_drive (test.test_glob.GlobTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\buildbot.python.org\3.2.kloth-win64\build\lib\test\test_glob.py", line 118, in test_glob_magic_in_drive
    eq(glob.glob(b'*:'), [])
  File "C:\buildbot.python.org\3.2.kloth-win64\build\lib\glob.py", line 15, in glob
    return list(iglob(pathname))
  File "C:\buildbot.python.org\3.2.kloth-win64\build\lib\glob.py", line 44, in iglob
    for name in glob_in_dir(dirname, basename):
  File "C:\buildbot.python.org\3.2.kloth-win64\build\lib\glob.py", line 66, in glob0
    if basename == '':
BytesWarning: Comparison between bytes and string
msg177603 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-12-16 14:29
It should be "if not basename:". No additional tests are possible except those which added for issue16626.
msg177604 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-12-16 15:05
New changeset 96f19274de18 by Antoine Pitrou in branch '3.2':
Issue #16696: fix comparison between bytes and string. Also, improve glob tests.
http://hg.python.org/cpython/rev/96f19274de18

New changeset ed8134df30e4 by Antoine Pitrou in branch '3.3':
Issue #16696: fix comparison between bytes and string. Also, improve glob tests.
http://hg.python.org/cpython/rev/ed8134df30e4

New changeset 9e898ee68388 by Antoine Pitrou in branch 'default':
Issue #16696: fix comparison between bytes and string. Also, improve glob tests.
http://hg.python.org/cpython/rev/9e898ee68388
msg177605 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-12-16 15:14
I've added some tests for patterns with a trailing slash.
History
Date User Action Args
2012-12-16 15:14:17pitrousetstatus: open -> closed
resolution: fixed
messages: + msg177605

stage: needs patch -> resolved
2012-12-16 15:05:45python-devsetnosy: + python-dev
messages: + msg177604
2012-12-16 14:29:28serhiy.storchakasetmessages: + msg177603
2012-12-16 13:20:31pitroucreate