Jelle Zijlstra
c65a87481d
colorama: Preserve input type for wrap_stream ( #9677 )
2023-02-06 06:50:21 -08:00
Jelle Zijlstra
5b24c7bb41
stdlib: Run stubdefaulter on Linux for 3.9 ( #9663 )
2023-02-03 00:39:22 +00:00
Jelle Zijlstra
0fc3a567fc
stdlib: add defaults for modules accessible on MacOS ( #9659 )
...
Ran stubdefaulter with standard options on a Mac.
2023-02-01 22:46:55 +00:00
Jelle Zijlstra
bc463a0677
Remove default for size parameter to multiprocessing.heap.Heap ( #9658 )
...
It's system-dependent. stubdefaulter told me `multiprocessing.heap.Heap: parameter size: stub default 4096 != runtime default 16384`, which presumably means it's 4096 on @AlexWaygood's system and 16384 on mine. I looked in the code and the default is set to `mmap.PAGESIZE`, which in turn is set from some system call at import time.
2023-02-01 22:43:50 +00:00
Jelle Zijlstra
af2ce282d5
builtins: do the TODO on compile() ( #9567 )
2023-01-18 11:48:48 -08:00
Jelle Zijlstra
aa4d6d87ae
asyncio: fix default for subprocess_exec ( #9561 )
2023-01-18 15:03:22 +01:00
Jelle Zijlstra
ddfaca3200
stdlib: add argument default values ( #9501 )
2023-01-18 09:37:34 +01:00
Jelle Zijlstra
b43e1db47b
ssl, sysconfig: fix issues with defaults ( #9507 )
...
- ssl._create_unverified_context allows None since 3.10:
https://github.com/python/cpython/commit/2875c603b2a7691b55c2046aca54831c91efda8e#diff-f6439be9c66350dde4c35dbeea0352c96cc970ba12b0478f6ae36f10725bd8c5
- sysconfig.is_python_build ignores its argument since 3.11:
https://github.com/python/cpython/commit/067597522a9002f3b8aff7f46033f10acb2381e4
(was backported into 3.11)
2023-01-12 10:19:41 -08:00
Jelle Zijlstra and Alex Waygood
f64807a468
socketserver: improve bytes handling ( #9096 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2023-01-12 16:46:20 +00:00
Jelle Zijlstra
b9eab637cb
subprocess: Improve bytes-related types ( #9100 )
2023-01-11 20:10:26 -08:00
Jelle Zijlstra
6a366c99a9
venv: add logger ( #9508 )
...
Not particularly useful but unreleased stubtest will require this:
https://github.com/python/typeshed/actions/runs/3898630022/jobs/6657546205
2023-01-11 19:33:16 -08:00
Jelle Zijlstra
1ce1c1ad17
subprocess: universal_newlines may be None ( #9509 )
...
All the way back to 3.7:
https://github.com/python/cpython/blob/3.7/Lib/subprocess.py#L684
It's treated like False
2023-01-11 19:15:40 -08:00
Jelle Zijlstra
d2829ecdf7
urllib.parse.urlencode: encoding and errors can be None ( #9506 )
...
The runtime defaults are None. Found in #9501 .
2023-01-11 18:55:38 -08:00
Jelle Zijlstra
7ca7b0c659
Add Nikita Sobolev to maintainers ( #9351 )
2022-12-11 09:43:59 +03:00
Jelle Zijlstra and Alex Waygood
388d7839d9
regr_test.py: improve interaction between --all and --quiet flags (#9349 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2022-12-10 21:39:33 +00:00
Jelle Zijlstra
00483b63e6
http.client.HTTPConnection.request accepts str as the body ( #9322 )
...
See code around https://github.com/python/cpython/blob/ab02262cd0385a2fb5eb8a6ee3cedd4b4bb969f3/Lib/http/client.py#L1328
2022-12-02 10:49:33 -08:00
Jelle Zijlstra
9452ce539c
xmlrpc: improve bytes handling ( #9166 )
2022-11-25 19:33:53 -08:00
Jelle Zijlstra
59f35b51b2
pyflakes: fix stubtest ( #9273 )
...
Fixes #9272
2022-11-25 09:34:37 +01:00
Jelle Zijlstra
8da1e8c31d
marshal: specify allowed types ( #9165 )
2022-11-24 22:54:09 -08:00
Jelle Zijlstra
d2da97d99c
urllib: improve bytes handling ( #9167 )
2022-11-22 16:38:28 -08:00
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