Modify ↓
Opened 21 months ago
#14206 new defect
Static analysis updates
Reported by: | figaro | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Component: | TracDbftsPlugin |
Severity: | normal | Keywords: | patch |
Cc: | Trac Release: |
Description
Autopep8 mostly adjusts indentation. Manual addition of some docstrings, a classifier and a modest increase to the version number.
Two issues which I want to highlight:
- Typo in source:tracdbftsplugin/trunk/tracdbfts/api.py
- Bandit speaks of insecure hash function use also in api.py, and perhaps you can suggest an alternative?
Line 602 def _build_hash(*values): 603 def to_b(value): 604 if isinstance(value, _inttypes): 605 return b'%d' % value 606 if isinstance(value, bytes): 607 return value 608 if isinstance(value, unicode): 609 return value.encode('utf-8') 610 raise ValueError('Unrecognized value %r' % type(value)) 611 d = hashlib.sha1() 612 d.update(b'\0'.join(to_b(value) for value in values)) 613 return base64.b64encode(d.digest()).rstrip(b'=')
Attachments (1)
Note: See
TracTickets for help on using
tickets.
Diff -u of tracdbftsplugin/trunk