summaryrefslogtreecommitdiffstats
path: root/Python/fileutils.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Issue #23694: Handle EINTR in _Py_open() and _Py_fopen_obj()Victor Stinner2015-03-181-13/+40
| | | | | Retry open()/fopen() if it fails with EINTR and the Python signal handler doesn't raise an exception.
* Issue #23694: Enhance _Py_fopen(), it now raises an exception on errorVictor Stinner2015-03-181-12/+36
| | | | | * If fopen() fails, OSError is raised with the original filename object. * The GIL is now released while calling fopen()
* Issue #23694: Enhance _Py_open(), it now raises exceptionsVictor Stinner2015-03-171-17/+55
| | | | | | | | * _Py_open() now raises exceptions on error. If open() fails, it raises an OSError with the filename. * _Py_open() now releases the GIL while calling open() * Add _Py_open_noraise() when _Py_open() cannot be used because the GIL is not held
* Fixes incorrect use of GetLastError where errno should be used.Steve Dower2015-03-141-6/+6
|\
| * Fixes incorrect use of GetLastError where errno should be used.Steve Dower2015-03-141-6/+6
| |
* | Issue #23524: Change back to using Windows errors for _Py_fstat instead of ↵Steve Dower2015-03-081-3/+5
| | | | | | | | the errno shim.
* | Issue #23524: Replace _PyVerify_fd function with calling ↵Steve Dower2015-03-061-5/+103
| | | | | | | | _set_thread_local_invalid_parameter_handler on every thread.
* | Issue #23152: Renames time_t_to_FILE_TIME to _Py_time_t_to_FILE_TIME, ↵Steve Dower2015-02-211-4/+2
| | | | | | | | removes unused struct win32_stat and return value
* | Issue #23152: Renames attribute_data_to_stat to _Py_attribute_data_to_statSteve Dower2015-02-211-2/+2
| |
* | Issue #23152: Implement _Py_fstat() to support files larger than 2 GB on ↵Steve Dower2015-02-211-2/+140
| | | | | | | | | | | | Windows. fstat() may fail with EOVERFLOW on files larger than 2 GB because the file size type is an signed 32-bit integer.
* | merge 3.4 (#23165)Benjamin Peterson2015-01-041-3/+13
|\ \ | |/
| * merge 3.3 (closes #23165)Benjamin Peterson2015-01-041-3/+13
| |\
| | * merge 3.2 (closes #23165)Benjamin Peterson2015-01-041-3/+13
| | |\
| | | * add some overflow checks before multiplying (closes #23165)Benjamin Peterson2015-01-041-3/+13
| | | |
* | | | (Merge 3.4) Closes #22258: Fix the the internal function set_inheritable() onVictor Stinner2014-09-021-14/+34
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | Illumos. This platform exposes the function ioctl(FIOCLEX), but calling it fails with errno is ENOTTY: "Inappropriate ioctl for device". set_inheritable() now falls back to the slower fcntl() (F_GETFD and then F_SETFD).
| * | | Closes #22258: Fix the the internal function set_inheritable() on Illumos.Victor Stinner2014-09-021-14/+34
| | | | | | | | | | | | | | | | | | | | | | | | This platform exposes the function ioctl(FIOCLEX), but calling it fails with errno is ENOTTY: "Inappropriate ioctl for device". set_inheritable() now falls back to the slower fcntl() (F_GETFD and then F_SETFD).
* | | | Issue #18395: Rename ``_Py_char2wchar()`` to :c:func:`Py_DecodeLocale`, renameVictor Stinner2014-08-011-32/+35
| | | | | | | | | | | | | | | | | | | | ``_Py_wchar2char()`` to :c:func:`Py_EncodeLocale`, and document these functions.
* | | | Issue #22054: Add os.get_blocking() and os.set_blocking() functions to get andVictor Stinner2014-07-291-0/+53
|/ / / | | | | | | | | | | | | set the blocking mode of a file descriptor (False if the O_NONBLOCK flag is set, True otherwise). These functions are not available on Windows.
* | | Merge from 3.3.Stefan Krah2014-01-201-1/+2
|\ \ \ | |/ /
| * | Issue #19036: Including locale.h should not depend on HAVE_LANGINFO_H.Stefan Krah2014-01-201-1/+2
| | |
* | | (Merge 3.3) fileutils.c: use MAXPATHLEN instead of PATH_MAXVictor Stinner2013-11-151-6/+6
|\ \ \ | |/ / | | | | | | PATH_MAX is not declared on IRIX nor Windows.
| * | fileutils.c: use MAXPATHLEN instead of PATH_MAXVictor Stinner2013-11-151-6/+6
| | | | | | | | | | | | PATH_MAX is not declared on IRIX nor Windows.
| * | (Merge 3.2) Issue #16455: On FreeBSD and Solaris, if the locale is C, theVictor Stinner2013-01-031-23/+217
| |\ \ | | |/ | | | | | | | | | | | | | | | ASCII/surrogateescape codec is now used, instead of the locale encoding, to decode the command line arguments. This change fixes inconsistencies with os.fsencode() and os.fsdecode() because these operating systems announces an ASCII locale encoding, whereas the ISO-8859-1 encoding is used in practice.
| | * Issue #16455: On FreeBSD and Solaris, if the locale is C, theVictor Stinner2013-01-031-23/+222
| | | | | | | | | | | | | | | | | | | | | ASCII/surrogateescape codec is now used, instead of the locale encoding, to decode the command line arguments. This change fixes inconsistencies with os.fsencode() and os.fsdecode() because these operating systems announces an ASCII locale encoding, whereas the ISO-8859-1 encoding is used in practice.
| | * Issue #16416: Fix compilation errorVictor Stinner2012-12-031-1/+3
| | |
| * | (Merge 3.2) Issue #16416: On Mac OS X, operating system data are now alwaysVictor Stinner2012-12-031-6/+54
| |\ \ | | |/ | | | | | | | | | | | | | | | encoded/decoded to/from UTF-8/surrogateescape, instead of the locale encoding (which may be ASCII if no locale environment variable is set), to avoid inconsistencies with os.fsencode() and os.fsdecode() functions which are already using UTF-8/surrogateescape.
| | * Issue #16416: On Mac OS X, operating system data are now alwaysVictor Stinner2012-12-031-6/+54
| | | | | | | | | | | | | | | | | | | | | encoded/decoded to/from UTF-8/surrogateescape, instead of the locale encoding (which may be ASCII if no locale environment variable is set), to avoid inconsistencies with os.fsencode() and os.fsdecode() functions which are already using UTF-8/surrogateescape.
* | | Add unused third arg for the benefit of Valgrind.Stefan Krah2013-11-141-1/+1
| | |
* | | Don't export internal symbols ("make smelly")Antoine Pitrou2013-10-121-1/+1
| | |
* | | Close #18954: Fix some typo in fileutils.c commentsVictor Stinner2013-09-071-3/+3
| | | | | | | | | | | | Patch written by Vajrasky Kok.
* | | Issue #18571: Implementation of the PEP 446: file descriptors and file handlesVictor Stinner2013-08-271-13/+328
| | | | | | | | | | | | | | | are now created non-inheritable; add functions os.get/set_inheritable(), os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
* | | Issue #18203: Fix decode_ascii_surrogateescape(), use PyMem_RawMalloc() as ↵Victor Stinner2013-07-071-1/+1
| | | | | | | | | | | | _Py_char2wchar()
* | | Issue #18203: Replace malloc() with PyMem_RawMalloc() at Python initializationVictor Stinner2013-07-071-11/+11
| | | | | | | | | | | | | | | | | | | | | * Replace malloc() with PyMem_RawMalloc() * Replace PyMem_Malloc() with PyMem_RawMalloc() where the GIL is not held. * _Py_char2wchar() now returns a buffer allocated by PyMem_RawMalloc(), instead of PyMem_Malloc()
* | | If MS_WIN64 is defined, MS_WINDOWS is also defined: #ifdef can be simplified.Victor Stinner2013-06-241-2/+2
| | |
* | | Issue #9566: Fix compiler warning on Windows 64-bitVictor Stinner2013-06-041-1/+2
| | |
* | | Fix a compiler warning: in and out are unused in _Py_char2wchar() ifVictor Stinner2013-05-071-1/+1
| | | | | | | | | | | | HAVE_MBRTOWC is not defined
* | | thinkoPhilip Jenvey2013-01-151-1/+1
| | |
* | | Issue #16455: On FreeBSD and Solaris, if the locale is C, theVictor Stinner2012-12-041-23/+217
| | | | | | | | | | | | | | | | | | | | | ASCII/surrogateescape codec is now used, instead of the locale encoding, to decode the command line arguments. This change fixes inconsistencies with os.fsencode() and os.fsdecode() because these operating systems announces an ASCII locale encoding, whereas the ISO-8859-1 encoding is used in practice.
* | | Issue #16416: Fix error handling in _Py_wchar2char() _Py_char2wchar() functionsVictor Stinner2012-11-121-11/+16
| | |
* | | Issue #16416: OS data are now always encoded/decoded to/fromVictor Stinner2012-11-121-2/+45
| | | | | | | | | | | | | | | | | | | | | UTF-8/surrogateescape, instead of the locale encoding (which may be ASCII if no locale environment variable is set), to avoid inconsistencies with os.fsencode() and os.fsdecode() functions which are already using UTF-8/surrogateescape.
* | | Merge 3.3.Stefan Krah2012-11-121-0/+1
|\ \ \ | |/ /
| * | Issue #15835: Define PATH_MAX on HP-UX.Stefan Krah2012-11-121-0/+1
| | |
* | | Issue #16330: Use surrogate-related macrosVictor Stinner2012-10-301-2/+2
|/ / | | | | | | Patch written by Serhiy Storchaka.
* | Issue #14153 Create _Py_device_encoding() to prevent _io from having to importBrett Cannon2012-02-291-0/+34
| | | | | | | | the os module.
* | Issue #13626: Add support for SSL Diffie-Hellman key exchange, through theAntoine Pitrou2011-12-221-0/+6
| | | | | | | | SSLContext.load_dh_params() method and the ssl.OP_SINGLE_DH_USE option.
* | _Py_fopen now allows bytes filenames under non-Windows platforms.Antoine Pitrou2011-12-191-2/+2
| |
* | import.c now catchs _Py_stat() exceptionsVictor Stinner2011-12-181-4/+4
| | | | | | | | _Py_stat() now returns -2 if an exception was raised.
* | Add PyUnicode_DecodeLocaleAndSize() and PyUnicode_DecodeLocale()Victor Stinner2011-12-161-9/+16
| | | | | | | | | | | | | | | | | | | | | | * PyUnicode_DecodeLocaleAndSize() and PyUnicode_DecodeLocale() decode a string from the current locale encoding * _Py_char2wchar() writes an "error code" in the size argument to indicate if the function failed because of memory allocation failure or because of a decoding error. The function doesn't write the error message directly to stderr. * Fix time.strftime() (if wcsftime() is missing): decode strftime() result from the current locale encoding, not from the filesystem encoding.
* | Catch PyUnicode_AS_UNICODE() errors in fileutils.cVictor Stinner2011-11-161-2/+11
|/
* _Py_char2wchar() frees the memory on conversion errorVictor Stinner2010-11-081-2/+7
| | | | Explain in the documentation that conversion errors should never happen.