Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting the following error: "ValueError: too many values to unpack (expected 4)" #1811

Closed
Mo0rBy opened this issue Feb 17, 2023 · 2 comments
Labels
crash Problems preventing documents from being rendered

Comments

@Mo0rBy
Copy link

Mo0rBy commented Feb 17, 2023

I'm attempting to convert a Sonarqube report page from html to pdf. I was first having an issue with the javascript rendered elements on the page and I solved that by writing a python script that uses requests_html that can render the javascript elements and write the html to a file. I can then take this file and put it through Weasyprint to create a pdf.

My issue is that I get the error ValueError: too many values to unpack (expected 4), here is my full stacktrace:

Traceback (most recent call last):
  File "/usr/bin/weasyprint", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/weasyprint/__main__.py", line 218, in main
    html.write_pdf(output, **kwargs)
  File "/usr/lib/python3.10/site-packages/weasyprint/__init__.py", line 201, in write_pdf
    .write_pdf(
  File "/usr/lib/python3.10/site-packages/weasyprint/document.py", line 347, in write_pdf
    pdf = generate_pdf(
  File "/usr/lib/python3.10/site-packages/weasyprint/pdf/__init__.py", line 336, in generate_pdf
    page.paint(stream, scale=scale)
  File "/usr/lib/python3.10/site-packages/weasyprint/document.py", line 96, in paint
    draw_page(self._page_box, stream)
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 68, in draw_page
    draw_stacking_context(stream, stacking_context)
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 176, in draw_stacking_context
    draw_stacking_context(stream, child_context)
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 180, in draw_stacking_context
    draw_stacking_context(stream, child_context)
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 176, in draw_stacking_context
    draw_stacking_context(stream, child_context)
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 169, in draw_stacking_context
    draw_inline_level(
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 983, in draw_inline_level
    draw_inline_level(
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 989, in draw_inline_level
    draw_replacedbox(stream, box)
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 945, in draw_replacedbox
    box.replacement.draw(
  File "/usr/lib/python3.10/site-packages/weasyprint/images.py", line 89, in draw
    self._svg.draw(
  File "/usr/lib/python3.10/site-packages/weasyprint/svg/__init__.py", line 365, in draw
    self.draw_node(self.tree, size('12pt'))
  File "/usr/lib/python3.10/site-packages/weasyprint/svg/__init__.py", line 430, in draw_node
    self.draw_node(child, font_size, fill_stroke)
  File "/usr/lib/python3.10/site-packages/weasyprint/svg/__init__.py", line 439, in draw_node
    self.fill_stroke(node, font_size)
  File "/usr/lib/python3.10/site-packages/weasyprint/svg/__init__.py", line 612, in fill_stroke
    red, green, blue, alpha = color(fill_color)
ValueError: too many values to unpack (expected 4)

Here is my full console output as well, just in case any of it is useful to see (using the --verbose and --debug flags):

INFO: Step 1 - Fetching and parsing HTML - testHtml.html
INFO: Step 2 - Fetching and parsing CSS - CSS string
WARNING: Ignored `overflow-y:scroll` at 1:77, unknown property.
WARNING: Invalid or unsupported selector 'button::-moz-focus-inner,input::-moz-focus-inner,select::-moz-focus-inner', (<IdentToken -moz-focus-inner>, 'Expected a supported pseudo-element, got -moz-focus-inner')
WARNING: Ignored `max-width:8vw` at 1:2703, invalid value.
WARNING: Ignored `max-width:16vw` at 1:2844, invalid value.
DEBUG: Ignored `cursor:pointer` at 1:3455, the property does not apply for the print media.
DEBUG: Ignored `transition:all .2s ease` at 1:3501, the property does not apply for the print media.
DEBUG: Ignored `cursor:not-allowed` at 1:4194, the property does not apply for the print media.
DEBUG: Ignored `cursor:default` at 1:4416, the property does not apply for the print media.
DEBUG: Ignored `cursor:pointer` at 1:8635, the property does not apply for the print media.
DEBUG: Ignored `transition:border-color .2s ease` at 1:9147, the property does not apply for the print media.
WARNING: Ignored `box-shadow:none` at 1:9559, unknown property.
WARNING: Ignored `box-shadow:none` at 1:9776, unknown property.
WARNING: Invalid or unsupported selector 'input[type=date]:invalid,input[type=email]:invalid,input[type=number]:invalid,input[type=password]:invalid,input[type=search]:invalid,input[type=text]:invalid,select:invalid,textarea:invalid', ('Unknown pseudo-class', 'invalid')
WARNING: Invalid or unsupported selector 'input:-ms-input-placeholder,textarea:-ms-input-placeholder', ('Unknown pseudo-class', '-ms-input-placeholder')
WARNING: Invalid or unsupported selector 'input::-ms-input-placeholder,textarea::-ms-input-placeholder', (<IdentToken -ms-input-placeholder>, 'Expected a supported pseudo-element, got -ms-input-placeholder')
WARNING: Invalid or unsupported selector 'input::placeholder,textarea::placeholder', unknown pseudo-element: placeholder
DEBUG: Ignored `cursor:not-allowed` at 1:10679, the property does not apply for the print media.
WARNING: Ignored `pointer-events:none` at 1:10708, unknown property.
WARNING: Ignored `box-shadow:none` at 1:10738, unknown property.
DEBUG: Ignored `-webkit-appearance:textfield` at 1:10920, prefixed selectors are ignored.
DEBUG: Ignored `-webkit-appearance:none` at 1:10995, prefixed selectors are ignored.
WARNING: Ignored `resize:vertical` at 1:11095, unknown property.
WARNING: Ignored `fill:#999` at 1:12226, unknown property.
DEBUG: Ignored `transition:all .2s ease` at 1:12281, the property does not apply for the print media.
WARNING: Ignored `stroke:#666` at 1:12334, unknown property.
WARNING: Ignored `stroke-width:1.41421356` at 1:12346, unknown property.
WARNING: Ignored `stroke-opacity:1` at 1:12370, unknown property.
WARNING: Ignored `fill-opacity:0` at 1:12387, unknown property.
WARNING: Ignored `vector-effect:non-scaling-stroke` at 1:12402, unknown property.
DEBUG: Ignored `transition:all .2s ease` at 1:12435, the property does not apply for the print media.
WARNING: Ignored `fill:currentColor` at 1:12488, unknown property.
WARNING: Ignored `stroke:currentColor` at 1:12506, unknown property.
WARNING: Ignored `fill-opacity:1` at 1:12526, unknown property.
WARNING: Ignored `overflow-y:auto` at 1:15384, unknown property.
WARNING: Ignored `pointer-events:none` at 1:16342, unknown property.
DEBUG: Ignored `transition:opacity .5s ease` at 1:17796, the property does not apply for the print media.
DEBUG: Ignored `cursor:pointer` at 1:18477, the property does not apply for the print media.
DEBUG: Ignored `cursor:not-allowed` at 1:18512, the property does not apply for the print media.
WARNING: Ignored `word-break:break-word` at 1:18913, invalid value.
WARNING: Ignored `box-shadow:inset 0 1px 0 #fff,0 1px 0 #ccc` at 1:19191, unknown property.
DEBUG: Ignored `animation:spin .75s linear infinite` at 1:20068, the property does not apply for the print media.
DEBUG: Ignored `animation-duration:1.2s` at 1:20390, the property does not apply for the print media.
DEBUG: Ignored `transition:none` at 1:21509, the property does not apply for the print media.
DEBUG: Ignored `cursor:not-allowed` at 1:21847, the property does not apply for the print media.
WARNING: Ignored `pointer-events:none` at 1:21876, unknown property.
WARNING: Ignored `overflow-y:auto` at 1:22342, unknown property.
DEBUG: Ignored `transition:opacity .3s ease` at 1:22613, the property does not apply for the print media.
WARNING: Ignored `min-height:100vh` at 1:23451, invalid value.
WARNING: Ignored `padding-left:calc(50vw - 360px)` at 1:24870, invalid value.
DEBUG: Ignored `-webkit-user-select:none` at 1:25117, prefixed selectors are ignored.
DEBUG: Ignored `-ms-user-select:none` at 1:25142, prefixed selectors are ignored.
WARNING: Ignored `user-select:none` at 1:25163, unknown property.
WARNING: Ignored `width:calc(50vw - 357px)` at 1:25732, invalid value.
WARNING: Expected a media type, got '(max-width:1335px)'
WARNING: Invalid media type ' (max-width:1335px)' the whole @media rule was ignored at 1:25829.
WARNING: Ignored `width:calc(50vw - 370px)` at 1:26277, invalid value.
WARNING: Ignored `overflow-y:auto` at 1:26427, unknown property.
WARNING: Ignored `overflow-x:hidden` at 1:26443, unknown property.
WARNING: Ignored `margin-left:calc(50vw - 670px)` at 1:26497, invalid value.
WARNING: Ignored `left:calc(50vw - 369px)` at 1:27018, invalid value.
WARNING: Expected a media type, got '(max-width:1320px)'
WARNING: Invalid media type ' (max-width:1320px)' the whole @media rule was ignored at 1:27087.
DEBUG: Ignored `transition:none` at 1:28435, the property does not apply for the print media.
WARNING: Ignored `margin-top:-var(--gridSize)` at 1:30722, invalid value.
WARNING: Ignored `margin-bottom:-var(--gridSize)` at 1:30750, invalid value.
DEBUG: Ignored `transition:border-color .3s ease` at 1:30897, the property does not apply for the print media.
DEBUG: Ignored `cursor:pointer` at 1:31125, the property does not apply for the print media.
DEBUG: Ignored `cursor:default` at 1:31217, the property does not apply for the print media.
DEBUG: Ignored `transition:color .3s ease` at 1:31591, the property does not apply for the print media.
DEBUG: Ignored `transition:none` at 1:31955, the property does not apply for the print media.
DEBUG: Ignored `cursor:hand` at 1:35483, the property does not apply for the print media.
DEBUG: Ignored `cursor:pointer` at 1:35495, the property does not apply for the print media.
DEBUG: Ignored `animation:highlightedFadeIn .3s forwards` at 1:35548, the property does not apply for the print media.
INFO: Step 2 - Fetching and parsing CSS - CSS string
DEBUG: Ignored `animation:spin .75s linear infinite` at 1:125, the property does not apply for the print media.
DEBUG: Ignored `animation-duration:1.2s` at 1:492, the property does not apply for the print media.
INFO: Step 2 - Fetching and parsing CSS - CSS string
DEBUG: Ignored `cursor:pointer` at 1:290, the property does not apply for the print media.
DEBUG: Ignored `transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease` at 1:318, the property does not apply for the print media.
WARNING: Ignored `box-shadow:inset 0 3px 5px rgba(0,0,0,.125)` at 1:478, unknown property.
WARNING: Ignored `box-shadow:0 0 0 3px rgba(35,106,151,.25)` at 1:536, unknown property.
DEBUG: Ignored `cursor:not-allowed` at 1:957, the property does not apply for the print media.
WARNING: Ignored `box-shadow:none` at 1:986, unknown property.
WARNING: Ignored `box-shadow:0 0 0 3px rgba(212,51,63,.25)` at 1:1144, unknown property.
WARNING: Ignored `box-shadow:0 0 0 3px rgba(0,170,0,.25)` at 1:1324, unknown property.
DEBUG: Ignored `transition:border-color .2s ease,box-shadow .2s ease,color .2s ease,border-bottom .2s ease` at 1:1572, the property does not apply for the print media.
WARNING: Ignored `box-shadow:none` at 1:1800, unknown property.
DEBUG: Ignored `cursor:default` at 1:1909, the property does not apply for the print media.
DEBUG: Ignored `transition:all .2s ease` at 1:2243, the property does not apply for the print media.
WARNING: Ignored `box-shadow:0 1px 1px 1px #e6e6e6` at 1:2267, unknown property.
WARNING: Ignored `box-shadow:0 6px 12px rgba(0,0,0,.175)` at 1:2394, unknown property.
DEBUG: Ignored `cursor:pointer` at 1:2671, the property does not apply for the print media.
DEBUG: Ignored `-webkit-user-select:none` at 1:4058, prefixed selectors are ignored.
DEBUG: Ignored `-ms-user-select:none` at 1:4093, prefixed selectors are ignored.
WARNING: Ignored `user-select:none` at 1:4124, unknown property.
INFO: Step 2 - Fetching and parsing CSS - CSS string
DEBUG: Ignored `animation:fadeIn .3s forwards` at 1:136, the property does not apply for the print media.
WARNING: Ignored `word-break:break-word` at 1:446, invalid value.
WARNING: Ignored `pointer-events:none` at 1:1300, unknown property.
INFO: Step 2 - Fetching and parsing CSS - CSS string
DEBUG: Ignored `transition:all .2s ease` at 1:135, the property does not apply for the print media.
WARNING: Ignored `width:calc(100% - 40px)` at 1:393, invalid value.
DEBUG: Ignored `transition:all .2s ease` at 1:628, the property does not apply for the print media.
WARNING: Ignored `max-height:60vh` at 1:1030, invalid value.
WARNING: Ignored `overflow-y:auto` at 1:1068, unknown property.
WARNING: Ignored `width:calc(100% - 24px)` at 1:2013, invalid value.
WARNING: Ignored `max-height:50vh` at 1:2122, invalid value.
INFO: Step 2 - Fetching and parsing CSS - CSS string
WARNING: Ignored `box-shadow:0 -6px 12px rgba(0,0,0,.175)` at 1:617, unknown property.
DEBUG: Ignored `cursor:ns-resize` at 1:1786, the property does not apply for the print media.
WARNING: Ignored `height:calc(40vh - 30px)` at 1:1993, invalid value.
WARNING: Ignored `max-height:calc(95vh - 30px)` at 1:2035, invalid value.
WARNING: Ignored `overflow-y:scroll` at 1:2081, unknown property.
WARNING: Ignored `overflow-x:auto` at 1:2099, unknown property.
WARNING: Ignored `padding-bottom:40vh` at 1:2168, invalid value.
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 2 - Fetching and parsing CSS - CSS string
WARNING: Ignored `box-shadow:0 6px 12px rgba(0,0,0,.175)` at 1:171, unknown property.
DEBUG: Ignored `cursor:default` at 1:210, the property does not apply for the print media.
WARNING: Ignored `left:calc(50% - 6px)` at 1:657, invalid value.
WARNING: Ignored `top:calc(100% - 15px)` at 1:2695, invalid value.
WARNING: Ignored `bottom:calc(100% + 8px)` at 1:2995, invalid value.
WARNING: Ignored `top:unset` at 1:3425, invalid value.
WARNING: Ignored `left:unset` at 1:3435, invalid value.
WARNING: Ignored `transform:unset` at 1:3446, invalid value.
WARNING: Ignored `top:unset` at 1:3681, invalid value.
WARNING: Ignored `right:unset` at 1:3691, invalid value.
WARNING: Ignored `bottom:unset` at 1:3703, invalid value.
WARNING: Ignored `left:unset` at 1:3716, invalid value.
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 2 - Fetching and parsing CSS - CSS string
DEBUG: Ignored `-webkit-appearance:none` at 1:447, prefixed selectors are ignored.
WARNING: Invalid or unsupported selector '.search-box-input::-webkit-search-cancel-button,.search-box-input::-webkit-search-decoration,.search-box-input::-webkit-search-results-button,.search-box-input::-webkit-search-results-decoration', (<IdentToken -webkit-search-cancel-button>, 'Expected a supported pseudo-element, got -webkit-search-cancel-button')
WARNING: Invalid or unsupported selector '.search-box-input::-ms-clear,.search-box-input::-ms-reveal', (<IdentToken -ms-clear>, 'Expected a supported pseudo-element, got -ms-clear')
WARNING: Ignored `pointer-events:none` at 1:755, unknown property.
DEBUG: Ignored `transition:color .3s ease` at 1:903, the property does not apply for the print media.
INFO: Step 2 - Fetching and parsing CSS - CSS string
WARNING: Ignored `width:26vw` at 1:108, invalid value.
WARNING: Ignored `max-height:80vh` at 1:1317, invalid value.
WARNING: Ignored `overflow-y:auto` at 1:1365, unknown property.
WARNING: Ignored `overflow-x:hidden` at 1:1381, unknown property.
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 2 - Fetching and parsing CSS - CSS string
WARNING: Ignored `overflow-y:auto` at 1:378, unknown property.
DEBUG: Ignored `cursor:pointer` at 1:632, the property does not apply for the print media.
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 2 - Fetching and parsing CSS - CSS string
WARNING: Ignored `text-shadow:0 0 1px rgba(0,0,0,.35)` at 1:195, unknown property.
DEBUG: Ignored `transition:all .2s ease` at 1:504, the property does not apply for the print media.
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 2 - Fetching and parsing CSS - CSS string
DEBUG: Ignored `transition:none` at 1:266, the property does not apply for the print media.
INFO: Step 2 - Fetching and parsing CSS - CSS string
DEBUG: Ignored `cursor:default` at 1:211, the property does not apply for the print media.
INFO: Step 2 - Fetching and parsing CSS - CSS string
DEBUG: Ignored `transition:right .3s ease-in-out` at 1:133, the property does not apply for the print media.
DEBUG: Ignored `cursor:pointer` at 1:421, the property does not apply for the print media.
INFO: Step 2 - Fetching and parsing CSS - CSS string
WARNING: Ignored `overflow-y:hidden` at 1:130, unknown property.
WARNING: Ignored `overflow-x:auto` at 1:148, unknown property.
INFO: Step 2 - Fetching and parsing CSS - CSS string
WARNING: Ignored `box-shadow:none` at 1:311, unknown property.
DEBUG: Ignored `cursor:not-allowed` at 1:376, the property does not apply for the print media.
WARNING: Ignored `pointer-events:none` at 1:405, unknown property.
DEBUG: Ignored `cursor:default` at 1:719, the property does not apply for the print media.
DEBUG: Ignored `cursor:text` at 1:802, the property does not apply for the print media.
DEBUG: Ignored `cursor:text` at 1:1072, the property does not apply for the print media.
DEBUG: Ignored `cursor:pointer` at 1:1977, the property does not apply for the print media.
DEBUG: Ignored `cursor:default` at 1:2604, the property does not apply for the print media.
WARNING: Ignored `box-shadow:none` at 1:2719, unknown property.
DEBUG: Ignored `-webkit-appearance:none` at 1:2735, prefixed selectors are ignored.
DEBUG: Ignored `cursor:text` at 1:2791, the property does not apply for the print media.
DEBUG: Ignored `cursor:pointer` at 1:2940, the property does not apply for the print media.
DEBUG: Ignored `animation:Select-animation-spin .4s linear infinite` at 1:3059, the property does not apply for the print media.
DEBUG: Ignored `animation:Select-animation-fadeIn .2s` at 1:3335, the property does not apply for the print media.
DEBUG: Ignored `cursor:pointer` at 1:3384, the property does not apply for the print media.
DEBUG: Ignored `cursor:pointer` at 1:4672, the property does not apply for the print media.
DEBUG: Ignored `-webkit-overflow-scrolling:touch` at 1:5332, prefixed selectors are ignored.
WARNING: Ignored `box-shadow:0 6px 12px rgba(0,0,0,.175)` at 1:5365, unknown property.
WARNING: Ignored `overflow-y:auto` at 1:5448, unknown property.
DEBUG: Ignored `cursor:pointer` at 1:5572, the property does not apply for the print media.
DEBUG: Ignored `cursor:default` at 1:5810, the property does not apply for the print media.
DEBUG: Ignored `cursor:default` at 1:5905, the property does not apply for the print media.
DEBUG: Ignored `cursor:default` at 1:6829, the property does not apply for the print media.
DEBUG: Ignored `cursor:pointer` at 1:6968, the property does not apply for the print media.
DEBUG: Ignored `cursor:pointer` at 1:7106, the property does not apply for the print media.
DEBUG: Ignored `cursor:not-allowed` at 1:7594, the property does not apply for the print media.
INFO: Step 2 - Fetching and parsing CSS - CSS string
DEBUG: Ignored `transition:all .3s ease` at 1:268, the property does not apply for the print media.
WARNING: Ignored `box-shadow:none` at 1:420, unknown property.
INFO: Step 2 - Fetching and parsing CSS - CSS string
DEBUG: Ignored `transition:border-color .2s ease,background-color .2s ease,background-image .2s ease,box-shadow .4s ease` at 1:298, the property does not apply for the print media.
WARNING: Ignored `box-shadow:0 0 0 3px rgba(35,106,151,.25)` at 1:524, unknown property.
DEBUG: Ignored `cursor:not-allowed` at 1:1675, the property does not apply for the print media.
DEBUG: Ignored `cursor:not-allowed` at 1:1955, the property does not apply for the print media.
INFO: Step 2 - Fetching and parsing CSS - CSS string
WARNING: Ignored `border-color:darken(#cae3f2)` at 1:404, invalid value.
INFO: Step 2 - Fetching and parsing CSS - CSS string
WARNING: Ignored `text-shadow:0 0 1px rgba(0,0,0,.35)` at 1:182, unknown property.
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 2 - Fetching and parsing CSS - CSS string
DEBUG: Ignored `animation:fadeIn .5s forwards` at 1:11, the property does not apply for the print media.
DEBUG: Ignored `transition:background-color .3s ease` at 1:1552, the property does not apply for the print media.
DEBUG: Ignored `transition:border-color .3s ease` at 1:3022, the property does not apply for the print media.
WARNING: Expected a media type, got '(max-width:1200px)'
WARNING: Invalid media type ' (max-width:1200px)' the whole @media rule was ignored at 1:3332.
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 2 - Fetching and parsing CSS - CSS string
WARNING: Ignored `fill:none` at 1:15, unknown property.
WARNING: Ignored `stroke:#666` at 1:25, unknown property.
WARNING: Ignored `stroke-width:1px` at 1:37, unknown property.
WARNING: Ignored `shape-rendering:crispEdges` at 1:54, unknown property.
WARNING: Ignored `fill:none` at 1:109, unknown property.
WARNING: Ignored `stroke:none` at 1:119, unknown property.
WARNING: Ignored `pointer-events:all` at 1:131, unknown property.
DEBUG: Ignored `-webkit-clip-path:url(#chart-clip)` at 1:243, prefixed selectors are ignored.
WARNING: Ignored `clip-path:url(#chart-clip)` at 1:278, unknown property.
WARNING: Ignored `fill:#4b9fd5` at 1:321, unknown property.
WARNING: Ignored `fill:#236a97` at 1:367, unknown property.
WARNING: Ignored `fill:#24c6e0` at 1:413, unknown property.
WARNING: Ignored `fill:#fff` at 1:444, unknown property.
WARNING: Ignored `stroke:#4b9fd5` at 1:454, unknown property.
WARNING: Ignored `stroke-width:2px` at 1:469, unknown property.
WARNING: Ignored `stroke:#4b9fd5` at 1:512, unknown property.
WARNING: Ignored `stroke:#0a0` at 1:558, unknown property.
WARNING: Ignored `stroke:#ed7d20` at 1:604, unknown property.
WARNING: Ignored `stroke:#9139d4` at 1:643, unknown property.
WARNING: Ignored `fill:#666` at 1:675, unknown property.
INFO: Step 2 - Fetching and parsing CSS - CSS string
WARNING: Ignored `fill:none` at 1:18, unknown property.
WARNING: Ignored `stroke:#4b9fd5` at 1:28, unknown property.
WARNING: Ignored `stroke-width:2px` at 1:43, unknown property.
WARNING: Ignored `stroke:#236a97` at 1:95, unknown property.
WARNING: Ignored `stroke:#24c6e0` at 1:145, unknown property.
WARNING: Ignored `fill:rgba(75,159,213,.3)` at 1:177, unknown property.
WARNING: Ignored `stroke-width:0` at 1:202, unknown property.
WARNING: Ignored `fill:rgba(35,106,151,.3)` at 1:252, unknown property.
WARNING: Ignored `fill:rgba(36,198,224,.3)` at 1:312, unknown property.
WARNING: Ignored `fill:#fff` at 1:355, unknown property.
WARNING: Ignored `stroke:#4b9fd5` at 1:365, unknown property.
WARNING: Ignored `stroke-width:2px` at 1:380, unknown property.
WARNING: Ignored `fill:#666` at 1:414, unknown property.
WARNING: Ignored `text-anchor:end` at 1:458, unknown property.
WARNING: Ignored `text-anchor:start` at 1:499, unknown property.
WARNING: Ignored `shape-rendering:crispedges` at 1:534, unknown property.
WARNING: Ignored `stroke:#eee` at 1:561, unknown property.
INFO: Step 2 - Fetching and parsing CSS - CSS string
WARNING: Ignored `text-shadow:0 0 1px rgba(0,0,0,.35)` at 1:171, unknown property.
WARNING: Ignored `text-shadow:0 0 1px rgba(0,0,0,.35)` at 1:277, unknown property.
DEBUG: Ignored `transition:all .2s ease` at 1:376, the property does not apply for the print media.
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 3 - Applying CSS
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill: currentcolor` at 1:1, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill: rgb(75, 159, 213)` at 1:1, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill: rgb(75, 159, 213)` at 1:1, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill: rgb(75, 159, 213)` at 1:1, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill: rgb(219, 120, 26)` at 1:1, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill: currentcolor` at 1:1, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill: currentcolor` at 1:1, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill: currentcolor` at 1:1, unknown property.
WARNING: Ignored `fill: currentcolor` at 1:1, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill: currentcolor` at 1:1, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill: currentcolor` at 1:1, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill: rgb(0, 170, 0)` at 1:1, unknown property.
WARNING: Ignored `fill: rgb(164, 3, 15)` at 1:1, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill: currentcolor` at 1:1, unknown property.
WARNING: Ignored `fill: rgb(0, 170, 0)` at 1:1, unknown property.
WARNING: Ignored `fill: rgb(164, 3, 15)` at 1:1, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill: currentcolor` at 1:1, unknown property.
WARNING: Ignored `fill-rule: evenodd` at 1:1, unknown property.
WARNING: Ignored `clip-rule: evenodd` at 1:21, unknown property.
WARNING: Ignored `stroke-linejoin: round` at 1:41, unknown property.
WARNING: Ignored `stroke-miterlimit: 1.41421` at 1:65, unknown property.
WARNING: Ignored `fill: rgb(219, 120, 26)` at 1:1, unknown property.
INFO: Step 4 - Creating formatting structure
ERROR: Failed to load image at 'file:///images/activity-chart.svg': URLError: <urlopen error [Errno 2] No such file or directory: '/images/activity-chart.svg'>
INFO: Step 5 - Creating layout - Page 1
INFO: Step 5 - Creating layout - Page 2
INFO: Step 5 - Creating layout - Page 3
INFO: Step 5 - Creating layout - Page 4
INFO: Step 6 - Creating PDF
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
Traceback (most recent call last):
  File "/usr/bin/weasyprint", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/weasyprint/__main__.py", line 218, in main
    html.write_pdf(output, **kwargs)
  File "/usr/lib/python3.10/site-packages/weasyprint/__init__.py", line 201, in write_pdf
    .write_pdf(
  File "/usr/lib/python3.10/site-packages/weasyprint/document.py", line 347, in write_pdf
    pdf = generate_pdf(
  File "/usr/lib/python3.10/site-packages/weasyprint/pdf/__init__.py", line 336, in generate_pdf
    page.paint(stream, scale=scale)
  File "/usr/lib/python3.10/site-packages/weasyprint/document.py", line 96, in paint
    draw_page(self._page_box, stream)
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 68, in draw_page
    draw_stacking_context(stream, stacking_context)
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 176, in draw_stacking_context
    draw_stacking_context(stream, child_context)
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 180, in draw_stacking_context
    draw_stacking_context(stream, child_context)
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 176, in draw_stacking_context
    draw_stacking_context(stream, child_context)
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 169, in draw_stacking_context
    draw_inline_level(
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 983, in draw_inline_level
    draw_inline_level(
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 989, in draw_inline_level
    draw_replacedbox(stream, box)
  File "/usr/lib/python3.10/site-packages/weasyprint/draw.py", line 945, in draw_replacedbox
    box.replacement.draw(
  File "/usr/lib/python3.10/site-packages/weasyprint/images.py", line 89, in draw
    self._svg.draw(
  File "/usr/lib/python3.10/site-packages/weasyprint/svg/__init__.py", line 365, in draw
    self.draw_node(self.tree, size('12pt'))
  File "/usr/lib/python3.10/site-packages/weasyprint/svg/__init__.py", line 430, in draw_node
    self.draw_node(child, font_size, fill_stroke)
  File "/usr/lib/python3.10/site-packages/weasyprint/svg/__init__.py", line 439, in draw_node
    self.fill_stroke(node, font_size)
  File "/usr/lib/python3.10/site-packages/weasyprint/svg/__init__.py", line 612, in fill_stroke
    red, green, blue, alpha = color(fill_color)
ValueError: too many values to unpack (expected 4)

I noticed that the same error in different functions was found in #1287 and #1165 . Not expecting a fix for this as @liZe in #1287 states that it's not easy and would require a large amount of code to be re-written. I'm putting this here more for visibility (and fingers crossed someone can fix it).

@liZe
Copy link
Member

liZe commented Mar 3, 2023

Hi!

This problem is different from the other ones. Could you please launch this script with a debugger and tell what’s the value of fill_color? (Adding a dirty print(fill_color) in /usr/lib/python3.10/site-packages/weasyprint/svg/__init__.py before line 612 is another possible solution if you don’t like debuggers 😁.)

@liZe liZe added the crash Problems preventing documents from being rendered label Mar 3, 2023
@liZe
Copy link
Member

liZe commented Nov 25, 2023

Probable duplicate of #1740.

@liZe liZe closed this as completed Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Problems preventing documents from being rendered
Projects
None yet
Development

No branches or pull requests

2 participants