Dear Maintainer,
I have a small bash script that runs sinntp to download NNTP news in batch.
It failed to download several of my newsgroups with the following errors
Traceback (most recent call last):
File "/usr/bin/sinntp", line 351, in <module>
command(connection)
File "/usr/bin/sinntp", line 192, in __call__
start = config[group] if not self.options.reget else 0
File "/usr/bin/sinntp", line 86, in __getitem__
return int(file.read())
ValueError: invalid literal for int() with base 10: ''
nntp-pull of comp.lang.prolog
Traceback (most recent call last):
File "/usr/bin/sinntp", line 351, in <module>
command(connection)
File "/usr/bin/sinntp", line 192, in __call__
start = config[group] if not self.options.reget else 0
File "/usr/bin/sinntp", line 86, in __getitem__
return int(file.read())
ValueError: invalid literal for int() with base 10: ''
nntp-pull of comp.lang.javascript
Traceback (most recent call last):
File "/usr/bin/sinntp", line 351, in <module>
command(connection)
File "/usr/bin/sinntp", line 192, in __call__
start = config[group] if not self.options.reget else 0
File "/usr/bin/sinntp", line 86, in __getitem__
return int(file.read())
ValueError: invalid literal for int() with base 10: ''
To get around this, I changed the line 86 to :-
return int("0" + file.read())
This is because on EOF, I think python returns '', which doesn't convert to an int.
Is there another way of getting around this. Seems to work correctly with this change in.
Regards,
David