summaryrefslogtreecommitdiffstats
path: root/Misc
Commit message (Collapse)AuthorAgeFilesLines
* bpo-34523: Py_DecodeLocale() use UTF-8 on Windows (GH-8998)Victor Stinner2018-08-291-0/+2
| | | | | | | Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 encoding on Windows if Py_LegacyWindowsFSEncodingFlag is zero. pymain_read_conf() now sets Py_LegacyWindowsFSEncodingFlag in its loop, but restore its value at exit.
* bpo-34523: Add _PyCoreConfig.filesystem_encoding (GH-8963)Victor Stinner2018-08-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | _PyCoreConfig_Read() is now responsible to choose the filesystem encoding and error handler. Using Py_Main(), the encoding is now chosen even before calling Py_Initialize(). _PyCoreConfig.filesystem_encoding is now the reference, instead of Py_FileSystemDefaultEncoding, for the Python filesystem encoding. Changes: * Add filesystem_encoding and filesystem_errors to _PyCoreConfig * _PyCoreConfig_Read() now reads the locale encoding for the file system encoding. * PyUnicode_EncodeFSDefault() and PyUnicode_DecodeFSDefaultAndSize() now use the interpreter configuration rather than Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors global configuration variables. * Add _Py_SetFileSystemEncoding() and _Py_ClearFileSystemEncoding() private functions to only modify Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors in coreconfig.c. * _Py_CoerceLegacyLocale() now takes an int rather than _PyCoreConfig for the warning.
* bpo-34485, Windows: LC_CTYPE set to user preference (GH-8988)Victor Stinner2018-08-291-0/+3
| | | | | | | | | | | | | | On Windows, the LC_CTYPE is now set to the user preferred locale at startup: _Py_SetLocaleFromEnv(LC_CTYPE) is now called during the Python initialization. Previously, the LC_CTYPE locale was "C" at startup, but changed when calling setlocale(LC_CTYPE, "") or setlocale(LC_ALL, ""). pymain_read_conf() now also calls _Py_SetLocaleFromEnv(LC_CTYPE) to behave as _Py_InitializeCore(). Moreover, it doesn't save/restore the LC_ALL anymore. On Windows, standard streams like sys.stdout now always use surrogateescape error handler by default (ignore the locale).
* bpo-34485: stdout uses surrogateescape on POSIX locale (GH-8986)Victor Stinner2018-08-291-0/+3
| | | | | | | Standard streams like sys.stdout now use the "surrogateescape" error handler, instead of "strict", on the POSIX locale (when the C locale is not coerced and the UTF-8 Mode is disabled). Add tests on sys.stdout.errors with LC_ALL=POSIX.
* bpo-34485: Enhance init_sys_streams() (GH-8978)Victor Stinner2018-08-282-0/+8
| | | | | | | | | | | | | | | Python now gets the locale encoding with C code to initialize the encoding of standard streams like sys.stdout. Moreover, the encoding is now initialized to the Python codec name to get a normalized encoding name and to ensure that the codec is loaded. The change avoids importing _bootlocale and _locale modules at startup by default. When the PYTHONIOENCODING environment variable only contains an encoding, the error handler is now is now set explicitly to "strict". Rename also get_default_standard_stream_error_handler() to get_stdio_errors(). Reduce the buffer to format the "cpXXX" string (Windows locale encoding).
* bpo-34403: On HP-UX, force ASCII for C locale (GH-8969)Victor Stinner2018-08-281-0/+3
| | | | | | | | On HP-UX with C or POSIX locale, sys.getfilesystemencoding() now returns "ascii" instead of "roman8" (when the UTF-8 Mode is disabled and the C locale is not coerced). nl_langinfo(CODESET) announces "roman8" whereas it uses the Latin1 encoding in practice.
* bpo-34527: POSIX locale enables the UTF-8 Mode (GH-8972)Victor Stinner2018-08-282-0/+5
| | | | | | | | | | * The UTF-8 Mode is now also enabled by the "POSIX" locale, not only by the "C" locale. * On FreeBSD, Py_DecodeLocale() and Py_EncodeLocale() now also forces the ASCII encoding if the LC_CTYPE locale is "POSIX", not only if the LC_CTYPE locale is "C". * test_utf8_mode.test_cmd_line() checks also that the command line arguments are decoded from UTF-8 when the the UTF-8 Mode is enabled with POSIX locale or C locale.
* bpo-21145: Add cached_property decorator in functools (#6982)Carl Meyer2018-08-281-0/+2
| | | | | | Robust caching of calculated properties is harder than it looks at first glance, so add a solid, well-tested implementation to the standard library.
* bpo-33635: Handling Bad file descriptor in Path.is_file and related. (GH-8542)Przemysław Spodymek2018-08-271-0/+5
|
* bpo-34347: Fix test_utf8_mode.test_cmd_line for AIX (GH-8923)Michael Felt2018-08-271-0/+1
| | | AIX uses ISO-8859-1 encoding for the C locale.
* bpo-32968: Make modulo and floor division involving Fraction and float ↵Elias Zamaria2018-08-272-0/+2
| | | | | | | consistent with other operations (#5956) Make mixed-type `%` and `//` operations involving `Fraction` and `float` objects behave like all other mixed-type arithmetic operations: first the `Fraction` object is converted to a `float`, then the `float` operation is performed as normal. This fixes some surprising corner cases, like `Fraction('1/3') % inf` giving a NaN. Thanks Elias Zamaria for the patch.
* Remove AIX workaround test_subprocess (GH-8939)Michael Felt2018-08-261-0/+1
| | | | An old apparent AIX behavior workaround in test_subprocess's test_undecodable_env is no longer needed.
* bpo-34171: Prevent creating Lib/trace.cover when run the trace module. (GH-8841)Serhiy Storchaka2018-08-251-0/+1
|
* bpo-34426: fix typo (__lltrace__ -> __ltrace__) (GH-8822)Danish Prakash2018-08-251-1/+1
|
* bpo-13312: Avoid int underflow in time year. (GH-8912)Gregory P. Smith2018-08-251-0/+2
| | | Avoids an integer underflow in the time module's year handling code.
* bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks ↵Vladimir Matveev2018-08-241-0/+2
| | | | (GH-8864)
* bpo-34454: fix .fromisoformat() methods crashing on inputs with surrogate ↵Paul Ganssle2018-08-231-0/+4
| | | | | | | | | | | | | | | | | | | | code points (GH-8862) The current C implementations **crash** if the input includes a surrogate Unicode code point, which is not possible to encode in UTF-8. Important notes: 1. It is possible to pass a non-UTF-8 string as a separator to the `.isoformat()` methods. 2. The pure-Python `datetime.fromisoformat()` implementation accepts strings with a surrogate as the separator. In `datetime.fromisoformat()`, in the special case of non-UTF-8 separators, this implementation will take a performance hit by making a copy of the input string and replacing the separator with 'T'. Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru> Co-authored-by: Paul Ganssle <paul@ganssle.io>
* bpo-34412: Make signal.strsignal() work on HP-UX (GH-8786)Michael Osipov2018-08-231-0/+1
| | | | | | Introduce a configure check for strsignal(3) which defines HAVE_STRSIGNAL for signalmodule.c. Add some common signals on HP-UX. This change applies for Windows and HP-UX.
* bpo-2122: Make mmap.flush() behave same on all platforms (GH-8692)Berker Peksag2018-08-221-0/+2
| | | | | Previously, its behavior was platform-dependent and there was no error checking under Windows.
* bpo-34441: Fix ABC.__subclasscheck__ crash on classes with invalid ↵Alexey Izbyshev2018-08-201-0/+3
| | | | | | __subclasses__ (GH-8835) The missing NULL check was reported by Svace static analyzer.
* bpo-34318: Convert deprecation warnings to errors in assertRaises() etc. ↵Serhiy Storchaka2018-08-191-0/+7
| | | | (GH-8623)
* bpo-22602: Raise an exception in the UTF-7 decoder for ill-formed sequences ↵Zackery Spytz2018-08-191-0/+3
| | | | | | | starting with "+". (GH-8741) The UTF-7 decoder now raises UnicodeDecodeError for ill-formed sequences starting with "+" (as specified in RFC 2152).
* Improve error message when mock.assert_has_calls fails (GH-8205)davidair2018-08-171-0/+1
| | | | | This makes the assertion error message more useful, aiding debugging. Thanks @davidair!
* bpo-34391: Fix ftplib test for TLS 1.3 (GH-8787)Christian Heimes2018-08-161-0/+1
| | | | | | | | | | | | Read from data socket to avoid "[SSL] shutdown while in init" exception during shutdown of the dummy server. Signed-off-by: Christian Heimes <christian@python.org> <!-- issue-number: [bpo-34391](https://www.bugs.python.org/issue34391) --> https://bugs.python.org/issue34391 <!-- /issue-number -->
* bpo-34405: Updated to OpenSSL 1.1.0i for Windows builds. (GH-8775)Steve Dower2018-08-151-0/+1
|
* bpo-34384: Fix os.readlink() on Windows (GH-8740)Berker Peksag2018-08-151-0/+2
| | | | | | | | | os.readlink() now accepts path-like and bytes objects on Windows. Previously, support for path-like and bytes objects was only implemented on Unix. This commit also merges Unix and Windows implementations of os.readlink() in one function and adds basic unit tests to increase test coverage of the function.
* closes bpo-34400: Fix undefined behavior in parsetok(). (GH-4439)Zackery Spytz2018-08-151-0/+1
| | | Avoid undefined pointer arithmetic with NULL.
* bpo-34399: 2048 bits RSA keys and DH params (#8762)Christian Heimes2018-08-141-0/+1
| | | | | | | | | | Downstream vendors have started to deprecate weak keys. Update all RSA keys and DH params to use at least 2048 bits. Finite field DH param file use RFC 7919 values, generated with certtool --get-dh-params --sec-param=high Signed-off-by: Christian Heimes <christian@python.org>
* bpo-34213: Allow dataclasses to work with a field named 'object'. (GH-8452)Vadim Pushtaev2018-08-121-0/+1
|
* bpo-34151: Improve performance of some list operations (GH-8332)Sergey Fedoseev2018-08-111-0/+2
|
* closes bpo-34377: Update Valgrind suppressions. (GH-8729)Paul Price2018-08-112-11/+14
| | | Valgrind isn't seeing PyObject_Free/PyObject_Realloc, but using _PyObject_Free/_PyObject_Realloc works.
* bpo-9372: Deprecate several __getitem__ methods (GH-8609)Berker Peksag2018-08-111-0/+3
| | | | | | The __getitem__ methods of DOMEventStream, FileInput, and FileWrapper classes ignore their 'index' parameters and return the next item instead.
* bpo-34333: Fix %-formatting in Path.with_suffix() (GH-8663)Berker Peksag2018-08-111-0/+2
|
* bpo-34047: IDLE: fix mousewheel scrolling direction on macOS (GH-8678)Tal Einat2018-08-101-0/+1
|
* closes bpo-34353: Add sockets to stat.filemode fallback python ↵GPery2018-08-101-0/+2
| | | | | | implementation. (GH-8703)
* bpo-34270: Make it possible to name asyncio tasks (GH-8547)Alex Grönholm2018-08-082-0/+10
| | | Co-authored-by: Antti Haapala <antti.haapala@anttipatterns.com>
* bpo-18540: Fix EAI_NONAME in imaplib.IMAP4*() (GH-8634)Berker Peksag2018-08-071-0/+3
|
* bpo-19891: Ignore error while writing history file (GH-8483)Anthony Sottile2018-08-061-0/+2
|
* bpo-33839: refactor IDLE's tooltips & calltips, add docstrings and tests ↵Tal Einat2018-08-051-0/+1
| | | | | | | | (GH-7683) * make CallTip and ToolTip sub-classes of a common abstract base class * remove ListboxToolTip (unused and ugly) * greatly increase test coverage * tested on Windows, Linux and macOS
* bpo-34275: Make IDLE calltips always visible on Mac. (GH-8639)Terry Jan Reedy2018-08-031-0/+2
| | | | | | Some MacOS-tk combinations need .update_idletasks(). The call is both unneeded and innocuous on Linux and Windows. Patch by Kevin Waltzer.
* bpo-34097: Add support for zipping files older than 1980-01-01 (GH-8270)Marcel Plch2018-08-021-0/+3
| | | | | ZipFile can zip files older than 1980-01-01 and newer than 2107-12-31 using a new strict_timestamps parameter at the cost of setting the timestamp to the limit.
* bpo-34120: fix IDLE freezing after closing dialogs (GH-8603)Tal Einat2018-08-021-0/+1
| | | | Added missing .grab_release() calls to all places where we call .grab_set().
* bpo-34113: Fix a crash when using LLTRACE is on (GH-8517)costypetrisor2018-07-311-0/+2
| | | Fix a crash on negative STACKADJ() when Low-Level trace (LLTRACE) is enabled.
* bpo-34263 Cap timeout submitted to epoll/select etc. to one day. (GH-8532)MartinAltmayer2018-07-311-0/+2
|
* bpo-33089: Add math.dist() for computing the Euclidean distance between two ↵Raymond Hettinger2018-07-311-0/+1
| | | | points (GH-8561)
* bpo-33871: Fix os.sendfile(), os.writev(), os.readv(), etc. (GH-7931)Serhiy Storchaka2018-07-312-0/+6
| | | | | | | | | | | | * Fix integer overflow in os.readv(), os.writev(), os.preadv() and os.pwritev() and in os.sendfile() with headers or trailers arguments (on BSD-based OSes and MacOS). * Fix sending the part of the file in os.sendfile() on MacOS. Using the trailers argument could cause sending more bytes from the input file than was specified. Thanks Ned Deily for testing on 32-bit MacOS.
* bpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346)Serhiy Storchaka2018-07-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | * help(hashlib) didn't work because of incorrect module name in blake2b and blake2s classes. * Constructors blake2*(), sha3_*(), shake_*() and keccak_*() incorrectly accepted keyword argument "string" for binary data, but documented as accepting the "data" keyword argument. Now this parameter is positional-only. * Keyword-only parameters in blake2b() and blake2s() were not documented as keyword-only. * Default value for some parameters of blake2b() and blake2s() was None, which is not acceptable value. * The length argument for shake_*.digest() was wrapped out to 32 bits. * The argument for shake_128.digest() and shake_128.hexdigest() was not positional-only as intended. * TypeError messages for incorrect arguments in all constructors sha3_*(), shake_*() and keccak_*() incorrectly referred to sha3_224. Also made the following enhancements: * More accurately specified input and result types for strings, bytes and bytes-like objects. * Unified positional parameter names for update() and constructors. * Improved formatting.
* Revert "closes bpo-27494: Fix 2to3 handling of trailing comma after a ↵Serhiy Storchaka2018-07-311-0/+2
| | | | | | | | generator expression (GH-3771)" (#8241) This reverts commit af810b35b494ef1d255d4bf340b92a9dad446995. This is not valid syntax (see bpo-32012).
* bpo-1617161: Make the hash and equality of methods not depending on the ↵Serhiy Storchaka2018-07-311-0/+7
| | | | | | | | | | | value of self. (GH-7848) * The hash of BuiltinMethodType instances no longer depends on the hash of __self__. It depends now on the hash of id(__self__). * The hash and equality of ModuleType and MethodWrapperType instances no longer depend on the hash and equality of __self__. They depend now on the hash and equality of id(__self__). * MethodWrapperType instances no longer support ordering.
* bpo-33833: Fix ProactorSocketTransport AssertionError (#7893)twisteroid ambassador2018-07-301-0/+2
|