Bug#995952: undertime: Getting TypeError with any timezone

2021-10-09 Thread Antoine Beaupré
Control: severity -1 normal

On 2021-10-08 15:24:56, Gabriel Filion wrote:
> Package: undertime
> Version: 2.6.0
> Severity: grave
> Justification: renders package unusable
>
> Hello,
>
> I'm currently getting stack traces consistently when using undertime. No 
> matter
> the timezone that I request, I get a stack trace with a TypeError exception:
>
> $ undertime pt
> Traceback (most recent call last):
>   File "/usr/bin/undertime", line 994, in 
> main(args)
>   File "/usr/bin/undertime", line 733, in main
> timezones += filter(None, [guess_zone(z) for z in args.timezones])
> TypeError: 'NoneType' object is not iterable
>
> $ undertime PST
> WARNING: date provided cannot be parsed: PST
> Traceback (most recent call last):
>   File "/usr/bin/undertime", line 994, in 
> main(args)
>   File "/usr/bin/undertime", line 733, in main
> timezones += filter(None, [guess_zone(z) for z in args.timezones])
> TypeError: 'NoneType' object is not iterable
>
> If I run that last command with pdb,
>
> e.g. python3 -m pdb /usb/bin/undertime PST
>
> and then (r)un the program until the error, I can see that args.timezones is
> set to None:
>
> (Pdb) type(args.timezones)
> 
>
>
> now from there, I tried using "undertime -t PST" and that actually worked. So
> there must be something off with the default value to -t

I should have documented this possibly more clearly in the NEWS.Debian
file, or maybe make a 3.x release, but I changed the semantics of the
commandline arguments quite significantly. The arguments are now a time,
and you need to provide a -t (or add it to your config file) for
undertime to work.

I'll take this bug report as a request to improve the error message
and/or data structure. Really, args.timezones should be an empty list
instead of None here, I think.

A.

-- 
L'homme construit des maisons parce qu'il est vivant, mais il écrit des
livres parce qu'il se sait mortel.
- Daniel Pennac, Comme un roman



Processed: Re: Bug#995952: undertime: Getting TypeError with any timezone

2021-10-09 Thread Debian Bug Tracking System
Processing control commands:

> severity -1 normal
Bug #995952 [undertime] undertime: Getting TypeError with any timezone
Severity set to 'normal' from 'grave'

-- 
995952: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=995952
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#995952: undertime: Getting TypeError with any timezone

2021-10-08 Thread Gabriel Filion
Package: undertime
Version: 2.6.0
Severity: grave
Justification: renders package unusable

Hello,

I'm currently getting stack traces consistently when using undertime. No matter
the timezone that I request, I get a stack trace with a TypeError exception:

$ undertime pt
Traceback (most recent call last):
  File "/usr/bin/undertime", line 994, in 
main(args)
  File "/usr/bin/undertime", line 733, in main
timezones += filter(None, [guess_zone(z) for z in args.timezones])
TypeError: 'NoneType' object is not iterable

$ undertime PST
WARNING: date provided cannot be parsed: PST
Traceback (most recent call last):
  File "/usr/bin/undertime", line 994, in 
main(args)
  File "/usr/bin/undertime", line 733, in main
timezones += filter(None, [guess_zone(z) for z in args.timezones])
TypeError: 'NoneType' object is not iterable

If I run that last command with pdb,

e.g. python3 -m pdb /usb/bin/undertime PST

and then (r)un the program until the error, I can see that args.timezones is
set to None:

(Pdb) type(args.timezones)



now from there, I tried using "undertime -t PST" and that actually worked. So
there must be something off with the default value to -t


-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.14.0-1-amd64 (SMP w/4 CPU threads)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages undertime depends on:
ii  python3 3.9.2-3
ii  python3-dateparser  1.0.0-1
ii  python3-ephem   4.1-1
ii  python3-tabulate0.8.7-0.1
ii  python3-termcolor   1.1.0-3
ii  python3-tz  2021.3-1
ii  python3-yaml5.3.1-5

undertime recommends no packages.

undertime suggests no packages.

-- no debconf information