| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-10617)
Fixes assertion failures in _datetimemodule.c
introduced in the previous fix (see bpo-31752).
Rather of trying to handle an int subclass as exact int,
let it to use overridden special methods, but check the
result of divmod().
(cherry picked from commit 3ec0f495163da3b7a15deb2805cec48aed432f58)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
custom integers. (GH-3947) (#4088)
Bad remainder in divmod() in intermediate calculations caused an assertion failure..
(cherry picked from commit 4ffd4653a7ec9c97775472276cf5e159e2366bb2)
|
| |
|
|
|
|
| |
Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line
#9424: Replace deprecated assert* methods in the Python test suite.
........
|
|
|
|
| |
timedelta from date or datetime falls outside of the MINYEAR:MAXYEAR range.
|
|
|
|
| |
using unittest.skipIf decorator.
|
|
|
|
| |
including Windows CE.
|
|
|
|
| |
(Backport of r80979 to py3k.) Thanks Alexander Belopolsky.
|
| |
|
| |
|
|
|
|
| |
used to drop the time part of the result.
|
|
|
|
|
|
| |
returning
the total number of seconds in the duration. Patch by Brian Quinlan.
|
| |
|
|
|
|
|
| |
For datetime, gentoo didn't seem to mind the %e format for strftime. So, we just excercise those instead making sure that we don't crash.
For test_os, two cases were incorrect.
|
|
|
|
| |
invalid file descriptors in the os module.
|
| |
|
|
|
|
| |
inherit a__hash__ implementation from a parent class in Python 3.x. The standard library and test suite have been updated to not emit these warnings.
|
|
|
|
|
| |
Accept unicode and anything else ParseTuple "s#" can deal with. This
matches the time.strftime behavior.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Highlights:
- Adding PyObject_Format.
- Adding string.Format class.
- Adding __format__ for str, unicode, int, long, float, datetime.
- Adding builtin format.
- Adding ''.format and u''.format.
- str/unicode fixups for formatters.
The files in Objects/stringlib that implement PEP 3101 (stringdefs.h,
unicodedefs.h, formatter.h, string_format.h) are identical in trunk
and py3k. Any changes from here on should be made to trunk, and
changes will propogate to py3k).
|
| |
|
|
|
|
| |
count checking; 'regrtest.py -R' is the way to do this kind of testing.
|
|
|
|
| |
run_unittest() and run_suite()). Also, add functionality to run_unittest() that admits usage of unittest.TestLoader.loadTestsFromModule().
|
|
|
|
| |
if os.name == "nt".
|
|
|
|
|
|
| |
fractional times. With unittest.
Somebody please backport to 2.5.
|
|
|
|
| |
Will backport to 2.5.
|
|
|
|
| |
datetime's strftime function.
|
|
|
|
| |
possibly "rounding up" to the next whole second.
|
|
|
|
|
|
| |
returns a non-string when converting %Z.
Will backport.
|
|
|
|
|
|
| |
accepts strings only for unpickling reasons. This check prevents the honest
mistake of passing a string like '2:59.0' to time() and getting an insane
object.
|
| |
|
|
|
|
| |
the changes.
|
|
|
|
| |
Treat comparing a date to a datetime like a mixed-type comparison.
|
|
|
|
|
|
|
|
|
|
|
| |
New include file timefuncs.h exports private API function
_PyTime_DoubleToTimet() from timemodule.c. timemodule should export
some other functions too (look for painful bits in datetimemodule.c).
Added insane-argument checking to datetime's assorted fromtimestamp()
and utcfromtimestamp() methods. Added insane-argument tests of these
to test_datetime, and insane-argument tests for ctime(), localtime()
and gmtime() to test_time.
|
|
|
|
|
|
|
| |
datetime.datetime and datetime.time could yield insane objects. Thanks
to Jiwon Seo for the fix.
Bugfix candidate. I'll backport it to 2.3.
|
|
|
|
|
|
|
|
|
| |
It's possible to create insane datetime objects by using the constructor
"backdoor" inserted for fast unpickling. Doing extensive range checking
would eliminate the backdoor's purpose (speed), but at least a little
checking can stop honest mistakes.
Bugfix candidate.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The interning of short strings violates the refcnt==1 assumption for
_PyString_Resize().
A simple fix is to boost the initial value of "totalnew" by 1.
Combined with an NULL argument to PyString_FromStringAndSize(),
this assures that resulting format string is not interned.
This will remain true even if the implementation of
PyString_FromStringAndSize() changes because only the uninitialized
strings that can be interned are those of zero length.
Added a test case.
|
|
|
|
|
|
|
|
| |
one good use: a subclass adding a method to express the duration as
a number of hours (or minutes, or whatever else you want to add). The
native breakdown into days+seconds+us is often clumsy. Incidentally
moved a large chunk of object-initialization code closer to the top of
the file, to avoid worse forward-reference trickery.
|
| |
|
|
|
|
|
|
|
| |
attributes and methods work, that new arguments can be passed to the
constructor, and that inherited methods and attrs still work. Added
XXX comments about what to do when datetime becomes usably subclassable
too (it's not yet).
|
|
|
|
|
| |
(This is only the tip of the iceberg; the time and datetime classes
need the same treatment.)
|
| |
|
|
|
|
|
|
|
| |
tickle the 2.2.2 __cmp__ bug test_datetime used to tickle, so the
workarounds for that bug no longer make sense in the test suite (which I'm
still trying to keep as closely in synch as possible with Zope3's
version).
|