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: test_xpickle fails with "cannot import name precisionbigmemtest" or "cannot import name _2G"
Type: behavior Stage: resolved
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, ezio.melotti, ned.deily, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2013-03-23 22:03 by ned.deily, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue17533.diff ezio.melotti, 2013-03-30 03:46
Messages (8)
msg185099 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-03-23 22:03
When running the OS X 32-bit-only installer 2.7.4rc1 on OS X 10.5, test_xpickle has many test failures all in CPicklePython25Compat.  Note, there is an Apple-supplied system Python 2.5 shipped on OS X 10.5. (There is also an Apple-supplied system Python 2.5 shipped on OS X 10.8, too, but for some reason, the test doesn't report a failure there.)  The use of precisionbigmemtest appears to have been added by 680959a3ae2e for Issue13555.

======================================================================
ERROR: test_attribute_name_interning (test.test_xpickle.CPicklePython25Compat)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/pickletester.py", line 983, in test_attribute_name_interning
    s = self.dumps(x, proto)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/test_xpickle.py", line 115, in dumps
    return self.send_to_worker(self.python, arg, proto)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/test_xpickle.py", line 111, in send_to_worker
    raise RuntimeError(stderr)
RuntimeError: Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/test_xpickle.py", line 28, in <module>
    exec compile(open(mod_path).read(), mod_path, 'exec') in pickletester.__dict__
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/pickletester.py", line 9, in <module>
    from test.test_support import (TestFailed, have_unicode, TESTFN, _2G, _1M,
ImportError: cannot import name precisionbigmemtest

[...]
----------------------------------------------------------------------
Ran 180 tests in 5.033s

FAILED (errors=67)
msg185108 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2013-03-24 02:04
"precisionbigmemtest" was added in a 2.5 bug fix release. I suppose Tiger has an older version.
msg185117 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-03-24 05:48
Right. precisionbigmemtest was added by 0aafd1ae5120 ("security patches from Apple") and released in 2.5.3. OS X 10.5 ("Leopard") has 2.5.1. On a hunch, I installed a python2.4 (2.4.4) and the tests are broken using that as well: multiple failures attempting to import _2G


======================================================================
ERROR: test_simple_newobj (test.test_xpickle.CPicklePython24Compat)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/pickletester.py", line 877, in test_simple_newobj
    s = self.dumps(x, proto)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/test_xpickle.py", line 115, in dumps
    return self.send_to_worker(self.python, arg, proto)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/test_xpickle.py", line 111, in send_to_worker
    raise RuntimeError(stderr)
RuntimeError: Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/test_xpickle.py", line 28, in ?
    exec compile(open(mod_path).read(), mod_path, 'exec') in pickletester.__dict__
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/pickletester.py", line 9, in ?
    from test.test_support import (TestFailed, have_unicode, TESTFN, _2G, _1M,
ImportError: cannot import name _2G
msg185540 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-03-30 03:46
Can you try the attached patch?
msg185545 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-03-30 05:38
There's a typo in the patch and None won't work. With the following change to the patch:

-    _2G = _1G = None
+    _2G = _1M = 0

the test passes on OS X 10.5 against the system 2.5.1 and an installed 2.4.4.  Thanks!
msg185563 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-03-30 14:37
New changeset de48977f9289 by Benjamin Peterson in branch '2.7':
fall back when an old test_support doesn't have various data and functions (closes #17533)
http://hg.python.org/cpython/rev/de48977f9289
msg185580 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-03-30 17:39
Benjamin, the fix you committed still has the _1G vs. _1M typo.
msg185586 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-03-30 19:31
New changeset be0586ebb842 by Benjamin Peterson in branch '2.7':
G -> M (closes #17533)
http://hg.python.org/cpython/rev/be0586ebb842
History
Date User Action Args
2022-04-11 14:57:43adminsetgithub: 61735
2013-03-30 19:31:47python-devsetstatus: open -> closed

messages: + msg185586
2013-03-30 17:39:05ezio.melottisetstatus: closed -> open
type: behavior
messages: + msg185580
2013-03-30 14:37:36python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg185563

resolution: fixed
stage: commit review -> resolved
2013-03-30 05:38:07ned.deilysetmessages: + msg185545
stage: needs patch -> commit review
2013-03-30 03:46:51ezio.melottisetfiles: + issue17533.diff

nosy: + ezio.melotti
messages: + msg185540

keywords: + patch
2013-03-24 05:48:04ned.deilysettitle: test_xpickle fails on OS X 10.5 with "cannot import name precisionbigmemtest" -> test_xpickle fails with "cannot import name precisionbigmemtest" or "cannot import name _2G"
messages: + msg185117
stage: needs patch
2013-03-24 02:04:35benjamin.petersonsetmessages: + msg185108
2013-03-23 22:03:09ned.deilycreate