Age | Commit message (Collapse) | Author |
|
Exempt-From-Owner-Approval: Upgrade library
Test: build
Change-Id: Ia9c1991e6598e1c97f8f01244ffbddf994c46763
|
|
|
|
The logic for DTSTART, EXDATE and RDATE is substantially similar, so it
makes sense to factor this out into a separate method.
|
|
Per RFC 5545 Section 3.8.5.1, exception dates should support VALUE and
TZID parameters. This commit adds support for the full grammar of
EXDATE.
|
|
This adds a mix of failing and passing tests all of which must pass in
order to close GH issue #410.
These test a hopefully representative sample of supported parameter
combinations, though all combinations are not exhausted.
|
|
On Windows and Python 2.7, calling `tzwin` with a non-ascii name will
raise a UnicodeEncodeError instead of WindowsError, as it does on other
platforms and versions.
Fixes GH #802.
|
|
|
|
No version of pytest that works on Python 3.3 supports the
get_closest_marker method, and pytest >= 4.0 *only* supports
get_closest_marker, so we must retrieve item.get_marker *if and only if*
we cannot retrieve get_closest_marker.
|
|
This automatically attaches the `no_cover` marker to anything marked
`xfail` *if* the `xfail` condition is met. This allows us to do the test
coverage in one run instead of two.
|
|
|
|
|
|
This ensures that positional arguments can be passed successfully
|
|
|
|
|
|
|
|
Caching had been switched to use `weakrefs` in order to reuse instances if they
are still alive, by #635. This introduces a LRU cache to the mentioned functions
in order to prevent the instances created by them getting dealloc'd and alloc'd
unnecessarily, in situations like this:
```python
for i in range(100):
tz.gettz('America/New_York')
```
`tz.tzoffset` and `tz.tzstr` get a LRU cache with size of 8.
`tz.gettz`'s cache starts with 8 by default and can be modified by the
introduced `tz.set_cache_size(int)`
Closes #691
|
|
This makes the grouping of the logic clearer; UTC is used either in the
first group or the second group.
|
|
|
|
|
|
Separate out input_format tests
|
|
The setup_class method doesn't happen to be necessary in this case so
I've refactored it out.
|
|
|
|
The bytes type is available on all supported Pythons. Can remove
workaround and make the code more forward compatible with Python 3.
|
|
More forward compatible by slightly reducing unnecessary use of the six
library.
|
|
This improves the ability to inspect wrapped tzname methods in Python 2
and removes an unnecessary function call (to the nested function) in
Python 3. From my measurements, this is about twice as fast in Python 3
and approximately the same speed in Python 2.
|
|
This fixes a bug with the transition time of the Samoan base offset
change (UTC-10 -> UTC+14), relating to the fact that it occurred during
DST.
When cleaning that up, I discovered a cleaner way to handle the issue of
Portugal's base offset shift without a corresponding total offset shift,
obviating the need for a second traversal of the transition list.
|
|
|
|
The original badzone test fails for a different reason on Windows, so
that has been changed to a Windows-specific xfail for GH issue #802, and
a new cross-platform badzone test added.
|
|
None is a singleton and a weak reference to it will never expire, and in
this case it is used more as a soft failure mode than as an actual value
to return. By special-casing this, the invariant that:
gettz(x) is gettz(x)
is preserved in all cases *except* when something on the underlying
system changes such that `x` does not refer to a valid time zone in the
first call, but does refer to a valid time zone in the second call. This
could happen if `x` is added to the zoneinfo data, or if the local time
zone changes such that `x` is now a valid specifier for the local time.
|
|
This fails when gettz tries to store a weak reference to None.
|
|
|
|
The _ContextWrapper class was added before nullcontext was added
to the standard library. When available, we should prefer to use
nullcontext.
|
|
RFC 3339 does not specify a limit to the number of fractional digits
that can be provided. In the wild, languages like Go will provide up
to 9 digits by default.
Since the standard library's `datetime` only supports precision down
to microseconds, any extra digits in the fractional component are
truncated.
Fixes #786
|
|
|
|
|
|
|
|
This adds a general description of relativedelta and also
tweaks the documentation of the weekday parameter.
|
|
|
|
#623: added documentation for rrulestr function
|
|
|
|
|
|
In the standard, 24 is only allowed as an hour at midnight exactly,
these tests ensure that while 24:00 and its variations are allowed,
non-midnight times with hour==24 fail.
|
|
The old behavior parsed the string, modified the 24 component to 0
and then parsed the string a second time, passing an unmodified
version to the datetime.time constructor.
|
|
Test is currently failing due to a bug in the parse_isotime
implementation.
|
|
|
|
|
|
- Add "Africa/Monrovia" to test_resolve_imaginary test for python 3.6 or newer
- Test that partial minutes is supported in python 3.6 or newer for tz.tzfile and datetime.utcoffset
- Enable partial minutes in both tz.tzoffset and tz.tzfile
- For now, don't warn user when rounding to nearest minute for python pre-3.6
|
|
|
|
|
|
|