Bug 36456 - ucslint: AttributeError: 'NoneType' object has no attribute 'startswith'
ucslint: AttributeError: 'NoneType' object has no attribute 'startswith'
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: ucslint
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.1-0-errata
Assigned To: Philipp Hahn
Florian Best
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-05 16:16 CET by Florian Best
Modified: 2015-12-16 13:46 CET (History)
4 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
hahn: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2014-11-05 16:16:15 CET
ucs-school-ucc-integration $ ucslint

Traceback (most recent call last):
  File "/usr/bin/ucslint", line 303, in <module>
    incident_cnt, exitcode_cnt = chk.printResult( options.ignore_IDs, options.display_only_IDs, options.display_only_categories, options.exitcode_categories )
  File "/usr/bin/ucslint", line 186, in printResult
    if self.inOverrides( msg.getId(), msg.filename, msg.line ):
  File "/usr/bin/ucslint", line 169, in inOverrides
    if fnmatch.fnmatch(os.path.abspath(filename), os.path.abspath(pattern)):
  File "/usr/lib/python2.7/posixpath.py", line 367, in abspath
    if not isabs(path):
  File "/usr/lib/python2.7/posixpath.py", line 61, in isabs
    return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
Comment 1 Philipp Hahn univentionstaff 2015-12-09 13:36:55 CET
Traceback (most recent call last):
  File "/usr/bin/ucslint", line 289, in <module>
    incident_cnt, exitcode_cnt = chk.printResult( options.ignore_IDs, options.display_only_IDs, options.display_only_categories, options.exitcode_categories )
  File "/usr/bin/ucslint", line 172, in printResult
    if self.inOverrides( msg.getId(), msg.filename, msg.line ):
  File "/usr/bin/ucslint", line 156, in inOverrides
    if fnmatch.fnmatch(filename, pattern):
  File "/usr/lib/python2.6/fnmatch.py", line 43, in fnmatch
    return fnmatchcase(name, pat)
  File "/usr/lib/python2.6/fnmatch.py", line 79, in fnmatchcase
    return _cache[pat].match(name) is not None

Similar case which happens, when the file given in debian/ucslint.overrides does not exist: abspath() then returns None.
This is problematic for 0004-24 and 0004-18, as they do not set msg.filename (e.g. None)

By now 0004-36 and 0004-57 are the only 2 tests not adding .filename in UCS-4.1.


r66199 | Bug #36456 repo: Work-around broken ucslint
r66211 | Bug #36456 ucslint: Update copyright
r66210 | Bug #36456 ucslint: Fix override handling

Package: ucslint
Version: 5.0.1-2.70.201512091330
Branch: ucs_4.1-0
Scope: errata4.1-0

r66212 | Bug #36456 ucslint: YAML
 ucslint.yaml
Comment 2 Philipp Hahn univentionstaff 2015-12-09 14:46:20 CET
r66219 | Bug #36456 ucslint: Fix override handling
 Revert copyright update to testframework/
 Detect Python crashes

Package: ucslint
Version: 5.0.1-3.71.201512091443
Branch: ucs_4.1-0
Scope: errata4.1-0

r66220 | Bug #36456 ucslint: YAML
 ucslint.yaml
Comment 3 Florian Best univentionstaff 2015-12-15 14:57:12 CET
OK: ucslint doesn't crash
OK: copyright revert
OK: YAML (didn't knew that ucslint is maintained).

I did not test repo-ng in 3.2 but I trust you there.
Comment 4 Janek Walkenhorst univentionstaff 2015-12-16 13:46:07 CET
<http://errata.software-univention.de/ucs/4.1/34.html>