[New-bugs-announce] [issue8307] test_pep263 failure on OS X

Mark Dickinson report at bugs.python.org
Sat Apr 3 23:00:21 CEST 2010


New submission from Mark Dickinson <dickinsm at gmail.com>:

I'm seeing a very peculiar test_pep263 failure when doing 'make test' on OS X 10.6.3.  It's enough to run test___all__ and test_pep263, in that order:

Mark-Dickinsons-MacBook-Pro:trunk dickinsm$ ./python.exe -Wd -3 -E -tt ./Lib/test/regrtest.py test___all__ test_pep263
test___all__
/Users/dickinsm/python/svn/trunk/Lib/test/test___all__.py:3: DeprecationWarning: in 3.x, the bsddb module has been removed; please use the pybsddb project instead
  import bsddb
/Users/dickinsm/python/svn/trunk/Lib/bsddb/__init__.py:67: PendingDeprecationWarning: The CObject type is marked Pending Deprecation in Python 2.7.  Please use capsule objects instead.
  import _bsddb
test_pep263
test test_pep263 failed -- Traceback (most recent call last):
  File "/Users/dickinsm/python/svn/trunk/Lib/test/test_pep263.py", line 39, in test_issue7820
    self.assertRaises(SyntaxError, eval, '\xff\x20')
  File "/Users/dickinsm/python/svn/trunk/Lib/unittest/case.py", line 444, in assertRaises
    callableObj(*args, **kwargs)
  File "<string>", line 1, in <module>
NameError: name '?' is not defined

1 test OK.
1 test failed:
    test_pep263
[218378 refs]


The failing test is expecting a SyntaxError, but gets a NameError instead.  I've narrowed down the cause of the failure to a Tkinter import:

Python 2.7a4+ (trunk:79716, Apr  3 2010, 20:30:09) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> eval('\xff\x20')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1
    ? 
    ^
SyntaxError: invalid syntax
[35036 refs]
>>> import Tkinter
[51314 refs]
>>> eval('\xff\x20')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1, in <module>
NameError: name '?' is not defined
[51324 refs]

But I'm now mystified:  why does the eval raise a SyntaxError before the import and a TypeError afterwards?

----------
messages: 102294
nosy: mark.dickinson
severity: normal
status: open
title: test_pep263 failure on OS X
versions: Python 2.7

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


More information about the New-bugs-announce mailing list