Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | coalesce GILless sections in new_buffersize (#5059) | Benjamin Peterson | 2018-01-02 | 1 | -5/+6 |
| | | | 830daae1c82ed33deef0086b7b6323e5be0b0cc8 added some new GIL-releasing to new_buffersize. This is fine, but it's better to avoid reacquiring the GIL for as long as possible. Also, it should use FILE_(BEGIN|END)_ALLOW_THREADS to avoid having the file closed from under it. | ||||
* | bpo-31530: fix crash when multiple threads iterate over a file, round 2 (#5060) | Benjamin Peterson | 2018-01-02 | 1 | -51/+67 |
| | | | | | | | | | | | | | | | Multiple threads iterating over a file can corrupt the file's internal readahead buffer resulting in crashes. To fix this, cache buffer state thread-locally for the duration of a file_iternext call and only update the file's internal state after reading completes. No attempt is made to define or provide "reasonable" semantics for iterating over a file on multiple threads. (Non-crashing) races are still present. Duplicated, corrupt, and missing data will happen. This was originally fixed by 6401e5671781eb217ee1afb4603cc0d1b0367ae6, which raised an exception from seek() and next() when concurrent operations were detected. Alas, this simpler solution breaks legitimate use cases such as capturing the standard streams when multiple threads are logging. | ||||
* | [2.7] bpo-32186: Release the GIL during fstat and lseek calls (#4651) | Nir Soffer | 2017-12-07 | 1 | -3/+18 |
| | | | | | | | | In fileio, there were 3 fstat() calls and one lseek() call that did not release the GIL during the call. This can cause all threads to hang for unlimited time when using io.FileIO with inaccessible NFS server. Same issue seen in fileio exists also in fileobject, fixed in the same way. | ||||
* | [2.7] bpo-31530: Stop crashes when iterating over a file on multiple ↵ | Serhiy Storchaka | 2017-11-10 | 1 | -3/+16 |
| | | | | threads. (#3672) | ||||
* | consistently use Py_TYPE, Py_REFCNT, and correct initializer macros (#3563) | Benjamin Peterson | 2017-09-14 | 1 | -1/+1 |
| | | | This no-op change makes 2.7 more consistent with 3.x to ease comparison and backports. | ||||
* | Issue #23908: os functions, open() and the io.FileIO constructor now reject | Serhiy Storchaka | 2016-07-01 | 1 | -1/+2 |
| | | | | | unicode paths with embedded null character on Windows instead of silently truncate them. | ||||
* | Issue #27171: Fix typos in documentation, code comments, and tests | Martin Panter | 2016-06-02 | 1 | -1/+1 |
| | |||||
* | Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREF | Serhiy Storchaka | 2016-04-10 | 1 | -2/+2 |
| | | | | in places where Py_DECREF was used. | ||||
* | Issue #22570: Renamed Py_SETREF to Py_XSETREF. | Serhiy Storchaka | 2016-04-06 | 1 | -2/+2 |
| | |||||
* | Issue #20440: Massive replacing unsafe attribute setting code with special | Serhiy Storchaka | 2015-12-24 | 1 | -4/+2 |
| | | | | macro Py_SETREF. | ||||
* | use Py_ssize_t for file offset and length computations in iteration (closes ↵ | Benjamin Peterson | 2014-10-01 | 1 | -8/+7 |
| | | | | #22526) | ||||
* | Issue #21350: Fix file.writelines() to accept arbitrary buffer objects, as ↵ | Antoine Pitrou | 2014-05-08 | 1 | -7/+7 |
| | | | | | | advertised. Patch by Brian Kearns. | ||||
* | Circumventing a bug in glibc (issue #17976). | Serhiy Storchaka | 2013-12-17 | 1 | -3/+5 |
| | | | | Patch by Jaakko Moisio. | ||||
* | Issue #17976: Fixed potential problem with file.write() not detecting IO error | Serhiy Storchaka | 2013-12-17 | 1 | -1/+5 |
| | | | | | by inspecting the return value of fwrite(). Based on patches by Jaakko Moisio and test by Victor Stinner. | ||||
* | Issue #15989: Fix several occurrences of integer overflow | Serhiy Storchaka | 2013-01-19 | 1 | -4/+4 |
| | | | | | | | when result of PyInt_AsLong() or PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277. | ||||
* | get the core to compile --disable-unicode | Benjamin Peterson | 2013-01-02 | 1 | -1/+3 |
| | |||||
* | Fixes issue #12268 for file readline, readlines and read() and readinto methods. | Gregory P. Smith | 2012-06-26 | 1 | -4/+61 |
| | | | | | | They no longer lose data when an underlying read system call is interrupted. IOError is no longer raised due to a read system call returning EINTR from within these methods. | ||||
* | Issue #14505: Fix file descriptor leak when deallocating file objects ↵ | Antoine Pitrou | 2012-04-05 | 1 | -1/+2 |
| | | | | created with PyFile_FromString(). | ||||
* | #14161: fix compile error under Windows. | Ezio Melotti | 2012-03-11 | 1 | -1/+2 |
| | |||||
* | #14161: fix the __repr__ of file objects to escape the file name. | Ezio Melotti | 2012-03-11 | 1 | -4/+10 |
| | |||||
* | Issue #13159: Replace FileIO's quadratic-time buffer growth algorithm with a ↵ | Nadeem Vawda | 2011-10-13 | 1 | -15/+4 |
| | | | | | | linear-time one. Also fix the builtin file class and the bz2 module, which used the same algorithm. | ||||
* | Issue #7732: Fix a crash on importing a module if a directory has the same name | Victor Stinner | 2011-09-23 | 1 | -13/+19 |
| | | | | | | | | than a Python module (e.g. "__init__.py"): don't close the file twice. PyFile_FromFile() does also close the file if PyString_FromString() failed. It did already close the file on fill_file_fields() error (e.g. if the file is a directory). | ||||
* | Issue #9295: Fix a crash under Windows when calling close() on a file | Antoine Pitrou | 2010-10-28 | 1 | -0/+6 |
| | | | | object with custom buffering from two threads at once. | ||||
* | iterators passed to writelines() can close their files; don't segfault #10125 | Benjamin Peterson | 2010-10-16 | 1 | -0/+5 |
| | |||||
* | Issue #4947: The write() method of sys.stdout and sys.stderr uses their | Victor Stinner | 2010-09-08 | 1 | -4/+33 |
| | | | | | encoding and errors attributes instead of using utf-8 in strict mode, to get the same behaviour than the print statement. | ||||
* | Issue #7079: Fix a possible crash when closing a file object while using | Antoine Pitrou | 2010-05-17 | 1 | -2/+4 |
| | | | | it from another thread. Patch by Daniel Stutzbach. | ||||
* | Untabify C files. Will watch buildbots. | Antoine Pitrou | 2010-05-09 | 1 | -2002/+2002 |
| | |||||
* | more _PyString_Resize error checking | Benjamin Peterson | 2010-04-03 | 1 | -8/+10 |
| | |||||
* | #7706: DONT_HAVE_ERRNO_H is no longer defined by configure (after rev.46819). | Andrew M. Kuchling | 2010-02-22 | 1 | -1/+1 |
| | |||||
* | Issue #5677: Explicitly forbid write operations on read-only file objects, | Antoine Pitrou | 2010-02-05 | 1 | -0/+32 |
| | | | | | | and read operations on write-only file objects. On Windows, the system C library would return a bogus result; on Solaris, it was possible to crash the interpreter. Patch by Stefan Krah. | ||||
* | Issue #6368: Fixed unused variable warning on Unix. | Hirokazu Yamamoto | 2009-06-29 | 1 | -0/+2 |
| | |||||
* | Issue #4856: Remove checks for win NT. | Hirokazu Yamamoto | 2009-06-28 | 1 | -19/+11 |
| | |||||
* | Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more. | Hirokazu Yamamoto | 2009-05-17 | 1 | -1/+1 |
| | |||||
* | issue 4804: Provide checks for the format string of strftime, and for the ↵ | Kristján Valur Jónsson | 2009-02-04 | 1 | -1/+88 |
| | | | | "mode" string of fopen on Windows. These strings are user provided from python and so we can avoid invoking the C runtime invalid parameter handler by first checking that they are valid. | ||||
* | #4764 set IOError.filename when trying to open a directory on POSIX platforms | Benjamin Peterson | 2008-12-29 | 1 | -2/+2 |
| | |||||
* | #3965: on Windows, open() crashes if the filename or the mode is invalid, | Amaury Forgeot d'Arc | 2008-09-25 | 1 | -4/+11 |
| | | | | | | and if the filename is a unicode string. Reviewed by Martin von Loewis. | ||||
* | Issue #3139: Make buffer-interface thread-safe wrt. PyArg_ParseTuple, | Martin v. Löwis | 2008-08-12 | 1 | -2/+16 |
| | | | | | | | by denying s# to parse objects that have a releasebuffer procedure, and introducing s*. More module might need to get converted to use s*. | ||||
* | More reverting of r63675 per the mailing list discussions. This restores | Gregory P. Smith | 2008-06-10 | 1 | -3/+3 |
| | | | | | occurances of PyBytes_ in the code to their original PyString_ names. The bytesobject.c file will be renamed back to stringobject.c in a future checkin. | ||||
* | This reverts r63675 based on the discussion in this thread: | Gregory P. Smith | 2008-06-09 | 1 | -54/+54 |
| | | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread. | ||||
* | New environment variable PYTHONIOENCODING. | Martin v. Löwis | 2008-06-01 | 1 | -3/+32 |
| | |||||
* | Renamed PyString to PyBytes | Christian Heimes | 2008-05-26 | 1 | -56/+56 |
| | |||||
* | #2353: raise Py3k warning in file.xreadlines(). | Georg Brandl | 2008-05-17 | 1 | -3/+12 |
| | |||||
* | A little reformating of Py3k warnings | Benjamin Peterson | 2008-04-27 | 1 | -2/+3 |
| | |||||
* | Use PyErr_WarnPy3k throughout | Benjamin Peterson | 2008-04-27 | 1 | -6/+2 |
| | |||||
* | Make file objects as thread safe as the underlying libc FILE* implementation. | Gregory P. Smith | 2008-04-06 | 1 | -81/+164 |
| | | | | | | | | | | | close() will now raise an IOError if any operations on the file object are currently in progress in other threads. Most code was written by Antoine Pitrou (pitrou). Additional testing, documentation and test suite cleanup done by me (gregory.p.smith). Fixes issue 815646 and 595601 (as well as many other bugs and references to this problem dating back to the dawn of Python). | ||||
* | #2348: add py3k warning for file.softspace. | Georg Brandl | 2008-03-21 | 1 | -2/+34 |
| | |||||
* | Remove all traces of HAVE_STRERROR. | Brett Cannon | 2008-03-18 | 1 | -8/+0 |
| | | | | | The removal of strerror.c led to the function check being removed from configure.in. | ||||
* | Fix the IOError message text when opening a file with an invalid filename. | Gregory P. Smith | 2008-03-18 | 1 | -2/+5 |
| | | | | Error reported by Ilan Schnell. | ||||
* | #2067: file.__exit__() now calls subclasses' close() method. | Georg Brandl | 2008-02-23 | 1 | -2/+2 |
| | |||||
* | static PyObject* variables should use PyString_InternFromString() instead of ↵ | Christian Heimes | 2008-01-28 | 1 | -1/+1 |
| | | | | PyObject_FromString() to store a python string in a function level static var. |