| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When called on a closed object, readinto() segfaults on account
of a write to a freed buffer:
==220553== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==220553== Access not within mapped region at address 0x2A
==220553== at 0x48408A0: memmove (vg_replace_strmem.c:1272)
==220553== by 0x58DB0C: _buffered_readinto_generic (bufferedio.c:972)
==220553== by 0x58DCBA: _io__Buffered_readinto_impl (bufferedio.c:1053)
==220553== by 0x58DCBA: _io__Buffered_readinto (bufferedio.c.h:253)
Reproducer:
reader = open ("/dev/zero", "rb")
_void = reader.read (42)
reader.close ()
reader.readinto (bytearray (42)) GH-GH-GH- BANG!
The problem exists since 2012 when commit dc469454ec added code
to free the read buffer on close().
Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com>
(cherry picked from commit cb1c0746f277052e45a60d6c436a765e34722821)
Co-authored-by: Philipp Gesang <phg@phi-gamma.net>
Co-authored-by: Philipp Gesang <phg@phi-gamma.net>
|
| |
|
|
|
|
|
|
|
| |
(GH-11015) (GH-11020) (GH-11026)
(cherry picked from commit 4c49da0cb7434c676d70b9ccf38aca82ac0d64a9)
(cherry picked from commit 602d307ac5e8a2da38a193dca3bdfef5994dfe67)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
|
| |
(GH-10749)
Fix also return type for few other functions (clear, releasebuffer).
(cherry picked from commit d4f9cf5545d6d8844e0726552ef2e366f5cc3abd)
|
| |
|
|
|
|
|
|
|
| |
(GH-10217)
_io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range
value to the bitwise struct field.
(cherry picked from commit b08746bfdf64e55ce33516f2065fa2aa4f51be95)
Co-authored-by: Xiang Zhang <angwerzx@126.com>
|
| |
|
|
|
| |
On macOS, fix reading from and writing into a file with a size larger than 2 GiB.
(cherry picked from commit 74a8b6ea7e0a8508b13a1c75ec9b91febd8b5557)
|
| |
|
|
|
| |
(GH-7911)
Co-authored-by: ValeriyaSinevich <valeriya.sinevich@phystech.edu>
|
| |
|
|
|
|
|
| |
exception set (GH-8282). (GH-8312)
(cherry picked from commit 28f07364f066792ceee93231dbb80ae8ad98b2bb)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
They can be exposed when some C API calls fail due to lack of
memory.
* Failed Py_BuildValue() could cause an assertion error in the
following TextIOWrapper.tell().
* input_chunk could be decrefed twice in TextIOWrapper.seek()
after failed Py_BuildValue().
* initvalue could leak in StringIO.__getstate__() after failed
PyDict_Copy().
(cherry picked from commit fdb5a50ef34f7951c3b01eb77b1359725a9ad670)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
| |
(GH-3918). (GH-8012)
(cherry picked from commit 23db935bcf258657682e66464bf8512def8af830)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 42c35d9c0c8175332f50fbe034a001fe52f057b9)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
| |
Ensure that ``truncate()`` preserves the file position (as reported by ``tell()``) after writes longer than the buffer size..
(cherry picked from commit 059f58ce938d9c3f0286412a4efb1b9131339421)
|
| |
|
|
|
|
|
| |
In _io_FileIO_readall_impl(), lseek() and _Py_fstat_noraise() were called
without releasing the GIL. This can cause all threads to hang for
unlimited time when calling FileIO.read() and the NFS server is not
accessible.
(cherry picked from commit 6a89481680b921e7b317c29877bdda9a6031e5ad)
|
| |
|
|
|
| |
(GH-3712) (#3714)
(cherry picked from commit d6238a76c655e0feb13478505220dc9049f1682f)
|
| |
|
| |
(cherry picked from commit a6296d34a478b4f697ea9db798146195075d496c)
|
| |
|
| |
(cherry picked from commit ba7d7365215d791025d1efd25393c91404f2cfc8)
|
| |
|
|
|
| |
(GH-3201) (#3209)
(cherry picked from commit a5b4ea15b61e3f3985f4f0748a18f8b888a63532)
|
| |
|
|
| |
to parse non-args. (#3210)
|
| |
|
|
| |
Fix memory leak when _winconsoleio tries to open a non-console file:
free the name buffer.
|
| |
|
|
|
|
|
|
|
|
| |
(GH-2302) (#2462)
Based on patch by Victor Stinner.
Add private C API function _PyUnicode_AsUnicode() which is similar to
PyUnicode_AsUnicode(), but checks for null characters..
(cherry picked from commit f7eae0adfcd4c50034281b2c69f461b43b68db84)
|
| |
|
|
|
|
|
| |
(GH-2285) (#2443)
Raise a ValueError if the second argument is NULL and the wchar_t\*
string contains null characters..
(cherry picked from commit e613e6add5f07ff6aad5802924596b631b707d2a)
|
| |
|
|
|
|
| |
Fix a reference leak in _io._WindowsConsoleIO: PyUnicode_FSDecoder()
always initialize decodedname when it succeed and it doesn't clear
input decodedname object.
(cherry picked from commit 29adc13bd797d9c9e7fcb893a7c49ce7f7ad388c)
|
| |
|
|
|
|
|
| |
WriteConsoleW fails (#1912) (#1925)
* bpo-30544: _io._WindowsConsoleIO.write raises the wrong error when WriteConsoleW fails
* bpo-30544: _io._WindowsConsoleIO.write raises the wrong error when WriteConsoleW fails
|
| |
|
|
|
|
|
| |
(#1096) (#1180)
raised an error.
(cherry picked from commit bf623ae8843dc30b28c574bec8d29fc14be59d86)
|
| |
|
|
| |
present (#1130) (#1150)
|
| |
|
|
|
| |
(#514) (#722)
(cherry picked from commit a5af6e1af77ee0f9294c5776478a9c24d9fbab94)
|
| | |
|
| | |
|
| | |
|
| |\ |
|
| | |
| |
| |
| |
| |
| | |
* Indent versionchanged at method level, not class level
* Mark up ``--help`` to avoid generating an en dash
* Use forward slash in Unix command line with a dollar sign ($) prompt
|
| | |
| |
| |
| | |
Masayuki Yamamoto
|
| |\ \
| |/ |
|
| | |
| |
| |
| | |
This makes tests passing after changes by issue #5322.
|
| | |
| |
| |
| | |
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
|
| |\ \
| |/
| |
| |
| |
| | |
_PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
|
| | |
| |
| |
| |
| |
| | |
_PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
|
| |\ \
| |/
| |
| |
| | |
the garbage collector is invoked in other thread.
Based on patch by Sebastian Cufre.
|
| | |
| |
| |
| |
| | |
the garbage collector is invoked in other thread.
Based on patch by Sebastian Cufre.
|
| | | |
|
| | |
| |
| |
| | |
issues found by the tests.
|
| | | |
|
| |\ \
| |/ |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
Issue #28162: WindowsConsoleIO readall() fails if first line starts with Ctrl+Z
Issue #28163: WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle
Issue #28164: _PyIO_get_console_type fails for various paths
|
| | | |
|
| | |
| |
| |
| | |
Closes #17602: Adds a readline implementation for the Windows console
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|