Bug 1685649

Summary: [abrt] weasyprint: HTMLInputStream(): _inputstream.py:151:HTMLInputStream:TypeError: __init__() got an unexpected keyword argument 'encoding'
Product: [Fedora] Fedora Reporter: Mike <MikeDawg>
Component: weasyprintAssignee: Eric Smith <spacewar>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: fschwarz, spacewar
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/ec1314fda6075f40ae965a75122267802e7f8d68
Whiteboard: abrt_hash:e66648477a7f88163209cc33f71ddb06bd2f2e5a;VARIANT_ID=workstation;
Fixed In Version: weasyprint-0.39-2.fc30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-30 17:58:15 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:
Bug Depends On: 1475749    
Bug Blocks:    
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: cpuinfo
none
File: environ
none
File: mountinfo
none
File: namespaces
none
File: open_fds none

Description Mike 2019-03-05 17:40:28 UTC
Description of problem:
Attempting to "convert" a file from html to pdf.

Version-Release number of selected component:
weasyprint-0.22-14.fc29

Additional info:
reporter:       libreport-2.10.0
cmdline:        /usr/bin/python3 /usr/bin/weasyprint 'Red Hat Virtualization Log Collection Analysis-ATL.html' ATL.pdf
crash_function: HTMLInputStream
exception_type: TypeError
executable:     /usr/bin/weasyprint
interpreter:    python3-3.7.2-4.fc29.x86_64
kernel:         4.20.13-200.fc29.x86_64
runlevel:       N 5
type:           Python3
uid:            5040

Truncated backtrace:
_inputstream.py:151:HTMLInputStream:TypeError: __init__() got an unexpected keyword argument 'encoding'

Traceback (most recent call last):
  File "/usr/bin/weasyprint", line 11, in <module>
    load_entry_point('WeasyPrint==0.22', 'console_scripts', 'weasyprint')()
  File "/usr/lib/python3.7/site-packages/weasyprint/__main__.py", line 155, in main
    media_type=args.media_type)
  File "/usr/lib/python3.7/site-packages/weasyprint/__init__.py", line 91, in __init__
    namespaceHTMLElements=False)
  File "/usr/lib/python3.7/site-packages/html5lib/html5parser.py", line 47, in parse
    return p.parse(doc, **kwargs)
  File "/usr/lib/python3.7/site-packages/html5lib/html5parser.py", line 289, in parse
    self._parse(stream, False, None, *args, **kwargs)
  File "/usr/lib/python3.7/site-packages/html5lib/html5parser.py", line 130, in _parse
    self.tokenizer = _tokenizer.HTMLTokenizer(stream, parser=self, **kwargs)
  File "/usr/lib/python3.7/site-packages/html5lib/_tokenizer.py", line 36, in __init__
    self.stream = HTMLInputStream(stream, **kwargs)
  File "/usr/lib/python3.7/site-packages/html5lib/_inputstream.py", line 151, in HTMLInputStream
    return HTMLBinaryInputStream(source, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'encoding'

Local variables in innermost frame:
source: <_io.BufferedReader name='Red Hat Virtualization Log Collection Analysis-ATL.html'>
kwargs: {'encoding': None}
isUnicode: False

Comment 1 Mike 2019-03-05 17:40:30 UTC
Created attachment 1541088 [details]
File: backtrace

Comment 2 Mike 2019-03-05 17:40:31 UTC
Created attachment 1541089 [details]
File: cgroup

Comment 3 Mike 2019-03-05 17:40:31 UTC
Created attachment 1541090 [details]
File: cpuinfo

Comment 4 Mike 2019-03-05 17:40:32 UTC
Created attachment 1541091 [details]
File: environ

Comment 5 Mike 2019-03-05 17:40:32 UTC
Created attachment 1541092 [details]
File: mountinfo

Comment 6 Mike 2019-03-05 17:40:33 UTC
Created attachment 1541093 [details]
File: namespaces

Comment 7 Mike 2019-03-05 17:40:34 UTC
Created attachment 1541094 [details]
File: open_fds

Comment 8 Felix Schwarz 2019-03-06 08:31:39 UTC
This is an upstream bug which occurs when html5lib is too new (https://github.com/Kozea/WeasyPrint/issues/334). It is fixed in recent versions of weasyprint and will be fixed once Fedora's weasyprint package is updated (bug 1475749). Unfortunately I can't say when this will happen as the Fedora maintainer did not touch the weasyprint package for quite a while.

Comment 9 Fedora Update System 2019-04-30 18:01:47 UTC
weasyprint-0.39-1.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-5e7ba0829d

Comment 10 Fedora Update System 2019-05-01 01:44:22 UTC
weasyprint-0.39-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-5e7ba0829d

Comment 11 Fedora Update System 2019-05-28 07:17:30 UTC
weasyprint-0.39-2.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-78c5caea7a

Comment 12 Fedora Update System 2019-05-29 01:35:36 UTC
weasyprint-0.39-2.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-78c5caea7a

Comment 13 Fedora Update System 2019-06-06 01:06:14 UTC
weasyprint-0.39-2.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.