dbrgn / fahrplan

A SBB/CFF/FFS commandline based timetable client. Project started at make.opendata.ch.
GNU General Public License v3.0
132 stars 20 forks source link

AttributeError: 'NoneType' object has no attribute 'ljust' #23

Closed Neo-Oli closed 7 years ago

Neo-Oli commented 7 years ago

We had this running on our Monitoring screen for a long time now and it always worked so far but it stopped working a few weeks ago. Maybe there was some API change?

$ fahrplan from Burgdorf, Parkhaus Oberstadt to Burgdorf
#  | Station                      | Platform | Date          | Time  | Duration | Chg. | Travel with | Occupancy |
-------------------------------------------------------------------------------------------------------------------
1  | Burgdorf, Parkhaus Oberstadt | Traceback (most recent call last):
  File "/usr/local/bin/fahrplan", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/fahrplan/main.py", line 201, in main
    tableprinter.print_line(cols_from)
  File "/usr/local/lib/python2.7/dist-packages/fahrplan/tableprinter.py", line 39, in print_line
    out = item.ljust(width) + self.separator
AttributeError: 'NoneType' object has no attribute 'ljust'
dbrgn commented 7 years ago

This bug happens if a connection has no platform. Should be fixed in current master.

@Neo-Oli could you maybe test it with the following command?

pip install -U -e git+https://github.com/dbrgn/fahrplan#egg=fahrplan-dev
Neo-Oli commented 7 years ago

Cool. Works again. Thanks for fixing it so fast.

dbrgn commented 7 years ago

Great. I'll probably do a PyPI release by the end of the week :)