ihabunek / pdf417-py

PDF417 barcode generator for Python
Other
84 stars 28 forks source link

TypeError: object of type 'Namespace' has no len() #10

Closed edvasqueza closed 6 years ago

edvasqueza commented 7 years ago

Hello, I just installed this package (version 0.6 according to pip) but every time I try to use it I'm getting TypeError: object of type 'Namespace' has no len().

Example:

pdf417gen encode "Beautiful is better than ugly"
Traceback (most recent call last):
  File "/home/edu/.local/bin/pdf417gen", line 11, in <module>
    sys.exit(main())
  File "/home/edu/.local/lib/python2.7/site-packages/pdf417gen/console.py", line 108, in main
    do_encode(args)
  File "/home/edu/.local/lib/python2.7/site-packages/pdf417gen/console.py", line 71, in do_encode
    elif len(args) > 1:
TypeError: object of type 'Namespace' has no len()

I'm running Python 2.7.13 in ubuntu 17.04

qbitsolutions commented 6 years ago

Hi @edvasqueza, I used this answer to resolve the issue.

https://stackoverflow.com/a/18361495

I edited console.py, changed len(args) to len( vars(args) ). There are other answers in the question as well that you might be interested in.