Package: sinntp
Version: 1.5-1.1
Severity: important

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

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 4.6.0-1-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages sinntp depends on:
pn  python:any  <none>

sinntp recommends no packages.

sinntp suggests no packages.

-- no debconf information

Reply via email to