summaryrefslogtreecommitdiff
path: root/Python/fileutils.c
AgeCommit message (Collapse)AuthorLines
2014-01-20Issue #19036: Including locale.h should not depend on HAVE_LANGINFO_H.Stefan Krah-1/+2
2013-11-15fileutils.c: use MAXPATHLEN instead of PATH_MAXVictor Stinner-6/+6
PATH_MAX is not declared on IRIX nor Windows.
2013-01-03(Merge 3.2) Issue #16455: On FreeBSD and Solaris, if the locale is C, theVictor Stinner-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.
2013-01-03Issue #16455: On FreeBSD and Solaris, if the locale is C, theVictor Stinner-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.
2012-12-03Issue #16416: Fix compilation errorVictor Stinner-1/+3
2012-12-03(Merge 3.2) Issue #16416: On Mac OS X, operating system data are now alwaysVictor Stinner-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.
2012-12-03Issue #16416: On Mac OS X, operating system data are now alwaysVictor Stinner-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.
2012-11-12Issue #15835: Define PATH_MAX on HP-UX.Stefan Krah-0/+1
2012-02-29Issue #14153 Create _Py_device_encoding() to prevent _io from having to importBrett Cannon-0/+34
the os module.
2011-12-22Issue #13626: Add support for SSL Diffie-Hellman key exchange, through theAntoine Pitrou-0/+6
SSLContext.load_dh_params() method and the ssl.OP_SINGLE_DH_USE option.
2011-12-19_Py_fopen now allows bytes filenames under non-Windows platforms.Antoine Pitrou-2/+2
2011-12-18import.c now catchs _Py_stat() exceptionsVictor Stinner-4/+4
_Py_stat() now returns -2 if an exception was raised.
2011-12-16Add PyUnicode_DecodeLocaleAndSize() and PyUnicode_DecodeLocale()Victor Stinner-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.
2011-11-17Catch PyUnicode_AS_UNICODE() errors in fileutils.cVictor Stinner-2/+11
2010-11-08_Py_char2wchar() frees the memory on conversion errorVictor Stinner-2/+7
Explain in the documentation that conversion errors should never happen.
2010-11-08PyUnicode_EncodeFS() raises an exception if _Py_wchar2char() failsVictor Stinner-6/+14
* Add error_pos optional argument to _Py_wchar2char() * PyUnicode_EncodeFS() raises a UnicodeEncodeError or MemoryError if _Py_wchar2char() fails
2010-10-16Add an optional size argument to _Py_char2wchar()Victor Stinner-11/+16
_Py_char2wchar() callers usually need the result size in characters. Since it's trivial to compute it in _Py_char2wchar() (O(1) whereas wcslen() is O(n)), add an option to get it.
2010-10-16_Py_wrealpath() uses _Py_char2wchar() to decode the result, to supportVictor Stinner-2/+12
surrogate characters.
2010-10-16_Py_wreadlink(): catch _Py_char2wchar() failureVictor Stinner-0/+4
2010-10-16_Py_wreadlink() uses _Py_char2wchar() to decode the result, to supportVictor Stinner-2/+7
surrogate characters.
2010-10-15Mark _Py_char2wchar() input argument as constantVictor Stinner-1/+1
2010-10-14_Py_wgetcwd() decodes the path using _Py_char2wchar() to support surrogatesVictor Stinner-3/+11
2010-10-07fileutils.c: document which encodings are usedVictor Stinner-6/+26
2010-10-07_Py_wrealpath() requires the size of the output bufferVictor Stinner-2/+3
2010-10-07_Py_stat() and _Py_fopen(): avoid PyUnicode_AsWideCharString() on WindowsVictor Stinner-18/+6
On Windows, Py_UNICODE is wchar_t, so we can avoid the expensive Py_UNICODE* => wchar_t* conversion.
2010-10-07Fix fileutils for WindowsVictor Stinner-8/+7
* Don't define _Py_wstat() on Windows, Windows has its own _wstat() function with a different API (the stat buffer has another type) * Include windows.h
2010-10-07Ooops, fileutils.c contains twice the same codeVictor Stinner-380/+0
I suppose that I reapplied my local patch creating Python/fileutils.c whereas the file already existed.
2010-10-07Create fileutils.c/.hVictor Stinner-0/+758
* _Py_fopen() and _Py_stat() come from Python/import.c * (_Py)_wrealpath() comes from Python/sysmodule.c * _Py_char2wchar(), _Py_wchar2char() and _Py_wfopen() come from Modules/main.c * (_Py)_wstat(), (_Py)_wgetcwd(), _Py_wreadlink() come from Modules/getpath.c