8000 Merge remote-tracking branch 'upstream/main' into pep649-compile · python/cpython@a121e1a · GitHub
[go: up one dir, main page]

Skip to content

Commit a121e1a

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pep649-compile
2 parents 13f5d76 + bf5b646 commit a121e1a

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

Lib/site.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ def addpackage(sitedir, name, known_paths):
185185
return
186186

187187
try:
188-
pth_content = pth_content.decode()
188+
# Accept BOM markers in .pth files as we do in source files
189+
# (Windows PowerShell 5.1 makes it hard to emit UTF-8 files without a BOM)
190+
pth_content = pth_content.decode("utf-8-sig")
189191
except UnicodeDecodeError:
190192
# Fallback to locale encoding for backward compatibility.
191193
# We will deprecate this fallback in the future.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix ``fcntl.ioctl()`` *request* parameter: use an ``unsigned long`` instead of
2+
an ``unsigned int`` for the *request* parameter of :func:`fcntl.ioctl` to
3+
support requests larger than ``UINT_MAX``. Patch by Victor Stinner.

Modules/clinic/fcntlmodule.c.h

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/fcntlmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg)
112112
fcntl.ioctl
113113
114114
fd: fildes
115-
request as code: unsigned_int(bitwise=True)
115+
request as code: unsigned_long(bitwise=True)
116116
arg as ob_arg: object(c_default='NULL') = 0
117117
mutate_flag as mutate_arg: bool = True
118118
/
@@ -148,9 +148,9 @@ code.
148148
[clinic start generated code]*/
149149

150150
static PyObject *
151-
fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code,
151+
fcntl_ioctl_impl(PyObject *module, int fd, unsigned long code,
152152
PyObject *ob_arg, int mutate_arg)
153-
/*[clinic end generated code: output=7f7f5840c65991be input=967b4a4cbeceb0a8]*/
153+
/*[clinic end generated code: output=3d8eb6828666cea1 input=cee70f6a27311e58]*/
154154
{
155155
#define IOCTL_BUFSZ 1024
156156
/* We use the unsigned non-checked 'I' format for the 'code' parameter

0 commit comments

Comments
 (0)
0