Package: pdfminer-data
Version: 20221105+dfsg-1
Severity: normal
Tags: patch

Dear Maintainer,

Some data files in the package are corrupted.

$ for f in /usr/share/pdfminer/*.gz; do gunzip -t "$f"; done

gzip: /usr/share/pdfminer/to-unicode-Adobe-CNS1.pickle.gz: unexpected end of 
file

gzip: /usr/share/pdfminer/to-unicode-Adobe-GB1.pickle.gz: unexpected end of file

gzip: /usr/share/pdfminer/to-unicode-Adobe-Japan1.pickle.gz: unexpected end of 
file

gzip: /usr/share/pdfminer/to-unicode-Adobe-Korea1.pickle.gz: unexpected end of 
file

This is caused by not closing the gzip files in conv_cmap.py. After applying
0002-Avoid-timestamps-in-gzip-compressed-file-and-use-com.patch, the following
patch fixes the bug.

--- tools/conv_cmap.py.orig     2024-09-28 03:36:58.077510467 +0900
+++ tools/conv_cmap.py  2024-09-28 03:37:33.928126725 +0900
@@ -202,6 +202,7 @@
         # 2.7
         fgz = gzip.GzipFile('', 'wb', 9, fp, 0.)
         converter.dump_unicodemap(fgz)
+        fgz.close()
     return
 
 

Reply via email to