ScribusGenerator icon indicating copy to clipboard operation
ScribusGenerator copied to clipboard

Error running command-line in Mac OS X: TypeError: '>' not supported between instances of 'str' and 'int'

Open hhallez opened this issue 4 years ago • 6 comments

Hi,

I have a problem using the CLI of ScribusGenerator. I seem to be unable to run the scripts successfully. Are there any suggestions, what I can do to get it working? I don't get a logger file also, probably because the script does not get that far. I use a Scribus in MacOS X Catalina 10.15.3. I'm using Scribus 1.5.5. For python, I use the homebrew version.
Here is my output:

Traceback (most recent call last):
 File "ScribusGeneratorCLI.py", line 124, in <module>
   generator = ScribusGenerator(dataObject)
 File "/Users/hans/PERSONAL/Oedelem/ScribusGenerator/ScribusGeneratorBackend.py", line 73, in __init__
   logging.config.fileConfig(os.path.join(
 File "/usr/local/Cellar/[email protected]/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/logging/config.py", line 79, in fileConfig
   handlers = _install_handlers(cp, formatters)
 File "/usr/local/Cellar/[email protected]/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/logging/config.py", line 145, in _install_handlers
   h = klass(*args, **kwargs)
 File "/usr/local/Cellar/[email protected]/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/logging/handlers.py", line 146, in __init__
   if maxBytes > 0:
TypeError: '>' not supported between instances of 'str' and 'int'

hhallez avatar Mar 01 '20 08:03 hhallez

Thanks for the feedback.

Since the CLI version does not use Scribus at all the error could be somewhere with Python version. It's working for me with python 2.7.17. What version are you using ? find out by running python --version from the command line

berteh avatar Mar 21 '20 07:03 berteh

I see you seem to be running python 3.8.1. Maybe convert the script to Python 3 and give it a go ?

running 2to3 -w *.py could do, more info: https://docs.python.org/2/library/2to3.html

berteh avatar Mar 21 '20 07:03 berteh

I did use python2.7 in the end.

I tried to do 2to3 but it didn't change ScribusGeneraterCLI. I did change the other scripts.
Running python ScribusGeneratorCLI still gave the error. I'll try to have a look at it.

hhallez avatar Mar 21 '20 07:03 hhallez

ported to python3 in branch https://github.com/berteh/ScribusGenerator/tree/python3 kindly test and let me know how this works for you.

I just don't want to make this the master, as the python embedded in my stock Scribus 1.5.5 is still python 2.7.

berteh avatar Mar 21 '20 15:03 berteh

Hello @hhallez

The Python3 branch is now fairly used for quite a while. Could you please test again and let me know if I can close this issue report?

https://github.com/berteh/ScribusGenerator/archive/python3.zip

Since you got a Mac would you have a few hours to share on helping with #197 ?

Have a nice day.

berteh avatar Feb 26 '22 08:02 berteh

FYI: I was reproducing this error with the current master HEAD, under python 3.10.6 on Ubuntu 22.04. Checking out the python3 branch seems to fix it.

Thanks for the generator; I use it to generate custom monthly diaries for myself. It's a bit clunky to get everything together in the end, but I have old janky shell scripts to get the page order right for 2-up duplex printing and staple binding =)

jbm9 avatar Mar 16 '23 18:03 jbm9

python3 and MacOS are now included by default in master branch. plase update your script, test it out and don't hesitate to feedback !

berteh avatar Jun 08 '24 14:06 berteh