-
Notifications
You must be signed in to change notification settings - Fork 384
/
python37.yaml
192 lines (192 loc) · 6.73 KB
/
python37.yaml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
rules:
- id: python37-compatibility-importlib
pattern: importlib.source_hash()
message:
source_hash' is only available on Python 3.7+. This does not work in lower versions, and therefore is not backwards
compatible. Instead, use another hash function.
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-importlib2
pattern: import importlib.resources
message:
Found 'importlib.resources', which is a module only available on Python 3.7+. This does not work in lower versions,
and therefore is not backwards compatible. Use importlib_resources instead for older Python versions.
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-httpconn
pattern: http.client.HTTPConnection(blocksize=$X,...)
message:
Found usage of the 'blocksize' argument in a HTTPConnection call. This is only available on Python 3.7+ and is
therefore not backwards compatible. Remove this in order for this code to work in Python 3.6 and below.
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-httpsconn
pattern: http.client.HTTPSConnection(blocksize=$X,...)
message:
Found usage of the 'blocksize' argument in a HTTPSConnection call. This is only available on Python 3.7+ and is
therefore not backwards compatible. Remove this in order for this code to work in Python 3.6 and below.
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-importlib3
pattern: import importlib.abc.ResourceReader
message:
Found usage of 'importlib.abc.ResourceReader'. This module is only available on Python 3.7+ and is therefore not
backwards compatible. Instead, use another loader.
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-textiowrapper
pattern: TextIOWrapper.reconfigure(...)
message:
Found usage of 'importlib.abc.ResourceReader'. This module is only available on Python 3.7+ and is therefore not
backwards compatible. Instead, use another loader.
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-ipv6network1
pattern: ipaddress.IPv6Network.subnet_of($X)
message:
IPv6Network.subnet_of is only available on Python 3.7+ and is therefore not backwards compatible. Instead, check
if the subnet is in 'subnets'.
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-ipv6network2
pattern: ipaddress.IPv6Network.supernet_of($X)
message:
IPv6Network.supernet_of is only available on Python 3.7+ and is therefore not backwards compatible. Instead, check
if the supernet is in 'supernet'.
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-ipv4network1
pattern: ipaddress.IPv4Network.subnet_of($X)
message:
IPv4Network.subnet_of is only available on Python 3.7+ and is therefore not backwards compatible. Instead, check
if the subnet is in 'subnets'.
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-ipv4network2
pattern: ipaddress.IPv4Network.supernet_of($X)
message:
IPv4Network.supernet_of is only available on Python 3.7+ and is therefore not backwards compatible. Instead, check
if the supernet is in 'supernet'.
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-locale1
pattern: locale.format_string(monetary=$X, ...)
message:
Found usage of the 'monetary' argument in a function call of 'locale.format_string'. This is only available on
Python 3.7+ and is therefore not backwards compatible. Instead, remove the 'monetary' argument.
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-math1
pattern: math.remainder($X, $Y)
message:
math.remainder is only available on Python 3.7+ and is therefore not backwards compatible. Instead, use math.fmod()
or calculate $X - n* $Y.
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-multiprocess1
pattern: multiprocessing.Process.close()
message:
multiprocessing.Process.close() is only available on Python 3.7+ and is therefore not backwards compatible. Instead,
use join().
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-multiprocess2
pattern: multiprocessing.Process.kill()
message:
multiprocessing.Process.kill() is only available on Python 3.7+ and is therefore not backwards compatible. Instead,
use terminate().
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-os1
pattern: os.preadv(...)
message:
os.preadv() is only available on Python 3.7+ and is therefore not backwards compatible. Instead, use a combination
of os.readv() and os.pread().
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-os2-ok2
patterns:
- pattern-not-inside: |
if hasattr(os, 'pwritev'):
...
- pattern: os.pwritev(...)
message:
os.pwritev() is only available on Python 3.3+ and is therefore not backwards compatible. Instead, use a combination
of pwrite() and writev().
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python
- id: python37-compatibility-pdb
pattern: pdb.set_trace(header=$X, ...)
message:
pdb.set_trace() with the header argument is only available on Python 3.7+ and is therefore not backwards compatible.
Instead, use set_trace() without the header argument.
languages: [python]
severity: ERROR
metadata:
category: compatibility
technology:
- python