hefronmedia / pdfsizeopt

Automatically exported from code.google.com/p/pdfsizeopt
0 stars 0 forks source link

Doesn't work with python 2.7.1 (Fedora 15) #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

Using your test file 5176.CFF.pdf:

[user@localhost pdfsizeopt]$ python pdfsizeopt.py --use-pngout=true 
--use-jbig2=true --use-multivalent=true 5176.CFF.pdf 
info: This is pdfsizeopt.py rUNKNOWN size=278997.
info: loading PDF from: 5176.CFF.pdf
info: loaded PDF of 521909 bytes
info: separated to 567 objs + xref + trailer
Traceback (most recent call last):
  File "pdfsizeopt.py", line 6963, in <module>
    main(sys.argv)
  File "pdfsizeopt.py", line 6936, in main
    ).Load(file_name)
  File "pdfsizeopt.py", line 3239, in Load
    do_ignore_generation_numbers=self.do_ignore_generation_numbers)
  File "pdfsizeopt.py", line 396, in __init__
    i = self.FindEndOfObj(other, skip_obj_number_idx, len(other))
  File "pdfsizeopt.py", line 839, in FindEndOfObj
    data=data, start=match.start(1), end_ofs_out=end_ofs_out)
  File "pdfsizeopt.py", line 2093, in RewriteToParsable
    ' <%s>' % eval(''.join(string_output), {}).encode('hex'))
  File "<string>", line 1
    '/space/C/o/p/y/r/i/g/h/t/one/nine/six/endash/eight/comma/two/zero/three/b/A/d/e/S/s/m/I/n/c/a/period/l/v/N/f/u/hyphen/w/P/k/x/T/quoteright/quotedblleft/quotedblright/parenleft/parenright/j/M/Q/D/W/L/H/G/slash/U/F/q/numbersign/five/seven/colon/registered/E
                                                                                                                                                                                                                                                                   ^
SyntaxError: EOL while scanning string literal

Original issue reported on code.google.com by mstar...@wcs.org on 30 Jun 2011 at 12:14

GoogleCodeExporter commented 9 years ago
Thank you for reporting this problem in detail. Fixed it in r166.

Please note that this issue was specific to Python 2.7. In Python 2.6 it worked 
even before the fix.

Original comment by pts...@gmail.com on 30 Jun 2011 at 11:49

GoogleCodeExporter commented 9 years ago

Original comment by pts...@gmail.com on 30 Jun 2011 at 11:50