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

Error on table border when using presentational-hints #2036

Closed
videda opened this issue Jan 9, 2024 · 1 comment
Closed

Error on table border when using presentational-hints #2036

videda opened this issue Jan 9, 2024 · 1 comment

Comments

@videda
Copy link

videda commented Jan 9, 2024

When using weasyprint with --presentational-hints on the html <table border="1" style="border-collapse: collapse;"> </table> a TypeError is produced: TypeError: set_color_rgb() missing 1 required positional argument: 'b'.

Note that I don't need the border attribute to work. I'm just reporting the crash.

> cat test.html
<!DOCTYPE html>
<html>
  <body >
    <table border="1" style="border-collapse: collapse;"><tr><td></td></tr></table>
  </body>
</html>
> weasyprint --presentational-hints test.html test.pdf
Traceback (most recent call last):
  File "/.../venv/bin/weasyprint", line 8, in <module>
    sys.exit(main())
  File "/.../venv/lib/python3.9/site-packages/weasyprint/__main__.py", line 216, in main
    html.write_pdf(output, **options)
  File "/.../venv/lib/python3.9/site-packages/weasyprint/__init__.py", line 252, in write_pdf
    self.render(font_config, counter_style, **options)
  File "/.../venv/lib/python3.9/site-packages/weasyprint/document.py", line 399, in write_pdf
    pdf = generate_pdf(self, target, zoom, **options)
  File "/.../venv/lib/python3.9/site-packages/weasyprint/pdf/__init__.py", line 192, in generate_pdf
    page.paint(stream, scale=scale)
  File "/.../venv/lib/python3.9/site-packages/weasyprint/document.py", line 103, in paint
    draw_page(self._page_box, stream)
  File "/.../venv/lib/python3.9/site-packages/weasyprint/draw.py", line 65, in draw_page
    draw_stacking_context(stream, stacking_context)
  File "/.../venv/lib/python3.9/site-packages/weasyprint/draw.py", line 174, in draw_stacking_context
    draw_stacking_context(stream, child_context)
  File "/.../venv/lib/python3.9/site-packages/weasyprint/draw.py", line 145, in draw_stacking_context
    draw_box_background_and_border(
  File "/.../venv/lib/python3.9/site-packages/weasyprint/draw.py", line 70, in draw_box_background_and_border
    draw_table(stream, box)
  File "/.../venv/lib/python3.9/site-packages/weasyprint/draw.py", line 819, in draw_table
    return draw_collapsed_borders(stream, table)
  File "/.../venv/lib/python3.9/site-packages/weasyprint/draw.py", line 954, in draw_collapsed_borders
    draw_line(
  File "/.../venv/lib/python3.9/site-packages/weasyprint/draw.py", line 734, in draw_line
    stream.set_color_rgb(*color[:3], stroke=True)
TypeError: set_color_rgb() missing 1 required positional argument: 'b'
> weasyprint --version
WeasyPrint version 60.2
> python --version
Python 3.9.18
@liZe
Copy link
Member

liZe commented Jan 9, 2024

Hi!

Thanks for the bug report! It’s actually a duplicate of #1996 that’s already fixed in the main branch (but not released yet).

@liZe liZe closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants