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 1693029

Summary: tornado FTBFS with Python 3.8: SyntaxError: invalid escape sequence
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-tornadoAssignee: Miro Hrončok <mhroncok>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: aurelien, mhroncok, orion, python-sig, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-tornado-5.1.1-1.fc31 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-03 12:15:32 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-03-27 00:35:53 UTC
Description of problem:
Invalid escape sequences are now SyntaxWarning in python 3.8:

$ python3.8
>>> '\d'
<stdin>:1: SyntaxWarning: invalid escape sequence \d
'\\d'

The test suite of tornado turns this into a SyntaxError:

+ /usr/bin/python3 -m tornado.test.runtests --verbose
/builddir/build/BUILD/tornado-5.0.2/tornado/util.py:255: SyntaxWarning: invalid escape sequence \d
...
SyntaxError: invalid escape sequence \.


Version-Release number: 5.0.2-5.fc31

Comment 1 Miro Hrončok 2019-03-27 00:36:49 UTC
The bytecompilation gives idea where the problem is:

+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1 0
Bytecompiling .py files below /builddir/build/BUILDROOT/python-tornado-5.0.2-5.fc31.x86_64/usr/lib/debug/usr/lib64/python3.8 using /usr/bin/python3.8
Bytecompiling .py files below /builddir/build/BUILDROOT/python-tornado-5.0.2-5.fc31.x86_64/usr/lib/debug/usr/lib64/python2.7 using /usr/bin/python2.7
Bytecompiling .py files below /builddir/build/BUILDROOT/python-tornado-5.0.2-5.fc31.x86_64/usr/lib64/python2.7 using /usr/bin/python2.7
Bytecompiling .py files below /builddir/build/BUILDROOT/python-tornado-5.0.2-5.fc31.x86_64/usr/lib64/python3.8 using /usr/bin/python3.8
/usr/lib64/python3.8/web_test.py:365: SyntaxWarning: invalid escape sequence \?
/usr/lib64/python3.8/util.py:255: SyntaxWarning: invalid escape sequence \d
/usr/lib64/python3.8/web.py:1834: SyntaxWarning: invalid escape sequence \.
/usr/lib64/python3.8/web_test.py:365: SyntaxWarning: invalid escape sequence \?
/usr/lib64/python3.8/util.py:255: SyntaxWarning: invalid escape sequence \d
/usr/lib64/python3.8/web.py:1834: SyntaxWarning: invalid escape sequence \.

Comment 2 Miro Hrončok 2019-03-27 00:54:51 UTC
The fix is part of this upstream commit: https://github.com/tornadoweb/tornado/commit/6dceb64ed27c1d48af22142f2ebae946f0e85e95

Comment 3 Miro Hrončok 2019-03-27 09:43:51 UTC
Ok, that is not the only failure:

======================================================================
FAIL: test_inline_read_error (tornado.test.iostream_test.TestIOStreamSSL)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tornado/testing.py", line 124, in __call__
    result = self.orig_method(*args, **kwargs)
  File "tornado/test/iostream_test.py", line 931, in test_inline_read_error
    server.read_bytes(1, lambda data: None)
AssertionError: error not raised

======================================================================
FAIL: test_inline_read_error (tornado.test.iostream_test.TestIOStreamSSLContext)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tornado/testing.py", line 124, in __call__
    result = self.orig_method(*args, **kwargs)
  File "tornado/test/iostream_test.py", line 931, in test_inline_read_error
    server.read_bytes(1, lambda data: None)
AssertionError: error not raised

----------------------------------------------------------------------
Ran 1493 tests in 18.546s