Bug 1789175 - python-munch fails to build with Python 3.9: invalid open() mode U
Summary: python-munch fails to build with Python 3.9: invalid open() mode U
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-munch
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1766566
Blocks: PYTHON39
TreeView+ depends on / blocked
 
Reported: 2020-01-08 23:08 UTC by Charalampos Stratakis
Modified: 2020-03-04 23:58 UTC (History)
6 users (show)

Fixed In Version: python-munch-2.5.0-1.fc33
Clone Of:
Environment:
Last Closed: 2020-03-04 23:58:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Charalampos Stratakis 2020-01-08 23:08:53 UTC
python-munch fails to build with Python 3.9.0a2.

Traceback (most recent call last):
  File "/builddir/build/BUILD/munch-2.3.2/setup.py", line 9, in <module>
    package_file = open(join(HERE, 'munch', '__init__.py'), 'rU')
ValueError: invalid mode: 'rU'

This seems to be due to using 'U' mode in the open() function which was removed in Python 3.9

See: https://bugs.python.org/issue37330

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01141860-python-munch/

For all our attempts to build python-munch with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/python-munch/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.9:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33, but the initial bootstrapping has already started.
A build failure this early in the bootstrap sequence blocks us very much.

Comment 1 Charalampos Stratakis 2020-01-08 23:11:15 UTC
This can be fixed with:

diff --git a/setup.py b/setup.py
index 0bd5fc1..075f5eb 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ from setuptools import setup, find_packages
 HERE = abspath(dirname(__file__))
 readme = open(join(HERE, 'README.md')).read()
 
-package_file = open(join(HERE, 'munch', '__init__.py'), 'rU')
+package_file = open(join(HERE, 'munch', '__init__.py'), 'r')
 __version__ = re.sub(
     r".*\b__version__\s+=\s+'([^']+)'.*",
     r'\1',

Comment 2 Miro Hrončok 2020-02-06 00:46:51 UTC
This one blocks a lot of packages.

$ repoquery --repo=rawhide{,-source} --whatrequires python3-munch
copr-backend-0:1.131-2.fc32.noarch
copr-backend-0:1.131-2.fc32.src
copr-cli-0:1.84-2.fc32.src
copr-dist-git-0:0.47-2.fc32.noarch
copr-dist-git-0:0.47-2.fc32.src
copr-frontend-0:1.161-2.fc32.noarch
copr-frontend-0:1.161-2.fc32.src
copr-rpmbuild-0:0.33-2.fc32.src
copr-rpmbuild-0:0.33-2.fc32.x86_64
libtaskotron-0:0.10.3-2.fc32.src
module-build-service-0:2.32.0-1.fc32.noarch
module-build-service-0:2.32.0-1.fc32.src
odcs-0:0.2.36-3.fc32.src
pagure-0:5.8.1-2.fc32.noarch
python-copr-0:1.100-2.fc32.src
python-fedora-0:0.10.0-13.fc32.src
python-fiona-0:1.8.13-2.fc32.src
python-openstacksdk-0:0.36.0-3.fc32.src
python-shade-0:1.32.0-2.fc32.src
python3-copr-0:1.100-2.fc32.noarch
python3-fedora-0:0.10.0-13.fc32.noarch
python3-fiona-0:1.8.13-2.fc32.x86_64
python3-libtaskotron-0:0.10.3-2.fc32.noarch
python3-moss-0:0.5.0-9.fc32.noarch
python3-odcs-common-0:0.2.36-3.fc32.noarch
python3-openstacksdk-0:0.36.0-3.fc32.noarch
python3-packit-0:0.7.1-2.fc32.noarch
python3-rdopkg-0:1.1.1-2.fc32.noarch
python3-shade-0:1.32.0-2.fc32.noarch
rpkg-util-0:2.7-5.fc32.src
taskotron-trigger-0:0.7.0-6.fc32.src
vault-0:0.0.3-6.fc32.noarch

Comment 3 Miro Hrončok 2020-02-06 00:49:20 UTC
https://github.com/Infinidat/munch/commit/2bbef295879cd73ff48faa69e54f5cfef1060fcf removes the problematic code.

An update should fix this.

Comment 4 Ben Cotton 2020-02-11 17:18:23 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 5 Miro Hrončok 2020-02-28 10:01:42 UTC
Could you please update this to include the fix?

Comment 6 Miro Hrončok 2020-03-04 09:26:21 UTC
Working on this.


Note You need to log in before you can comment on or make changes to this bug.