Bug 1705300 - certbot FTBFS with Python 3.8
Summary: certbot FTBFS with Python 3.8
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: certbot
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Eli Young
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F32FTBFS F32FailsToInstall PYTHON38
TreeView+ depends on / blocked
 
Reported: 2019-05-01 23:47 UTC by Miro Hrončok
Modified: 2019-09-12 12:36 UTC (History)
8 users (show)

Fixed In Version: python-certbot-0.34.2-1.fc31, certbot-0.38.0-1.fc32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-09-12 12:36:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Full log from Copr (244.17 KB, text/plain)
2019-05-01 23:47 UTC, Miro Hrončok
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github certbot certbot issues 7106 0 None closed Stop using platform.linux_distribution in Python 3.8+ 2020-05-03 14:48:42 UTC

Description Miro Hrončok 2019-05-01 23:47:43 UTC
Created attachment 1561223 [details]
Full log from Copr

certbot-0.31.0-3.fc31 fails %check on Python 3.8:

======================================================================
ERROR: test_non_systemd_os_info (certbot.tests.util_test.OsInfoTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/builddir/build/BUILD/certbot-0.31.0/certbot/tests/util_test.py", line 576, in test_non_systemd_os_info
    with mock.patch('platform.linux_distribution',
  File "/usr/lib/python3.8/site-packages/mock/mock.py", line 1369, in __enter__
    original, local = self.get_original()
  File "/usr/lib/python3.8/site-packages/mock/mock.py", line 1342, in get_original
    raise AttributeError(
AttributeError: <module 'platform' from '/usr/lib64/python3.8/platform.py'> does not have the attribute 'linux_distribution'

----------------------------------------------------------------------
Ran 885 tests in 28.429s

Full log attached.


platfrom.linux_distribution was deprecated since Python 3.5 and removed in 3.8:

https://docs.python.org/3.7/library/platform.html#platform.linux_distribution

This blocks all the other certbot packages.

Comment 2 Miro Hrončok 2019-05-29 11:09:35 UTC
=================================== FAILURES ===================================
_____________________ OsInfoTest.test_non_systemd_os_info ______________________

self = <certbot.tests.util_test.OsInfoTest testMethod=test_non_systemd_os_info>
popen_mock = <MagicMock name='Popen' id='140428314846208'>

    @mock.patch("certbot.util.subprocess.Popen")
    def test_non_systemd_os_info(self, popen_mock):
        from certbot.util import (get_os_info, get_python_os_info,
                                     get_os_info_ua)
        with mock.patch('os.path.isfile', return_value=False):
            with mock.patch('platform.system_alias',
                            return_value=('NonSystemD', '42', '42')):
                self.assertEqual(get_os_info()[0], 'nonsystemd')
                self.assertEqual(get_os_info_ua(),
                                 " ".join(get_python_os_info()))
    
            with mock.patch('platform.system_alias',
                            return_value=('darwin', '', '')):
                comm_mock = mock.Mock()
                comm_attrs = {'communicate.return_value':
                              ('42.42.42', 'error')}
                comm_mock.configure_mock(**comm_attrs)
                popen_mock.return_value = comm_mock
                self.assertEqual(get_os_info()[0], 'darwin')
                self.assertEqual(get_os_info()[1], '42.42.42')
    
            with mock.patch('platform.system_alias',
                            return_value=('linux', '', '')):
>               with mock.patch('platform.linux_distribution',
                                return_value=('', '', '')):

certbot/tests/util_test.py:571: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.8/site-packages/mock/mock.py:1369: in __enter__
    original, local = self.get_original()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <mock.mock._patch object at 0x7fb8039b7820>

    def get_original(self):
        target = self.getter()
        name = self.attribute
    
        original = DEFAULT
        local = False
    
        try:
            original = target.__dict__[name]
        except (AttributeError, KeyError):
            original = getattr(target, name, DEFAULT)
        else:
            local = True
    
        if name in _builtins and isinstance(target, ModuleType):
            self.create = True
    
        if not self.create and original is DEFAULT:
>           raise AttributeError(
                "%s does not have the attribute %r" % (target, name)
            )
E           AttributeError: <module 'platform' from '/usr/lib64/python3.8/platform.py'> does not have the attribute 'linux_distribution'

/usr/lib/python3.8/site-packages/mock/mock.py:1342: AttributeError
=============================== warnings summary ===============================

Comment 3 Eli Young 2019-05-29 18:55:22 UTC
Oop, sorry for the premature closure; somehow I thought that was fixed in the current version of certbot, but I appear to have misread the code. Reaching out to upstream to get this resolved.

Comment 4 Eli Young 2019-05-29 19:57:53 UTC
A ticket has been opened upstream.

Comment 5 Miro Hrončok 2019-07-10 10:06:21 UTC
Things started to move upstream. Please backport the change when available, this blocks an entire stack of certbot packages.

Comment 6 Charalampos Stratakis 2019-07-23 14:15:25 UTC
Any updates here?

Comment 7 Eli Young 2019-07-23 22:15:12 UTC
Upstream is still working on the matter and has been making a lot of progress. I will be updating this for Fedora as soon as upstream is ready.

Comment 8 Ben Cotton 2019-08-13 16:48:44 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 9 Miro Hrončok 2019-08-14 22:24:15 UTC
The coordinated rebuild of Python 3.8 has started in the `f32-python` side tag.

If you figure out how to rebuild this package, please don't rebuild it in regular rawhide, but use the side tag instead:

    on branch master:
    $ fedpkg build --target=f32-python

To wait for a build to show up in the side tag, do:

    $ koji wait-repo f32-python --build=<nvr>

Where <nvr> is name-version-release of the source package, e.g. python-foo-1.1-2.fc32.

An updated mock config is posted at:
http://copr.fedorainfracloud.org/coprs/g/python/python3.8/

Note that it will take a while before the essential packages are rebuilt, so don't expect all your dependencies to be available right away.

Thanks. Let us know if you need up to date info, or if you have any questions.



PS this message is mass posted to all the bugs that block the PYTHON38 bug. If this is also a Fedora 31 FTBFS bug and you manage to fix it, you can do a f31 build as usual:

    on branch f31:
    $ fedpkg build

Comment 10 Miro Hrončok 2019-08-21 16:34:29 UTC
The f32-python side tag has been merged. In order to rebuild the package, do it in regular rawhide, but please wait until python3-3.8 is tagged:

  $ koji wait-repo f32-build --build python3-3.8.0~b3-3.fc32


If your built already started in f32-python, after it is finished, please tag it to rawhide with:

  $ koji tag-build f32-pending <nvr>

For example:

  $ koji tag-build f32-pending libreoffice-6.3.0.4-3.fc32

Thanks!

(This comment is mass posted to all bugzillas blocking the PYTHON38 tracking bug.)

Comment 11 Miro Hrončok 2019-08-21 17:29:04 UTC
(Python 3.8 has landed in the rawhide buildroot.)


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