/usr/share/lintian/checks/python/code-analysis.desc is in lintian4python 0.28.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | Check-Script: python/code-analysis
Author: Jakub Wilk <jwilk@debian.org>
Type: binary
Info: analysis of Python code
Needs-Info: index, bin-pkg-control, scripts, unpacked
Tag: assertion-always-true
Severity: minor
Certainty: certain
Ref: http://docs.python.org/reference/simple_stmts.html#grammar-token-assert_stmt
Tag: embedded-code-copy
Severity: important
Certainty: possible
Ref: policy 4.13
Tag: except-shadows-builtin
Severity: important
Certainty: possible
Ref: http://docs.python.org/whatsnew/2.6.html#pep-3110-exception-handling-changes
Info: One error that Python programmers occasionally make is writing the
following code:
.
try:
...
except TypeError, ValueError: # Wrong!
...
.
The author is probably trying to catch both <tt>TypeError</tt> and
<tt>ValueError</tt> exceptions, but this code actually does something
different: it will catch <tt>TypeError</tt> and bind the resulting exception
object to the local name <tt>ValueError<tt>. The <tt>ValueError</tt>
exception will not be caught at all. The correct code specifies a tuple of
exceptions:
.
try:
...
except (TypeError, ValueError):
...
Tag: except-without-exception-type
Severity: minor
Certainty: possible
Experimental: yes
Ref: http://docs.python.org/2/howto/doanddont.html#except
Tag: hardcoded-errno-value
Severity: normal
Certainty: possible
Ref: http://lists.debian.org/20100803162901.GA5419@jwilk.net
Tag: inconsistent-use-of-tabs-and-spaces-in-indentation
Severity: normal
Certainty: certain
Ref: http://docs.python.org/reference/lexical_analysis.html#indentation
Info: The source file mixes tabs and spaces for indentation in a way that makes
it depend on the worth of a tab expressed in spaces.
.
You can check consistency of indentation with the following command:
python -m tabnanny <i>path-to-source-file</i>
Tag: missing-dependency-on-ply-virtual-package
Severity: important
Certainty: possible
Ref: dh_python-ply(1)
Tag: mkstemp-file-descriptor-leak
Severity: normal
Certainty: possible
Ref: http://docs.python.org/2/library/tempfile.html#tempfile.mkstemp
Tag: obsolete-pil-import
Severity: important
Certainty: possible
Ref: http://mail.python.org/pipermail/image-sig/2011-January/006650.html,
http://lists.debian.org/5117D0B7.801@debian.org
Info: Python Imaging Library 1.2 and Pillow (a PIL fork) no longer support this
style of imports:
.
import Image
.
Imports from the PIL namespace should be used instead:
.
from PIL import Image
Tag: regexp-duplicate-range
Severity: minor
Certainty: possible
Tag: regexp-overlapping-ranges
Severity: important
Certainty: possible
Tag: regexp-syntax-error
Severity: important
Certainty: certain
Tag: string-exception
Severity: important
Certainty: possible
Ref: http://docs.python.org/whatsnew/2.6.html#deprecations-and-removals
Info: String exceptions have been removed in Python 2.6. Attempting to use
them raises a TypeError.
Tag: string-formatting-error
Severity: important
Certainty: certain
Tag: syntax-error
Severity: serious
Certainty: certain
Tag: syntax-warning
Severity: important
Certainty: possible
|