Skip to content

TypeError: can only concatenate str (not "int") to str #6

Open
@Derek-Jones

Description

@Derek-Jones

The file:
https://www.jstage.jst.go.jp/article/journalofjsce/11/1/11_23-00137/_pdf

generated the following error:

/home/web/extract-data> pdfsyntax browse ../11_23-00137.pdf > 11_23.html
Traceback (most recent call last):
  File "/home/derek/.local/bin/pdfsyntax", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/derek/.local/lib/python3.12/site-packages/pdfsyntax/cli.py", line 79, in main
    browse(args.input_f)
  File "/home/derek/.local/lib/python3.12/site-packages/pdfsyntax/cli.py", line 419, in browse
    sections, index = file_map(fdata)
                      ^^^^^^^^^^^^^^^
  File "/home/derek/.local/lib/python3.12/site-packages/pdfsyntax/cli.py", line 406, in file_map
    sections = file_object_map(fdata)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/derek/.local/lib/python3.12/site-packages/pdfsyntax/filestruct.py", line 149, in file_object_map
    _, _, typ, obj = parse_object_stream(content['obj'], content['o_num'])
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/derek/.local/lib/python3.12/site-packages/pdfsyntax/objects.py", line 321, in parse_object_stream
    y_pos = [y+offset for j, y in enumerate(y_array) if j % 2]
             ~^~~~~~~
TypeError: can only concatenate str (not "int") to str

Installation

Defaulting to user installation because normal site-packages is not writeable
WARNING: Skipping /usr/lib/python3.12/dist-packages/charset_normalizer-3.3.2.dist-info due to invalid metadata entry 'name'
Collecting pdfsyntax
  Downloading pdfsyntax-0.1.5-py3-none-any.whl.metadata (4.8 kB)
Downloading pdfsyntax-0.1.5-py3-none-any.whl (44 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 44.3/44.3 kB 296.9 kB/s eta 0:00:00
WARNING: Skipping /usr/lib/python3.12/dist-packages/charset_normalizer-3.3.2.dist-info due to invalid metadata entry 'name'
Installing collected packages: pdfsyntax
Successfully installed pdfsyntax-0.1.5

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions