Open Makaze opened 3 months ago
The documentation regarding the hex support was added last month. The fpdf2 version installed by check50 is out of date. If I manually install the same version as check50, fpdf2==2.7.6
, I get this error:
Traceback (most recent call last):
File "/home/makaze/Documents/Harvard/CS50P/shirtificate/shirtificate.py", line 37, in <module>
pdf.output("shirtificate.pdf")
File "/home/makaze/.local/lib/python3.10/site-packages/fpdf/fpdf.py", line 4916, in output
self.footer()
File "/home/makaze/Documents/Harvard/CS50P/shirtificate/shirtificate.py", line 27, in footer
self.set_text_color("#FFF")
File "/home/makaze/.local/lib/python3.10/site-packages/fpdf/fpdf.py", line 1037, in set_text_color
self.text_color = _convert_to_drawing_color(r, g, b)
File "/home/makaze/.local/lib/python3.10/site-packages/fpdf/fpdf.py", line 4943, in _convert_to_drawing_color
r, g, b = r
ValueError: too many values to unpack (expected 3)
Solution: Update fpdf2
on the check50 server.
If a student submits a working code that uses hex color codes, e.g.
check50 will fail it, claiming the output file was not created. The source of this error is not easily traced. It seems to be internal to check50 and cannot be pinned to the contents of the problem files here.