-
Notifications
You must be signed in to change notification settings - Fork 653
Open
@DeltaFlyerW
Description
Description of the bug
doc.subset_fonts(verbose=True, fallback=True)
raise
Traceback (most recent call last):
doc.subset_fonts(verbose=True, fallback=True) # build subset fonts to reduce file size
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "venv\Lib\site-packages\pymupdf\__init__.py", line 7710, in subset_fonts
new_buffer = build_subset(old_buffer, subsets[0], subsets[1])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "venv\Lib\site-packages\pymupdf\__init__.py", line 7562, in build_subset
with open(f"{tmp_dir}/uncfile.txt", "w", encoding='utf8') as unc_file:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Document.__init__() got an unexpected keyword argument 'encoding'
How to reproduce the bug
This issue seems to be caused by the open attr is override in pymupdf.init.py
PyMuPDF version
1.26.6
Operating system
Windows
Python version
3.11