| 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)
|
| |
|
| |
This no-op change makes 2.7 more consistent with 3.x to ease comparison and backports.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Set but unused variable in Parser/pgen.c in non-debug builds. Patch by
Christian Heimes.
* Unused static function in Modules/readline.c. Patch by Georg Brandl.
* main_window unused in Modules/tkappinit.c. Patch by Gregory P. Smith.
* Dead assignment in Modules/_ctypes/cfield.c. Extracted from patch by Brett
Cannon.
* Expression result unused in PyObject_INIT macro expansions. Based on
patches by Christian Heimes.
* Load expat_config.h and therefore pyconfig.h before C stdlib headers are
loaded. This silences pre-processor warnings including '_POSIX_C_SOURCE
redefined'. Extracted from patch by Christian Heimes.
|
| |
|
|
| |
Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
timedelta from date or datetime falls outside of the MINYEAR:MAXYEAR range.
|
| | |
|
| |
|
|
| |
(Backport of r80979 to py3k.) Thanks Alexander Belopolsky.
|
| |
|
|
| |
Found using Clang's static analyzer.
|
| | |
|
| |
|
|
| |
CObject to PyCapsule.
|
| |
|
|
| |
used to drop the time part of the result.
|
| |
|
|
|
|
| |
returning
the total number of seconds in the duration. Patch by Brian Quinlan.
|
| |
|
|
|
|
| |
Added checks for integer overflows, contributed by Google. Some are
only available if asserts are left in the code, in cases where they
can't be triggered from Python code.
|
| |
|
|
|
| |
occurances of PyBytes_ in the code to their original PyString_ names. The
bytesobject.c file will be renamed back to stringobject.c in a future checkin.
|
| |
|
|
|
|
|
| |
http://mail.python.org/pipermail/python-dev/2008-June/079988.html
Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
|
| |
|
|
|
| |
Accept unicode and anything else ParseTuple "s#" can deal with. This
matches the time.strftime behavior.
|
| | |
|
| |
|
|
| |
is outside the range we expect.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
| |
imports by calling __import__ with an explicit level of 0
Added a new API function PyImport_ImportModuleNoBlock. It solves the problem with dead locks when mixing threads and imports
|
| |
|
|
| |
Py_REFCNT. Macros for b/w compatibility are available.
|
| |
|
|
|
| |
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
|
| | |
|
| |
|
|
| |
under the main pcbuild solution. Now make extensive use of property sheets to simplify project configuration. x64 build fully supported, and the process for building PGO version (Profiler Guided Optimization) simplified. All projects are now present, except _ssl, which needs to be reimplemented. Also, some of the projects that require external libraries need extra work to fully compile on x64.
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
PySequence_GetItem of the time.strptime() result. Not a high probability
bug, but not inconceivable either, considering people can provide their own
'time' module.
|
| |
|
|
|
|
| |
returns a non-string when converting %Z.
Will backport.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Probably should be backported.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In C++, it's an error to pass a string literal to a char* function
without a const_cast(). Rather than require every C++ extension
module to put a cast around string literals, fix the API to state the
const-ness.
I focused on parts of the API where people usually pass literals:
PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type
slots, etc. Predictably, there were a large set of functions that
needed to be fixed as a result of these changes. The most pervasive
change was to make the keyword args list passed to
PyArg_ParseTupleAndKewords() to be a const char *kwlist[].
One cast was required as a result of the changes: A type object
mallocs the memory for its tp_doc slot and later frees it.
PyTypeObject says that tp_doc is const char *; but if the type was
created by type_new(), we know it is safe to cast to char *.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
The LaTeX is untested (well, so is the new API, for that matter).
Note that I also changed NULL to get spelled consistently in concrete.tex.
If that was a wrong thing to do, Fred should yell at me.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|