Pull requests

#10 Merged
Repository
msabramo/distribute_msabramo_py33 distribute_msabramo_py33
Branch
default
Repository
tarek/distribute distribute
Branch
default

Add tests and fix for marshal.load of pyc files on Python 3.3

Author
  1. Marc Abramowitz
Reviewers
Description

In Python 3.3, the number of bytes in the header of pyc files before the code object changed from 8 to 12.

Result of test before fix:

{{{ ~/dev/hg-repos/distribute_msabramo_py33/tests$ nosetests -s -v test_python33_bdist_egg.py test_build_egg (test_python33_bdist_egg.TestPython33BdistEgg) ... running bdist_egg running egg_info ... Traceback (most recent call last): File "setup.py", line 11, in <module> url='https://bitbucket.org/msabramo/python3.3_bdist_egg_test', File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/distutils/core.py", line 148, in setup dist.run_commands() File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/distutils/dist.py", line 917, in run_commands self.run_command(cmd) File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/distutils/dist.py", line 936, in run_command cmd_obj.run() File "/Users/marca/dev/hg-repos/distribute_msabramo_py33/py33.venv/lib/python3.3/site-packages/distribute-0.6.28dev-py3.3.egg/setuptools/command/bdist_egg.py", line 227, in run os.path.join(archive_root,'EGG-INFO'), self.zip_safe() File "/Users/marca/dev/hg-repos/distribute_msabramo_py33/py33.venv/lib/python3.3/site-packages/distribute-0.6.28dev-py3.3.egg/setuptools/command/bdist_egg.py", line 266, in zip_safe return analyze_egg(self.bdist_dir, self.stubs) File "/Users/marca/dev/hg-repos/distribute_msabramo_py33/py33.venv/lib/python3.3/site-packages/distribute-0.6.28dev-py3.3.egg/setuptools/command/bdist_egg.py", line 402, in analyze_egg safe = scan_module(egg_dir, base, name, stubs) and safe File "/Users/marca/dev/hg-repos/distribute_msabramo_py33/py33.venv/lib/python3.3/site-packages/distribute-0.6.28dev-py3.3.egg/setuptools/command/bdist_egg.py", line 430, in scan_module code = marshal.load(f); f.close() ValueError: bad marshal data (unknown type code) FAIL

====================================================================== FAIL: test_build_egg (test_python33_bdist_egg.TestPython33BdistEgg)


Traceback (most recent call last): File "/Users/marca/dev/hg-repos/distribute_msabramo_py33/tests/test_python33_bdist_egg.py", line 21, in test_build_egg self.assertTrue(_python_cmd("setup.py", "bdist_egg")) AssertionError: False is not true


Ran 1 test in 0.472s

FAILED (failures=1) }}}

Result of test after fix:

{{{ ~/dev/hg-repos/distribute_msabramo_py33/tests$ nosetests -s -v test_python33_bdist_egg.py test_build_egg (test_python33_bdist_egg.TestPython33BdistEgg) ... running bdist_egg running egg_info writing dependency_links to python3.3_bdist_egg_test.egg-info/dependency_links.txt writing python3.3_bdist_egg_test.egg-info/PKG-INFO writing top-level names to python3.3_bdist_egg_test.egg-info/top_level.txt reading manifest file 'python3.3_bdist_egg_test.egg-info/SOURCES.txt' writing manifest file 'python3.3_bdist_egg_test.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-10.6-intel/egg running install_lib running build_py copying python3.3_bdist_egg_test.egg-info/PKG-INFO -> build/bdist.macosx-10.6-intel/egg/EGG-INFO copying python3.3_bdist_egg_test.egg-info/SOURCES.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO copying python3.3_bdist_egg_test.egg-info/dependency_links.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO copying python3.3_bdist_egg_test.egg-info/top_level.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO zip_safe flag not set; analyzing archive contents... creating 'dist/python3.3_bdist_egg_test-0.0.0-py3.3.egg' and adding 'build/bdist.macosx-10.6-intel/egg' to it removing 'build/bdist.macosx-10.6-intel/egg' (and everything under it) ok


Ran 1 test in 0.332s

OK }}}

  • Learn about pull requests

Comments (1)