Bug 2057340
| Summary: | [abrt] python3-notebook: module(): _parser.py:42:<module>:ImportError: bad magic number in 'six': b'\x03\xf3\r\n' | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | nh | ||||||||||||||
| Component: | python-notebook | Assignee: | Miro Hrončok <mhroncok> | ||||||||||||||
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||||||||
| Severity: | unspecified | Docs Contact: | |||||||||||||||
| Priority: | unspecified | ||||||||||||||||
| Version: | 35 | CC: | ksurma, mhroncok | ||||||||||||||
| Target Milestone: | --- | ||||||||||||||||
| Target Release: | --- | ||||||||||||||||
| Hardware: | x86_64 | ||||||||||||||||
| OS: | Unspecified | ||||||||||||||||
| URL: | https://retrace.fedoraproject.org/faf/reports/bthash/4e3f81cc5cfbfcf225157eac1a039e9bbc1efd52 | ||||||||||||||||
| Whiteboard: | abrt_hash:c0ad166b9a467f083456f442a3a5309aeebcfe05;VARIANT_ID=kde; | ||||||||||||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||||||||||||
| Doc Text: | Story Points: | --- | |||||||||||||||
| Clone Of: | Environment: | ||||||||||||||||
| Last Closed: | 2022-02-23 11:30:26 UTC | Type: | --- | ||||||||||||||
| Regression: | --- | Mount Type: | --- | ||||||||||||||
| Documentation: | --- | CRM: | |||||||||||||||
| Verified Versions: | Category: | --- | |||||||||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||||||||
| Embargoed: | |||||||||||||||||
| Attachments: |
|
||||||||||||||||
|
Description
nh
2022-02-23 09:00:07 UTC
Created attachment 1862847 [details]
File: backtrace
Created attachment 1862848 [details]
File: cpuinfo
Created attachment 1862849 [details]
File: environ
Created attachment 1862850 [details]
File: mountinfo
Created attachment 1862851 [details]
File: namespaces
Created attachment 1862852 [details]
File: open_fds
Does this work?
$ python3
Python 3.10.2 (main, Jan 17 2022, 00:00:00) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import six
Or does it produce the same error?
It appears that you have a faulty installation of six somewhere on your computer, e.g. ~/.local/lib/python3.9/site-packages
- `import six` works with `python3` - When I launch `jupyter-notebook notebook.ipynb` from the terminal, it also happens. - I deleted ~/.local/lib, it only contained a site-package for pip When you launch `jupyter-notebook notebook.ipynb` what is your current working directory? Does `import six` works with `python3` from the same directory? It's just a normal folder inside `~/projects/` and yes importing six works from there too. It also happens when I just run `jupyter-notebook` I noticed when I try a `dnf update` it also shows ``` Failed loading plugin "changelog": bad magic number in 'six': b'\x03\xf3\r\n' ``` It started happening after I disabled and re-enabled the `updates` repository with `dnf config-manager --set-disabled` / `dnf config-manager --set-enabled` and the file got modified ``` .rw-r--r--@ 728 root 11 Oct 2021 fedora-cisco-openh264.repo .rw-r--r--@ 1.3k root 11 Oct 2021 fedora-modular.repo .rw-r--r--@ 1.3k root 11 Oct 2021 fedora-updates-modular.repo .rw-r--r--@ 1.4k root 11 Oct 2021 fedora-updates-testing-modular.repo .rw-r--r--@ 1.3k root 11 Oct 2021 fedora-updates-testing.repo .rw-r--r--@ 1.3k root 16 Feb 09:54 fedora-updates.repo .rw-r--r--@ 1.2k root 11 Oct 2021 fedora.repo ``` How can I restore the original `fedora-updates.repo`? This is mine: $ cat /etc/yum.repos.d/fedora-updates.repo [updates] name=Fedora $releasever - $basearch - Updates #baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Everything/$basearch/ metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch enabled=1 countme=1 repo_gpgcheck=0 type=rpm gpgcheck=1 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch skip_if_unavailable=False [updates-debuginfo] name=Fedora $releasever - $basearch - Updates - Debug #baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Everything/$basearch/debug/ metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f$releasever&arch=$basearch enabled=0 repo_gpgcheck=0 type=rpm gpgcheck=1 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch skip_if_unavailable=False [updates-source] name=Fedora $releasever - Updates Source #baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Everything/SRPMS/ metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-source-f$releasever&arch=$basearch enabled=0 repo_gpgcheck=0 type=rpm gpgcheck=1 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch skip_if_unavailable=False Could you please paste the output of: $ locate six.pyc $ locate six.cpython-310.pyc Thanks, that GitHub issue comment from `atc0005` helped as it was the same culprit. I can reproruce this with what they say in the issue:
pathlib.Path('/usr/bin/six.pyc').write_bytes(b'\x03\xf3\r\n')
...
$ dnf info python3-six --disablerepo='*'
Failed loading plugin "changelog": bad magic number in 'six': b'\x03\xf3\r\n'
The reason you cannot reproduce in pure python3 is that /usr/bin is not on PATH that way. I wonder how to remove it for scripts installed in /usr/bin but that would be a bit problematic.
Anyway, glad that this is fixed.
How to prevent this kind of problem: https://discuss.python.org/t/python-flag-envvar-not-to-put-current-directory-to-sys-path-but-dont-ignore-pythonpath/4235/2 > The reason you cannot reproduce in pure python3 is that /usr/bin is not on PATH that way.
I wanted to say:
The reason you cannot reproduce in pure python3 is that /usr/bin is not on sys.path that way.
I've opened https://github.com/rpm-software-management/dnf/pull/1815 to at least prevent this in dnf. And, I've requested Python to give more information when this happens: https://bugs.python.org/issue46835 I've also opened https://discuss.python.org/t/should-console-scripts-entry-points-exclude-teh-scripts-directory-from-sys-path/13896 for console_scripts entry points (which dnf is not but notebook is): https://discuss.python.org/t/should-console-scripts-entry-points-exclude-the-scripts-directory-from-sys-path/13896 Thank you for your efforts |