summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* merge 3.5 (#25131)Benjamin Peterson2015-09-261-4/+10
|\
| * make opening brace of container literals and comprehensions correspond to ↵Benjamin Peterson2015-09-261-4/+10
| | | | | | | | the line number and col offset of the AST node (closes #25131)
| * Issue #25155: Fix _PyTime_Divide() roundingVictor Stinner2015-09-181-3/+8
| | | | | | | | | | _PyTime_Divide() rounding was wrong: copy code from Python default which has now much better unit tests.
| * Issue #25155: Add _PyTime_AsTimevalTime_t() functionVictor Stinner2015-09-181-38/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows, the tv_sec field of the timeval structure has the type C long, whereas it has the type C time_t on all other platforms. A C long has a size of 32 bits (signed inter, 1 bit for the sign, 31 bits for the value) which is not enough to store an Epoch timestamp after the year 2038. Add the _PyTime_AsTimevalTime_t() function written for datetime.datetime.now(): convert a _PyTime_t timestamp to a (secs, us) tuple where secs type is time_t. It allows to support dates after the year 2038 on Windows. Enhance also _PyTime_AsTimeval_impl() to detect overflow on the number of seconds when rounding the number of microseconds.
* | Issue #25186: Remove duplicated function from importlib._bootstrap_externalBrett Cannon2015-09-251-2497/+2480
| |
* | Fixed error creation if the problem is an empty expression in an f-string: ↵Eric V. Smith2015-09-241-6/+5
| | | | | | | | use ast_error instead of PyErr_SetString.
* | Move f-string compilation of the expression earlier, before the conversion ↵Eric V. Smith2015-09-231-15/+51
| | | | | | | | character and format_spec are checked. This allows for error messages that more closely match what a user would expect.
* | Issue #24779: Remove unused rawmode parameter to unicode_decode.Eric V. Smith2015-09-211-6/+3
| |
* | Issue #24965: Implement PEP 498 "Literal String Interpolation". ↵Eric V. Smith2015-09-194-57/+1218
| | | | | | | | Documentation is still needed, I'll open an issue for that.
* | Issue #25003: On Solaris 11.3 or newer, os.urandom() now uses the getrandom()Victor Stinner2015-09-181-15/+34
| | | | | | | | | | | | function instead of the getentropy() function. The getentropy() function is blocking to generate very good quality entropy, os.urandom() doesn't need such high-quality entropy.
* | Issue #25155: Add _PyTime_AsTimevalTime_t() functionVictor Stinner2015-09-181-19/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows, the tv_sec field of the timeval structure has the type C long, whereas it has the type C time_t on all other platforms. A C long has a size of 32 bits (signed inter, 1 bit for the sign, 31 bits for the value) which is not enough to store an Epoch timestamp after the year 2038. Add the _PyTime_AsTimevalTime_t() function written for datetime.datetime.now(): convert a _PyTime_t timestamp to a (secs, us) tuple where secs type is time_t. It allows to support dates after the year 2038 on Windows. Enhance also _PyTime_AsTimeval_impl() to detect overflow on the number of seconds when rounding the number of microseconds.
* | Merge 3.5 (imp/_imp)Victor Stinner2015-09-181-3/+4
|\ \ | |/
| * Issue #25160: Fix import_init() comments and messagesVictor Stinner2015-09-181-3/+4
| | | | | | | | import_init() imports the "_imp" module, not the "imp" module.
* | merge 3.5 (#25060)Benjamin Peterson2015-09-112-2/+2
|\ \ | |/
| * compute stack effect of BUILD_MAP correctly (closes #25060)Benjamin Peterson2015-09-112-2/+2
| |
* | pytime: oops, fix typos on WindowsVictor Stinner2015-09-101-2/+2
| |
* | pytime: add _PyTime_check_mul_overflow() macro to avoid undefined behaviourVictor Stinner2015-09-101-11/+24
| | | | | | | | | | | | | | | | | | | | | | Overflow test in test_FromSecondsObject() fails on FreeBSD 10.0 buildbot which uses clang. clang implements more aggressive optimization which gives different result than GCC on undefined behaviours. Check if a multiplication will overflow, instead of checking if a multiplicatin had overflowed, to avoid undefined behaviour. Add also debug information if the test on overflow fails.
* | New try to fix test_time.test_AsSecondsDouble() on x86 buildbots.Victor Stinner2015-09-101-2/+7
| | | | | | | | Use volatile keyword in _PyTime_AsSecondsDouble()
* | Try to fix test_time.test_AsSecondsDouble() on "x86 Gentoo Non-Debug with X ↵Victor Stinner2015-09-101-3/+8
| | | | | | | | | | | | 3.x" buildbot Use volatile keyword in _PyTime_Round()
* | Fix test_time on WindowsVictor Stinner2015-09-101-20/+8
| | | | | | | | | | | | | | * Filter values which would overflow on conversion to the C long type (for timeval.tv_sec). * Adjust also the message of OverflowError on PyTime conversions * test_time: add debug information if a timestamp conversion fails
* | test_time: rewrite PyTime API rounding testsVictor Stinner2015-09-091-6/+10
| | | | | | | | | | | | | | | | | | | | Drop all hardcoded tests. Instead, reimplement each function in Python, usually using decimal.Decimal for the rounding mode. Add much more values to the dataset. Test various timestamp units from picroseconds to seconds, in integer and float. Enhance also _PyTime_AsSecondsDouble().
* | pytime: add _PyTime_Round() helper to factorize codeVictor Stinner2015-09-091-25/+20
| |
* | Make _PyTime_RoundHalfEven() private againVictor Stinner2015-09-091-1/+3
| |
* | Issue #23517: fromtimestamp() and utcfromtimestamp() methods ofVictor Stinner2015-09-081-42/+29
| | | | | | | | | | | | | | | | | | | | | | | | datetime.datetime now round microseconds to nearest with ties going to nearest even integer (ROUND_HALF_EVEN), as round(float), instead of rounding towards -Infinity (ROUND_FLOOR). pytime API: replace _PyTime_ROUND_HALF_UP with _PyTime_ROUND_HALF_EVEN. Fix also _PyTime_Divide() for negative numbers. _PyTime_AsTimeval_impl() now reuses _PyTime_Divide() instead of reimplementing rounding modes.
* | Merge from 3.5Steve Dower2015-09-071-2/+70
|\ \ | |/
| * Merge from 3.5.0 branch.Steve Dower2015-09-071-2/+70
| |\
| | * Issue #24305: Prevent import subsystem stack frames from being countedLarry Hastings2015-09-061-2/+70
| | | | | | | | | | | | by the warnings.warn(stacklevel=) parameter.
* | | Issue #15989: Fixed some scarcely probable integer overflows.Serhiy Storchaka2015-09-062-6/+6
| | | | | | | | | | | | It is very unlikely that they can occur in real code for now.
* | | Issue #23517: Fix implementation of the ROUND_HALF_UP rounding mode inVictor Stinner2015-09-041-4/+4
| | | | | | | | | | | | | | | datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp(). microseconds sign should be kept before rounding.
* | | Merge 3.5 (create_stdio)Victor Stinner2015-09-041-42/+37
|\ \ \ | |/ /
| * | Merge 3.4 (create_stdio)Victor Stinner2015-09-041-42/+37
| |\ \
| | * | Fix race condition in create_stdio()Victor Stinner2015-09-041-40/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #24891: Fix a race condition at Python startup if the file descriptor of stdin (0), stdout (1) or stderr (2) is closed while Python is creating sys.stdin, sys.stdout and sys.stderr objects. These attributes are now set to None if the creation of the object failed, instead of raising an OSError exception. Initial patch written by Marco Paolini.
| | * | Issue #24728: Fix building without threads.Berker Peksag2015-07-271-0/+4
| | | | | | | | | | | | | | | | Patch by Louis Dassy.
* | | | Don't abuse volatile keyword in pytime.cVictor Stinner2015-09-031-2/+4
| | | | | | | | | | | | | | | | | | | | Only use it on the most important number. This change fixes also a compiler warning on modf().
* | | | Enhance _PyTime_AsTimespec()Victor Stinner2015-09-031-3/+3
| | | | | | | | | | | | | | | | | | | | Ensure that the tv_nsec field is set, even if the function fails with an overflow.
* | | | Merge 3.5 (namereplace)Victor Stinner2015-09-031-7/+5
|\ \ \ \ | |/ / /
| * | | Issue #24993: Handle import error in namereplace error handlerVictor Stinner2015-09-031-7/+5
| | | | | | | | | | | | | | | | | | | | Handle PyCapsule_Import() failure (exception) in PyCodec_NameReplaceErrors(): return immedialty NULL.
* | | | Fix ast_for_atom()Victor Stinner2015-09-031-0/+1
| | | | | | | | | | | | | | | | | | | | Clear PyObject_Str() exception if it failed, ast_error() should not be called with an exception set.
* | | | Merge 3.5 (monotonic)Victor Stinner2015-09-021-13/+3
|\ \ \ \ | |/ / /
| * | | oops, rename pymonotonic_new() to pymonotonic()Victor Stinner2015-09-021-3/+3
| | | | | | | | | | | | | | | | | | | | I was not supposed to commit the function with the name pymonotonic_new(). I forgot to rename it.
| * | | Issue #24707: Remove assertion in monotonic clockVictor Stinner2015-09-021-10/+0
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | Don't check anymore at runtime that the monotonic clock doesn't go backward. Yes, it happens. It occurs sometimes each month on a Debian buildbot slave running in a VM. The problem is that Python cannot do anything useful if a monotonic clock goes backward. It was decided in the PEP 418 to not fix the system, but only expose the clock provided by the OS.
* | | Issue #23517: datetime.timedelta constructor now rounds microseconds to nearestVictor Stinner2015-09-021-2/+1
| | | | | | | | | | | | | | | | | | with ties going away from zero (ROUND_HALF_UP), as Python 2 and Python older than 3.3, instead of rounding to nearest with ties going to nearest even integer (ROUND_HALF_EVEN).
* | | Merge 3.5 (issue #24975)Yury Selivanov2015-09-021-2/+4
|\ \ \ | |/ /
| * | Issue #24975: Fix AST compilation for PEP 448 syntax.Yury Selivanov2015-09-011-2/+4
| | |
* | | Issue #23517: Try to fix test_time on "x86 Ubuntu Shared 3.x" buildbotVictor Stinner2015-09-021-7/+10
| | |
* | | Issue #23517: Fix _PyTime_ObjectToDenominator()Victor Stinner2015-09-021-18/+17
| | | | | | | | | | | | | | | * initialize numerator on overflow error ensure that numerator is smaller than * denominator.
* | | Issue #23517: Add "half up" rounding mode to the _PyTime APIVictor Stinner2015-09-011-10/+54
| | |
* | | Move assertion inside _PyTime_ObjectToTimeval()Victor Stinner2015-09-011-6/+14
| | | | | | | | | | | | | | | Change also _PyTime_FromSeconds() assertion to ensure that the _PyTime_t type is used.
* | | Refactor pytime.cVictor Stinner2015-09-011-48/+65
| | | | | | | | | | | | Move code to convert double timestamp to subfunctions.
* | | Merge from 3.5 (with 3.5.0rc2 changes) into default (3.6). Messy!Larry Hastings2015-08-253-25/+75
|\ \ \ | |/ /