| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
2. (GH-11017) (GH-11022) (GH-11024)
encoding='latin1' should be used for successful decoding.
(cherry picked from commit 8452ca15f41061c8a6297d7956df22ab476d4df4)
(cherry picked from commit 0d5730e6437b157f4aeaf5d2e67abca23448c29a)
|
|
|
|
|
|
|
|
| |
(GH-2385) (GH-8498)
On Windows, passing a negative value to local results in an OSError because localtime_s on Windows does not support negative timestamps. Unfortunately this means that fold detection for timestamps between 0 and max_fold_seconds will result in this OSError since we subtract max_fold_seconds from the timestamp to detect a fold. However, since we know there haven't been any folds in the interval [0, max_fold_seconds) in any timezone, we can hackily just forego fold detection for this time range on Windows..
(cherry picked from commit 96d1e69a12ed8ab80203277e1abdaf573457a964)
Co-authored-by: Ammar Askar <ammar_askar@hotmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
(cherry picked from commit 877b23202b7e7d4f57b58504fd0eb886e8c0b377)
Co-authored-by: Alexander Belopolsky <abalkin@users.noreply.github.com>
|
|
|
|
|
| |
Python (GH-4176) (#4356)
(cherry picked from commit 191e993365ac3206f46132dcf46236471ec54bfa)
|
|
|
|
|
|
|
|
|
|
|
|
| |
* [3.6] bpo-30822: Fix testing of datetime module. (GH-2530) (GH-2783)
Only C implementation was tested.
(cherry picked from commit 287c5594edc1ca08db64d1f4739cc36bfe75ae75)
* [3.6] bpo-30822: Fix testing of datetime module. (GH-2530) (GH-2783)
Only C implementation was tested..
(cherry picked from commit 287c5594edc1ca08db64d1f4739cc36bfe75ae75)
|
|
|
|
|
| |
The default value of fold is zero, not True. Fix the docstring of the Python
implementation.
|
| |
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| | |
Based on patch by Ville Skyttä.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Added an optional argument timespec to the datetime isoformat() method
to choose the precision of the time component.
Original patch by Alessandro Cucci.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| | |
referenced.
Permission was validated prior to adding these markings.
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
of datetime.datetime: microseconds are now rounded to nearest with ties going
to nearest even integer (ROUND_HALF_EVEN), instead of being rounding towards
zero (ROUND_DOWN). It's important that these methods use the same rounding
mode than datetime.timedelta to keep the property:
(datetime(1970,1,1) + timedelta(seconds=t)) == datetime.utcfromtimestamp(t)
It also the rounding mode used by round(float) for example.
Add more unit tests on the rounding mode in test_datetime.
|
| | |
| | |
| | |
| | | |
remove scories of round half up code and debug code.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
"""Issue #23517: datetime.timedelta constructor now rounds microseconds to
nearest 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)."""
datetime.timedelta uses rounding mode ROUND_HALF_EVEN again.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp().
microseconds sign should be kept before rounding.
|
| | |
| | |
| | |
| | |
| | |
| | | |
datetime.datetime now round microseconds to nearest with ties going away from
zero (ROUND_HALF_UP), as Python 2 and Python older than 3.3, instead of
rounding towards -Infinity (ROUND_FLOOR).
|
|/ /
| |
| |
| |
| |
| | |
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).
|
|\ \
| |/
| |
| |
| | |
Fixed 2 to 3 porting bug in pynche.ColorDB.
Added few tests for __truediv__, __floordiv__ and __matmul__.
|
| |
| |
| |
| | |
Fixed 2 to 3 porting bug in pynche.ColorDB.
|
| |
| |
| |
| | |
Original patch by Akira Li.
|
|\ \
| |/
| |
| |
| | |
* Eliminated OverflowError from timedelta * float for some floats;
* Corrected rounding in timedlta true division.
|
| |
| |
| |
| |
| | |
* Eliminated OverflowError from timedelta * float for some floats;
* Corrected rounding in timedlta true division.
|
| |
| |
| |
| | |
implementation in issue #21408 they are redundant.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch brings the pure-python datetime more in-line with the C
module. Patch contributed by Brian Kearns, a PyPy developer. PyPy
project has been running these modifications in PyPy2 stdlib.
This commit includes:
- General PEP8/cleanups;
- Better testing of argument types passed to constructors;
- Removal of duplicate operations;
- Optimization of timedelta creation;
- Caching the result of __hash__ like the C accelerator;
- Enhancements/bug fixes in tests.
|
| |
| |
| |
| | |
class name instead of hardcoded one.
|
|/ |
|
| |
|
| |
|
|\
| |
| |
| | |
error messages and comments.
|
| |
| |
| |
| | |
error messages and comments.
|
|\ \
| |/ |
|
| | |
|
| | |
|
| |
| |
| |
| | |
ModuleNotFoundError.
|
|\ \
| |/ |
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
|
| |
timezone instance corresponding to the system local timezone when
called with no arguments.
|
|
|
|
|
| |
timezone instance corresponding to the system local timezone when
called with no arguments.
|
|
|
|
| |
or datetime objects.
|