Jelle Zijlstra and Shantanu
ec4ec33639
xml: improve bytes types ( #9110 )
...
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com >
2022-11-10 20:43:26 -08:00
Jelle Zijlstra
8b59dfd10b
termios: improve comments, add more constants ( #9101 )
2022-11-10 17:44:52 +00:00
Jelle Zijlstra
c7820b401d
socket: constructor accepts bytes on Windows ( #9095 )
...
https://github.com/python/cpython/blob/d04899abb0da4cc7c0a390f5bc52d57ace8955fd/Modules/socketmodule.c#L5318
This is used in `socket.fromshare`. It must be bytes, not some other buffer.
2022-11-10 15:10:44 +00:00
Jelle Zijlstra
afa2a8e3dd
mailbox: improve bytes handling ( #9083 )
...
- The _MessageData alias refers to objects handled in the
_dump_message method: https://github.com/python/cpython/blob/016c7d37b6acfe2203542a2655080c6402b3be1f/Lib/mailbox.py#L210
- The path passed to __init__ should be a str path because there are
many places in the file (search for self._path) where we join it
with a str, which won't work with a bytes path.
2022-11-08 21:50:51 +00:00
Jelle Zijlstra
68924e00e5
os: improve bytes handling ( #9072 )
2022-11-06 21:32:46 -08:00
Jelle Zijlstra
340eb1264b
unicodedata: accepts ReadOnlyBuffer ( #9106 )
2022-11-06 21:17:06 -08:00
Jelle Zijlstra
1d4eed1c9d
zipfile: improve bytes handling ( #9109 )
...
Technically some uses of `pwd` accept more types, but others
use `isinstance()` to enforce only `bytes`. It seems better to
keep the same type throughout the module.
2022-11-06 21:16:27 -08:00
Jelle Zijlstra
6639e2e14c
sqlite3: Blob.write accepts buffer ( #9097 )
2022-11-06 21:06:55 -08:00
Jelle Zijlstra
1f7648976c
unittest: cannot use bytes regexes ( #9107 )
...
```
>>> from unittest.case import TestCase
>>> c = TestCase()
>>> with c.assertRaisesRegex(Exception, b"x"): 1/0
...
ZeroDivisionError: division by zero
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/case.py", line 274, in __exit__
if not expected_regex.search(str(exc_value)):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: cannot use a bytes pattern on a string-like object
```
2022-11-05 14:14:53 -07:00
Jelle Zijlstra
3d64286f9e
winsound: accepts buffers ( #9108 )
...
https://github.com/python/cpython/blob/b5f711185bd11819566068ddf2a74a1402340e2d/PC/winsound.c#L93
2022-11-05 13:52:31 -07:00
Jelle Zijlstra
0e1ca279a4
struct: add missing pos-only markers ( #9099 )
2022-11-04 23:00:33 -07:00
Jelle Zijlstra
f678fac75a
tokenize: you can tokenize bytearrays too ( #9102 )
2022-11-04 22:59:05 -07:00
Jelle Zijlstra
cff08b674a
isort: Add more to extra_standard_library ( #9098 )
2022-11-04 22:56:40 -07:00
Jelle Zijlstra
7ef7029f88
smtplib: Improve bytes handling ( #9094 )
2022-11-04 20:08:10 -07:00
Jelle Zijlstra
7299b07790
multiprocessing: improve bytes handling ( #9085 )
2022-11-04 10:58:58 +01:00
Jelle Zijlstra
2199115822
dateparser: add new parameter ( #9081 )
...
Fixes #9079
2022-11-03 19:53:54 -07:00
Jelle Zijlstra
a17fa5001a
pickletools: accepts bytearray, use protocol from _typeshed ( #9073 )
2022-11-03 16:20:03 +01:00
Jelle Zijlstra
2f3f8da90a
msvcrt: improve bytes handling ( #9071 )
2022-11-03 12:11:36 +01:00
Jelle Zijlstra
43631078f0
importlib: improve bytes handling ( #9070 )
2022-11-03 12:00:24 +01:00
Jelle Zijlstra
82bf494534
quopri: improve types ( #9074 )
2022-11-03 11:37:59 +01:00
Jelle Zijlstra
6b702452b6
http: improve types ( #9055 )
2022-11-03 09:55:56 +01:00
Jelle Zijlstra
460158fc40
imaplib: _Authenticator also works with bytearray ( #9056 )
2022-11-02 20:55:41 -07:00
Jelle Zijlstra
62ddebb65c
fcntl: fix fcntl arg type (s#) ( #9052 )
2022-11-01 12:34:04 +01:00
Jelle Zijlstra
4d40fc6c8a
logging: StreamHandler.send takes ReadableBuffer ( #9057 )
2022-11-01 11:52:30 +01:00
Jelle Zijlstra
7ab933f3c3
email: improve bytes handling ( #9032 )
2022-11-01 10:13:30 +01:00
Jelle Zijlstra
3e46f9a9ee
dbm: fix bytes handling ( #9030 )
2022-11-01 10:10:37 +01:00
Jelle Zijlstra
39936cd18a
hmac: also support bytearray in 3.7 branch ( #9054 )
2022-10-31 23:28:53 -07:00
Jelle Zijlstra
524cd53d73
gzip: remove Any usage ( #9053 )
2022-10-31 23:14:12 -07:00
Jelle Zijlstra
3d8d744eb4
ctypes: improve bytes handling ( #9029 )
2022-10-31 15:26:09 +01:00
Jelle Zijlstra
c347c29417
builtins: improve bytes handling ( #9027 )
2022-10-30 17:32:07 -07:00
Jelle Zijlstra
276a4d7d69
difflib: diff_bytes accepts bytearray ( #9031 )
2022-10-28 19:42:47 -07:00
Jelle Zijlstra
583b600db0
asyncio: improve bytes handling ( #9013 )
2022-10-29 00:36:44 +02:00
Jelle Zijlstra
b8659e69f5
array: one more bad bytes type ( #9022 )
2022-10-28 14:18:19 -07:00
Jelle Zijlstra
b5c4580d52
CONTRIBUTING: Note no bytearray promotion ( #9005 )
...
Closes #9001
2022-10-28 13:48:59 -07:00
Jelle Zijlstra
05acb6c5c3
_msi: improve types ( #9008 )
2022-10-28 15:36:57 +02:00
Jelle Zijlstra
287fce4872
ssl, socket, array: Improve bytes handling ( #8997 )
2022-10-28 15:35:51 +02:00
Jelle Zijlstra
bcd876f77e
_codecs: Fix buffer parameters ( #9003 )
2022-10-28 11:25:21 +02:00
Jelle Zijlstra
f792b14e7f
_tcl: fix bytes usage ( #9010 )
2022-10-28 11:07:56 +02:00
Jelle Zijlstra
cb90e9d3a5
bz2: fix bytes parameters ( #9015 )
2022-10-28 11:01:03 +02:00
Jelle Zijlstra
97d8519f33
base64: fix a85decode param type ( #9014 )
2022-10-27 21:07:10 -07:00
Jelle Zijlstra
6438c7355c
_winapi: takes a ReadableBuffer ( #9011 )
2022-10-27 20:24:45 -07:00
Jelle Zijlstra
e8e69efd2b
antigravity: takes a ReadableBuffer ( #9012 )
2022-10-27 20:19:24 -07:00
Jelle Zijlstra
51c92d8975
_posixsubprocess: improve types ( #9009 )
2022-10-27 20:00:21 -07:00
Jelle Zijlstra
e0aa539854
_curses: improve bytes handling ( #9007 )
2022-10-27 19:48:08 -07:00
Jelle Zijlstra
5bcd4c1a93
ast: parse takes a ReadableBuffer ( #9002 )
...
parse() is basically just a wrapper around compile(), which we
already have as taking ReadableBuffer.
2022-10-27 13:28:02 -07:00
Jelle Zijlstra
739711e947
lzma: Takes ReadableBuffer, not bytes ( #8996 )
2022-10-27 07:02:57 -07:00
Jelle Zijlstra
f8ae34c34e
psutil: add snicstats.flags ( #8928 )
...
Fixes #8927
See https://github.com/giampaolo/psutil/commit/70eecaf44d61f2cabcd22ffb407b904242a122c9
2022-10-18 18:04:07 -07:00
Jelle Zijlstra
1b04ef2673
bytes, bytearray constructors: support buffers ( #8924 )
2022-10-18 19:20:20 +01:00
Jelle Zijlstra
9733901770
psycopg2: __nonzero__ was removed ( #8863 )
...
Fixes #8862
2022-10-07 02:23:56 +01:00
Jelle Zijlstra
c1d307fc3b
black: upgrade ( #8659 )
2022-08-31 16:01:52 -07:00
Jelle Zijlstra
5477097c6d
Upgrade pyright ( #8541 )
2022-08-12 20:24:51 -07:00
Jelle Zijlstra
b418c1c3ba
beautifulsoup4: Fix type of Tag.__iter__ ( #8357 )
2022-07-21 21:32:15 +02:00
Jelle Zijlstra
55562b83a1
threading: __exit__ only returns None ( #8298 )
...
Fixes #8297
`threading.Lock.__exit__` is implemented in C and can only return None: https://github.com/python/cpython/blob/6cbb57f62d345d7a5d6aeb1b3b5d37a845344d5e/Modules/_threadmodule.c#L200
`threading.Condition.__exit__` returns whatever its lock's `__exit__` returns, but our type annotations indicate that the lock is always a `Lock` or an `_RLock`, and neither returns anything other than None.
2022-07-14 20:00:08 -07:00
Jelle Zijlstra
0306754f5f
os: pos-only params for various functions ( #8284 )
2022-07-12 12:30:19 -07:00
Jelle Zijlstra
2a7439e106
Revert "add overload to tuple.__new__ to better express an empty tuple" ( #8278 )
...
This reverts commit 64554bdd5d .
Also add a test case.
2022-07-12 12:29:37 -07:00
Jelle Zijlstra
2a1b33df9f
os: Params for posix_fallocate and posix_fadvise are pos-only ( #8283 )
...
https://github.com/python/cpython/blob/90a6e56e5663233fe986331ef3f10422fe57dcbc/Modules/posixmodule.c#L10845
2022-07-12 12:19:41 -07:00
Jelle Zijlstra
56c8cbb314
Add GenericAlias.__typing_unpacked_tuple_args__ ( #8015 )
...
Fixes #8014
python/cpython#92484
2022-06-03 08:26:41 +01:00
Jelle Zijlstra
cb9023988d
psycopg2: stub improvements ( #7964 )
...
Fixes an entry from #7928 along with a number of other improvements.
I went off the C code:
https://github.com/psycopg/psycopg2/blob/master/psycopg/connection_type.c
2022-06-02 18:02:07 -07:00
Jelle Zijlstra
1aa546d07d
pyright: turn off reportPropertyTypeMismatch ( #7985 )
2022-05-30 09:20:28 +02:00
Jelle Zijlstra
c35ec8ba89
contextlib: Remove explicit base class from ExitStack ( #7963 )
...
Fixes #7961
2022-05-27 09:19:18 -07:00
Jelle Zijlstra
7d34d75582
array: stub improvements ( #7966 )
...
- TypeVar changes from https://github.com/microsoft/pyright/issues/3501
- Fix pos-only param
- Use protocols instead of IO classes
2022-05-27 07:33:24 +01:00
Jelle Zijlstra
789c12ad90
constructors: Fix defaulted TypeVars ( #7965 )
...
From the list in https://github.com/microsoft/pyright/issues/3501
2022-05-27 07:32:56 +01:00
Jelle Zijlstra
466f9c2ad7
redis: Fix unconstrained TypeVars in a few redis commands ( #7942 )
...
Part of #7928
2022-05-26 15:53:56 +01:00
Jelle Zijlstra
84e2ea113f
gettext: fix unconstrained TypeVar ( #7935 )
2022-05-26 07:10:47 +01:00
Jelle Zijlstra
d5bc48d29b
builtins, collections: Fix unconstrained overloads for container constructors ( #7944 )
...
See https://github.com/microsoft/pyright/issues/3501#issuecomment-1135979479
Related to #7928
2022-05-25 10:07:23 +01:00
Jelle Zijlstra
796a689fc1
mock: Fix unconstrained TypeVar ( #7945 )
...
The first overload covers the case where `new` is not given.
Part of #7928
2022-05-25 06:52:40 +01:00
Jelle Zijlstra
070e6c2a2d
invoke: Fix unconstrained TypeVar ( #7943 )
...
Part of #7928
https://github.com/pyinvoke/invoke/blob/f34c6c9413146a34ede3a5b529916b4cee649887/invoke/tasks.py#L328
2022-05-25 06:48:49 +01:00
Jelle Zijlstra
bb119544d8
pkg_resources: Fix unconstrained TypeVars ( #7941 )
...
https://github.com/pypa/setuptools/blob/499c468a57d240e5bb450bdb6daedc3e559541dd/pkg_resources/__init__.py#L1049
Part of #7928
2022-05-24 19:49:22 -07:00
Jelle Zijlstra
d950ec37ca
fileinput: Fix TypeVar usage (#7934 )
...
* fileinput: Fix TypeVar usage
Fixes #7922 , part of #7928 .
2022-05-24 17:55:35 +01:00
Jelle Zijlstra
158293257e
optparse: fix unconstrained TypeVar ( #7936 )
...
Part of #7928
2022-05-23 19:39:31 -07:00
Jelle Zijlstra
b4518bfb2b
argparse: remove incorrect default in overload ( #7929 )
...
Part of #7928
2022-05-23 18:12:19 +01:00
Jelle Zijlstra
9660ee97ee
codecs: add missing function, reflect runtime import * ( #7918 )
2022-05-22 16:06:21 -07:00
Jelle Zijlstra and Alex Waygood
18433202ba
concurrent.futures: new params in 3.11 ( #7919 )
...
https://github.com/python/cpython/commit/fdc0e09c3316098b038996c428e88931f0a4fcdb
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2022-05-22 15:51:09 -07:00
Jelle Zijlstra
54c2e23a55
3.11 allowlist: move inspect._ParameterKind.description to wontfix section ( #7920 )
2022-05-22 12:04:11 +03:00
Jelle Zijlstra
3dcfbf3745
urllib.request: add code 308 handler for 3.11 ( #7917 )
...
https://github.com/python/cpython/commit/c379bc5ec9012cf66424ef3d80612cf13ec51006
2022-05-21 14:13:17 -07:00
Jelle Zijlstra
1220a99399
unicodedata: add UCD.is_normalized ( #7915 )
2022-05-21 12:59:44 -07:00
Jelle Zijlstra
ddc6eda10a
symtable: has_exec was removed in 3.9 ( #7911 )
2022-05-21 17:50:27 +02:00
Jelle Zijlstra
39c777f70c
pydoc: 3.11 changes ( #7910 )
2022-05-21 17:49:39 +02:00
Jelle Zijlstra
237b1bb189
binascii.a2b_base64: new param in 3.11 ( #7909 )
...
https://github.com/python/cpython/commit/35b98e38b6edd63153fc8e092f94cb20725dacc1
2022-05-21 08:36:03 -07:00
Jelle Zijlstra
9c0c631e46
gettext.install: names is kw-only in 3.11 ( #7908 )
2022-05-21 08:22:34 -07:00
Jelle Zijlstra
8b58371278
subprocess: new params in 3.11 ( #7907 )
2022-05-21 16:07:50 +01:00
Jelle Zijlstra
0198d75153
types: 3.11 (and earlier) fixes ( #7900 )
...
- New attributes in 3.11
- Arguments to CodeType.__init__ are always positional (have fun)
- co_consts can use object instead of Any
2022-05-21 07:37:11 -07:00
Jelle Zijlstra and Alex Waygood
7576805aee
zipfile: 3.11 fixes ( #7898 )
...
* zipfile: 3.11 fixes
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2022-05-21 09:22:32 +01:00
Jelle Zijlstra
585517b20e
stubtest: put all the incorrect __get__ sigs together ( #7899 )
2022-05-20 09:47:02 -07:00
Jelle Zijlstra
e7cbde0928
xml: stubtest fixes ( #7890 )
2022-05-20 13:03:45 +02:00
Jelle Zijlstra
26fa57ab78
traceback: update for py311 ( #7886 )
2022-05-19 19:14:12 -07:00
Jelle Zijlstra
0b7df3b2aa
dataclasses: fix and sort stubtest complaints ( #7888 )
2022-05-19 19:13:22 -07:00
Jelle Zijlstra
4220712aab
dis: add adaptive argument for 3.11 ( #7889 )
2022-05-19 18:27:34 -07:00
Jelle Zijlstra and Shantanu
64766c8521
locale: add locale.getencoding ( #7887 )
...
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com >
2022-05-19 18:20:16 -07:00
Jelle Zijlstra
1ffb1bdc0e
wsgiref: categorise stubtest issues ( #7885 )
2022-05-19 18:10:56 -07:00
Jelle Zijlstra
6f2c53f3b0
_imp: fix stubtest issues, add Python 3.11 items ( #7878 )
2022-05-19 14:43:58 +02:00
Jelle Zijlstra
250f3d92e7
ast: fix stubtest issues ( #7877 )
...
Add annotations for `_ast.Tuple.dims` and `ast.main()`. Add allowlist comments for others.
2022-05-19 10:13:08 +01:00
Jelle Zijlstra
4191906e6e
3.11: move some stubtest entries to wontfix list ( #7876 )
2022-05-19 08:14:44 +02:00
Jelle Zijlstra
7998906226
re: 3.11 fixes ( #7859 )
2022-05-17 21:42:23 -07:00
Jelle Zijlstra
bd394d2486
builtins: add BaseException.add_note in py311 ( #7860 )
2022-05-17 20:32:28 -07:00
Jelle Zijlstra
a01f98c361
sqlite3.Blob: fix stubtest errors ( #7858 )
2022-05-17 19:50:19 -07:00
Jelle Zijlstra and Alex Waygood
8f5a83516b
tempfile.SpooledTemporaryFile: inherit from IOBase on 3.11 ( #7802 )
...
python/cpython#29560
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2022-05-17 18:41:47 -07:00
eab82c838a
asyncio: updates for 3.11 ( #7844 )
...
CPython changes:
- https://github.com/python/cpython/commit/13c10bfb777483c7b02877aab029345a056b809c
- https://github.com/python/cpython/commit/9523c0d84f351a610dc651b234461eb015fa3b82
- https://github.com/python/cpython/commit/9f04ee569cebb8b4c6f04bea95d91a19c5403806
- https://github.com/python/cpython/commit/d03acd7270d66ddb8e987f9743405147ecc15087
- https://github.com/python/cpython/commit/195a46d6ffd4cec6c5fb69c5890f8b1758ac91ca
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com >
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2022-05-17 18:11:29 -07:00
b00b4f3447
regex: accept buffers ( #7680 )
...
Similar to #7679
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2022-05-10 15:08:36 -07:00
Jelle Zijlstra
68a781d04e
Upgrade pytype ( #7823 )
2022-05-10 14:47:10 -07:00