question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scan_module(): ValueError: bad marshal data (unknown type code)

See original GitHub issue

This happens with CPython from git master (e768c86ef442ef89004089a8a34ce5909ffb90f2):

Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    install_requires=["appdirs"],
  File ".../python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File ".../python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File ".../python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File ".../python3.7/site-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File ".../python3.7/site-packages/setuptools/command/install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File ".../python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File ".../python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File ".../python3.7/site-packages/setuptools/command/bdist_egg.py", line 209, in run
    os.path.join(archive_root, 'EGG-INFO'), self.zip_safe()
  File ".../python3.7/site-packages/setuptools/command/bdist_egg.py", line 245, in zip_safe
    return analyze_egg(self.bdist_dir, self.stubs)
  File ".../python3.7/site-packages/setuptools/command/bdist_egg.py", line 355, in analyze_egg
    safe = scan_module(egg_dir, base, name, stubs) and safe
  File ".../python3.7/site-packages/setuptools/command/bdist_egg.py", line 392, in scan_module
    code = marshal.load(f)
ValueError: bad marshal data (unknown type code)

I believe this is because PEP 552 has been implemented, which adds extra 4 bytes to the .pyc header; but setuptools is not aware of that yet.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:26 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
smagafurovcommented, Feb 15, 2018

@benoit-pierre: Thank! Updating setuptools in Travis fixes the problem.

2reactions
jwilkcommented, Feb 14, 2018

sys.version_info(major=3, minor=7, micro=0, releaselevel=‘alpha’, serial=3) 16

The first version that implemented PEP 552 was v3.7.0a4. But setuptools currently does:

elif sys.version_info < (3, 7):
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix Python ValueError:bad marshal data?
In my case I was using awscli on Debian 9 and the error was "ValueError: bad marshal data (set size out of range)"....
Read more >
1207572 – [abrt] yum: config.py:27:<module>:ValueError: bad ...
Bug 1207572 - [abrt] yum: config.py:27:<module>:ValueError: bad marshal data (unknown type code). Summary: [abrt] yum: config.py:27:<module>:ValueError: bad ...
Read more >
Solved: Desktop error when importing python package
<pi>ValueError: bad marshal data (unknown type code) </pi> Details: DataSourceKind=Python DataSourcePath=Python Message=Python script error.
Read more >
ValueError: bad marshal data (unknown type code)
I'm running weewx version 4.5.1, using Python 3.7.3, platform Linux-5.10.11-v7l+-armv7l-with-debian-10.8 and locale is 'nb_NO.UTF-8'.
Read more >
ValueError: bad marshal data (unknown type code) - Installation
EDIT i reformatted SD card as apt-get threw errors so I can't diagnose this anymore. I just attempted an upgrade from 0.62.1 to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found