- 11 Jun, 2018 5 commits
-
-
Ned Deily authored
-
Ned Deily authored
-
Ned Deily authored
-
Ned Deily authored
-
Steve Weber authored
Before Python 3.6, os.path.abspath(None) used to report an AttributeError which was properly caught inside site.abs_paths, making it ignore __main__, one of sys.modules, which has __file__ and __cached__ set to None. With 3.6, os.path.abspath(None) raises TypeError instead which site.abs_path was not expecting. This resulted in an uncaught exception if a user had PYTHONSTARTUP set and the application called site.main() which a number of third-party programs do.
-
- 10 Jun, 2018 12 commits
-
-
Christian Tismer authored
-
Alexander Belopolsky authored
A datetime object d is aware if d.tzinfo is not None and d.tzinfo.utcoffset(d) does not return None. If d.tzinfo is None, or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns None, d is naive. This commit ensures that instances with non-None d.tzinfo, but d.tzinfo.utcoffset(d) returning None are treated as naive. In addition, C acceleration code will raise TypeError if d.tzinfo.utcoffset(d) returns an object with the type other than timedelta. * Updated the documentation. Assume that the term "naive" is defined elsewhere and remove the not entirely correct clarification. Thanks, Tim.
-
Terry Jan Reedy authored
Users can now click on context lines.
-
Terry Jan Reedy authored
-
Terry Jan Reedy authored
-
Terry Jan Reedy authored
-
Zackery Spytz authored
This call became unneeded after the posix module was converted to the Argument Clinic in 2f93635d and should have been removed as part of that change.
-
Tal Einat authored
-
Tal Einat authored
-
Serhiy Storchaka authored
Seems they were added by double applying blurb.
-
Andrés Delfino authored
-
Andrés Delfino authored
-
- 09 Jun, 2018 7 commits
-
-
Ammar Askar authored
-
MarcoFalke authored
This is a fixup to 19a44f63
-
Ned Deily authored
-
Christian Tismer authored
During development of the limited API support for PySide, we saw an error in a macro that accessed a type field. This patch fixes the 7 errors in the Python headers. Macros which were not written as capitals were implemented as function. To do the necessary analysis again, a script was included that parses all headers and looks for "->tp_" in serctions which can be reached with active limited API. It is easily possible to call this script as a test. Error listing: ../../Include/objimpl.h:243 #define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \ (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o))) Action: commented only ../../Include/objimpl.h:362 #define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0) Action: commented only ../../Include/objimpl.h:364 #define PyObject_GET_WEAKREFS_LISTPTR(o) \ ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset)) Action: commented only ../../Include/pyerrors.h:143 #define PyExceptionClass_Name(x) \ ((char *)(((PyTypeObject*)(x))->tp_name)) Action: implemented function ../../Include/abstract.h:593 #define PyIter_Check(obj) \ ((obj)->ob_type->tp_iternext != NULL && \ (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) Action: implemented function ../../Include/abstract.h:713 #define PyIndex_Check(obj) \ ((obj)->ob_type->tp_as_number != NULL && \ (obj)->ob_type->tp_as_number->nb_index != NULL) Action: implemented function ../../Include/abstract.h:924 #define PySequence_ITEM(o, i)\ ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) ) Action: commented only
-
Zackery Spytz authored
_Py_IDENTIFIER(argv) is now unused.
-
Nick Coghlan authored
While locale coercion and UTF-8 mode turned out to be complementary ideas rather than competing ones, it isn't immediately obvious why it's useful to have both, or how they interact at runtime. This updates both the Python 3.7 What's New doc and the PYTHONCOERCECLOCALE and PYTHONUTF8 documentation in an attempt to clarify that relationship: - in the respective What's New sections, add a closing paragraph explaining which problem each one solves, and pointing to the other PEP's section for the specific aspects it relies on the other PEP to solve - use "locale-aware mode" as a more descriptive term for the default non-UTF-8 mode - improve wording conistenccy between the PYTHONCOERCECLOCALE and PYTHONUTF8 docs when they cover the same thing (mostly related to legacy locale detection and setting the standard stream error handler) - improve the description of the locale coercion trigger conditions (including pointing out that setting LC_ALL turns off locale coercion) - port the full description of the UTF-8 mode behaviour changes from PEP 540 into the PYTHONUTF8 documentation - be explicit that PYTHONIOENCODING still overrides the settings for the standard streams - mention concrete examples of things that do and don't get their text encoding assumptions adjusted by the two text encoding assumption override techniques
-
Andrés Delfino authored
-
- 08 Jun, 2018 16 commits
-
-
Alexander Belopolsky authored
Since implementation of bpo-25283, the objects returned by time.localtime always have tm_zone and tm_gmtoff attributes. Remove code that anticipates their absence.
-
Alexander Belopolsky authored
* Added a test case for strftime("%z"). The added test checks a case with UTC offest expressed in an integer number of seconds. * Added a test comparing naive and aware datetimes. Check that a greater than comparison of a naive datetime instance with an aware one raises a TypeError. * Test datetime in fold or in gap comparison both ways.
-
Yury Selivanov authored
Supersedes https://github.com/python/cpython/pull/2490
-
Andrés Delfino authored
-
Thomas Kluyver authored
More consistent with how other parts of Python find the filename (e.g. tracebacks and pdb).
-
Andrés Delfino authored
-
Dong-hee Na authored
-
Suriyaa ✌️️ authored
-
Elvis Pranskevichus authored
-
Andrés Delfino authored
-
Łukasz Langa authored
This solves a regression in logging config due to changes in BPO-23835.
-
wim glenn authored
- bugfix and test for fragile metavar handling in argparse (see bpo-24089, bpo-14046, bpo-25058, bpo-11874) - also fixes some incorrect tests that did not make 1-element tuples correctly
-
Victor Stinner authored
_feed_data_to_bufferred_proto() renamed to _feed_data_to_buffered_proto() ("bufferred" => "buffered"). Typo spotted by Nathaniel J. Smith.
-
Victor Stinner authored
If tests are re-run, use "xxx then yyy" result format (ex: "FAILURE then SUCCESS") to show that some failing tests have been re-run. Add also test_regrtest.test_rerun_fail() test.
-
Andrés Delfino authored
-
Terry Jan Reedy authored
-