Project

General

Profile

Actions

Bug #7935

open

TypeError: '<=' not supported between instances of 'NoneType' and 'int'

Added by Alex Page over 4 years ago. Updated over 3 years ago.

Status:
Feedback
Priority:
Low
Assignee:
Category:
-
Target version:
-
Start date:
06/01/2020
Due date:
% Done:

0%

Estimated time:
0:30 h
Chirp Version:
daily
Model affected:
(All models)
Platform:
All
Debug Log:
I read the instructions above:

Description

When get_current_editorset() returns None, do_export() throws an exception comparing it to 0.


Files

reporting.patch (757 Bytes) reporting.patch Alex Page, 06/01/2020 02:10 PM
Actions #1

Updated by Alex Page over 4 years ago

Fix attached.

Actions #2

Updated by Bernhard Hailer about 4 years ago

  • Status changed from New to Feedback

Alex, did you submit this patch? If you haven't, please review the Wiki: Developers. Thanks!

Actions #3

Updated by Martin Cooper over 3 years ago

Your patch does not address the problem you describe. If get_current_editorset() returns None, then the code will die much earlier, on the line immediately after the call to that function, which attempts to dereference eset to get filename.

Your patch instead addresses the situation in which eset.do_export() returns None, and thus where 'count > 0' would effectively be 'None > 0'. Since do_export() will return None if it encounters an error, this is certainly valid. Interestingly, in early versions of Python (e.g. 2.6, 2.7) this comparison does not raise an exception, though in later versions it does.

The fix could also be effected by replacing 'count > 0' with 'count is not None and count > 0'.

Addendum: Looking a little more deeply, it seems that do_export() never returns a value. As such, this call to report_model_usage() will always be told that export failed. Very odd.

Actions

Also available in: Atom PDF