You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello there, I'm having the following error... any idea? thanks!
Traceback (most recent call last):
File "igc2csv.py", line 253, in
flight = parse_igc(flight)
File "igc2csv.py", line 16, in parse_igc
recordtypes[linetype](line, flight)
File "igc2csv.py", line 101, in logline_H
headertypes[line[1:5]](line[5:], flight)
File "igc2csv.py", line 110, in logline_H_FDTE
flight['flightdate'] = datetime.date(int(line[4:6])+2000, int(line[2:4]), int(line[0:2]))
ValueError: invalid literal for int() with base 10: ':0'
Hi! I had the same problem... this is what happened the first time I run it:
$ python2 IGC2CSV.py /tmp/230325175253.igc
Number of arguments: 2
Argument List: ['IGC2CSV.py', '/tmp/230325175253.igc']
Single IGC file supplied: /tmp/230325175253.igc
1 flights ready to process...
Traceback (most recent call last):
File "IGC2CSV.py", line 254, in <module>
flight = parse_igc(flight)
File "IGC2CSV.py", line 16, in parse_igc
recordtypes[linetype](line, flight)
File "IGC2CSV.py", line 101, in logline_H
headertypes[line[1:5]](line[5:], flight)
File "IGC2CSV.py", line 110, in logline_H_FDTE
flight['flightdate'] = datetime.date(int(line[4:6])+2000, int(line[2:4]), int(line[0:2]))
ValueError: invalid literal for int() with base 10: ':2'
Then I change line 110 as @ScottStanton suggested and this is the error I got now:
$ python2 IGC2CSV.py /tmp/230325175253.igc
File "IGC2CSV.py", line 111
flight['flightdate'] = datetime.date(int(line[9:11])+2000, int(line[7:9]), int(line[5:7]))
^
IndentationError: expected an indented block
Activity
ScottStanton commentedon Jan 1, 2022
Change line 110 to:
flight['flightdate'] = datetime.date(int(line[9:11])+2000, int(line[7:9]), int(line[5:7]))
ScottStanton commentedon Jan 1, 2022
I fixed it in my fork of the code. Feel free to commit my changes.
https://github.com/ScottStanton/IGC2CSV
syunusic commentedon Mar 27, 2023
Hi! I had the same problem... this is what happened the first time I run it:
Then I change line 110 as @ScottStanton suggested and this is the error I got now:
Please help!
ScottStanton commentedon Mar 27, 2023
Can you post lines 107 to 114 from your code?
syunusic commentedon Mar 27, 2023
Sure:
ScottStanton commentedon Mar 27, 2023
Indent the line that start with 'flight' to match the indentation of the 'print' below it.
Python is very particular about indentation.
syunusic commentedon Mar 27, 2023
Wow... that was it. Thanks!