Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1721628

Summary: python-txtorcon fails to build with Python 3.8
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-txtorconAssignee: Fabio Valentini <decathorpe>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: decathorpe
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-30 14:50:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1686977    

Description Miro Hrončok 2019-06-18 18:27:41 UTC
python-txtorcon fails to build with Python 3.8.0b1.


test.test_util_imports.TestImports.test_no_GeoIP
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/usr/lib64/python3.8/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/builddir/build/BUILD/txtorcon-19.0.0/test/test_controller.py", line 1020, in test_web_agent_defaults
    resp = yield agent.request('GET', b'meejah.ca')
  File "/usr/lib64/python3.8/site-packages/twisted/web/client.py", line 1732, in request
    return self._requestWithEndpoint(key, endpoint, method, parsedURI,
  File "/usr/lib64/python3.8/site-packages/twisted/web/client.py", line 1499, in _requestWithEndpoint
    method = _ensureValidMethod(method)
  File "/usr/lib64/python3.8/site-packages/twisted/web/_newclient.py", line 618, in _ensureValidMethod
    if _VALID_METHOD.match(method):
builtins.TypeError: cannot use a bytes pattern on a string-like object

test.test_controller.WebAgentTests.test_web_agent_defaults
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/usr/lib64/python3.8/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/builddir/build/BUILD/txtorcon-19.0.0/test/test_controller.py", line 1034, in test_web_agent_deferred
    resp = yield agent.request('GET', b'meejah.ca')
  File "/usr/lib64/python3.8/site-packages/twisted/web/client.py", line 1732, in request
    return self._requestWithEndpoint(key, endpoint, method, parsedURI,
  File "/usr/lib64/python3.8/site-packages/twisted/web/client.py", line 1499, in _requestWithEndpoint
    method = _ensureValidMethod(method)
  File "/usr/lib64/python3.8/site-packages/twisted/web/_newclient.py", line 618, in _ensureValidMethod
    if _VALID_METHOD.match(method):
builtins.TypeError: cannot use a bytes pattern on a string-like object

test.test_controller.WebAgentTests.test_web_agent_deferred
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/usr/lib64/python3.8/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/builddir/build/BUILD/txtorcon-19.0.0/test/test_controller.py", line 1049, in test_web_agent_endpoint
    resp = yield agent.request('GET', b'meejah.ca')
  File "/usr/lib64/python3.8/site-packages/twisted/web/client.py", line 1732, in request
    return self._requestWithEndpoint(key, endpoint, method, parsedURI,
  File "/usr/lib64/python3.8/site-packages/twisted/web/client.py", line 1499, in _requestWithEndpoint
    method = _ensureValidMethod(method)
  File "/usr/lib64/python3.8/site-packages/twisted/web/_newclient.py", line 618, in _ensureValidMethod
    if _VALID_METHOD.match(method):
builtins.TypeError: cannot use a bytes pattern on a string-like object

test.test_controller.WebAgentTests.test_web_agent_endpoint
-------------------------------------------------------------------------------
Ran 671 tests in 1.138s

FAILED (skips=1, errors=3, successes=667)


For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.8/fedora-rawhide-x86_64/00940768-python-txtorcon/

For all our attempts to build python-txtorcon with Python 3.8, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.8/package/python-txtorcon/

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.8:
https://copr.fedorainfracloud.org/coprs/g/python/python3.8/

Let us know here if you have any questions.

Comment 1 Fabio Valentini 2019-06-21 06:47:12 UTC
This looks like it's unrelated to python 3.8, since it also started to fail in koschei with the current python version.

From what I can tell, the issue is caused by the latest twisted version update (19.2.0 → 19.2.1).

Comment 2 Miro Hrončok 2019-07-15 09:39:33 UTC
Let's report it upstream?

Comment 3 Fabio Valentini 2019-07-15 10:08:45 UTC
Yeah. Upon further investigation, this is probably fallout from this security fix for CVE-2019-12387:
https://github.com/twisted/twisted/compare/twisted-19.2.0...twisted-19.2.1

I don't think that fixing a security issue should change accepted argument types though.

I might suffer from too little sleep, but I can't find the twisted issue tracker --
Their website is broken garbage, and issues are disabled on the GitHub repo.

https://www.twistedmatrix.com/

I mean, it would probably be possible to fix this in txtorcon (change "GET" to b"GET" everywhere?), but other packages are might be affected by this bug as well.

Comment 4 Miro Hrončok 2019-07-15 10:28:12 UTC
Their Trac instance is at https://twistedmatrix.com/trac/report (and I fail to use ti as well).

Comment 5 Fabio Valentini 2019-07-23 16:44:26 UTC
I tried this:

https://twitter.com/decathorpe/status/1153707276978610177

Maybe it helps.

Comment 6 Fabio Valentini 2019-07-24 00:09:41 UTC
Someone responded on twitter - using strs there was always wrong, but was accepted by accident.
I will patch txtorcon to fix this.

Comment 7 Fabio Valentini 2019-07-27 09:13:25 UTC
I've included an upstream patch restoring compatibility with twisted 19.2.1, package built for rawhide:
https://koji.fedoraproject.org/koji/buildinfo?buildID=1341372

This should also make it build in the python 3.8 test COPR. I hope.

Comment 8 Miro Hrončok 2019-07-30 14:50:00 UTC
Thank you.