Subject | Hash | Author | Date (UTC) |
---|---|---|---|
bpo-29953: Fix memory leaks in the replace() method of datetime and time (#927) | 314d6fca36a4eaa0541218431d14804fadec6488 | Serhiy Storchaka | 2017-03-31 19:48:16 |
Fix spurious MemoryError introduced by PR #886. (#930) | 06bb4873d6a9ac303701d08a851d6cd9a51e02a3 | T. Wouters | 2017-03-31 17:10:19 |
bpo-29941: Assert fixes (#886) | a00c3fd12d421e41b769debd7df717d17b0deed5 | T. Wouters | 2017-03-31 16:14:41 |
suppress compiler warnings in _ctypes_test (#902) | 164d30eb1e66575dafee6af4fca4cbf52c7fbe6a | Benjamin Peterson | 2017-03-31 11:05:25 |
bpo-29952: Use usual terminology of dict (GH-917) | cdcac039fb447f2ab04efcacbe663751bb2cb4ec | cocoatomo | 2017-03-31 05:48:49 |
Remove catching OSError in ftphandler test. Only URLError is raised in urllib.request module. (#918) | ed3dd1c02af6872bd0748f7b9a5dadb89f7b830f | Senthil Kumaran | 2017-03-31 05:43:05 |
bpo-29928: Add f-string to the Glossary (GH-864) | 33db068dac7686e37736f7ecf8abb2aee0345cf2 | Mariatta | 2017-03-30 19:12:18 |
bpo-29946: Fix "sqrtpi defined but not used" (#908) | 7a26464c6496c29244072fdd80f9b92c68174742 | Louie Lu | 2017-03-30 17:05:10 |
bpo-29942: Fix the use of recursion in itertools.chain.from_iterable. (#889) | 5466d4af5fe76ec0a5fbc8a05675287d9e8e9d14 | T. Wouters | 2017-03-30 16:58:35 |
bpo-10030: Sped up reading encrypted ZIP files by 2 times. (#550) | 06e522521c06671b4559eecf9e2a185c2d62c141 | Serhiy Storchaka | 2017-03-30 16:09:08 |
bpo-29935: Fixed error messages in the index() method of tuple, list and deque (#887) | d4edfc9abffca965e76ebc5957a92031a4d6c4d4 | Serhiy Storchaka | 2017-03-30 15:29:23 |
bpo-29204: Emit warnings for already deprecated ElementTree features. (#773) | 762ec97ea68a1126b8855996c61fa8239dc9fff7 | Serhiy Storchaka | 2017-03-30 15:12:06 |
bpo-29887: Test normalization now fails if download fails (#905) | 722a3af092b94983aa26f5e591fb1b45e2c2a0ff | Victor Stinner | 2017-03-30 15:06:53 |
bpo-20548: Use specific asserts in warnings and exceptions tests (#788) | f15c4d374a07c576c0e8349b16604f6dbad0b953 | Serhiy Storchaka | 2017-03-30 15:05:08 |
bpo-29913: deprecate compare_networks() in documentation (GH-865) | 16f852345bcdec1bbb15e5363fad6b33bf960912 | s-sanjay | 2017-03-30 07:44:29 |
bpo-29918: Add missed "const" modifiers in C API documentation. (#846) | 84b8e92e463bd6a5174bd3e5a6543580f6319c57 | Serhiy Storchaka | 2017-03-30 07:01:03 |
bpo-27863: Fixed multiple crashes in ElementTree. (#765) | 576def096ec7b64814e038f03290031f172886c3 | Serhiy Storchaka | 2017-03-30 06:47:31 |
bpo-29816: Shift operation now has less opportunity to raise OverflowError. (#680) | 918403cfc3304d27e80fb792357f40bb3ba69c4e | Serhiy Storchaka | 2017-03-30 06:47:07 |
bpo-29852: Argument Clinic Py_ssize_t converter now supports None (#716) | 762bf40438a572a398e500c74e38f9894ea20a45 | Serhiy Storchaka | 2017-03-30 06:15:31 |
bpo-25996: Added support of file descriptors in os.scandir() on Unix. (#502) | ea720fe7e99d68924deab38de955fe97f87e2b29 | Serhiy Storchaka | 2017-03-30 06:12:31 |
File | Lines added | Lines deleted |
---|---|---|
Lib/test/datetimetester.py | 5 | 0 |
Misc/NEWS | 3 | 0 |
Modules/_datetimemodule.c | 10 | 11 |
File Lib/test/datetimetester.py changed (mode: 100644) (index 2350125f6d..bccd97aa3c) | |||
... | ... | class TestLocalTimeDisambiguation(unittest.TestCase): | |
4313 | 4313 | dt = dt.replace(fold=1, tzinfo=Eastern) | dt = dt.replace(fold=1, tzinfo=Eastern) |
4314 | 4314 | self.assertEqual(t.replace(tzinfo=None).fold, 1) | self.assertEqual(t.replace(tzinfo=None).fold, 1) |
4315 | 4315 | self.assertEqual(dt.replace(tzinfo=None).fold, 1) | self.assertEqual(dt.replace(tzinfo=None).fold, 1) |
4316 | # Out of bounds. | ||
4317 | with self.assertRaises(ValueError): | ||
4318 | t.replace(fold=2) | ||
4319 | with self.assertRaises(ValueError): | ||
4320 | dt.replace(fold=2) | ||
4316 | 4321 | # Check that fold is a keyword-only argument | # Check that fold is a keyword-only argument |
4317 | 4322 | with self.assertRaises(TypeError): | with self.assertRaises(TypeError): |
4318 | 4323 | t.replace(1, 1, 1, None, 1) | t.replace(1, 1, 1, None, 1) |
File Misc/NEWS changed (mode: 100644) (index 42a09b6d7b..8344111e32) | |||
... | ... | Extension Modules | |
301 | 301 | Library | Library |
302 | 302 | ------- | ------- |
303 | 303 | ||
304 | - bpo-29953: Fixed memory leaks in the replace() method of datetime and time | ||
305 | objects when pass out of bound fold argument. | ||
306 | |||
304 | 307 | - bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering | - bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering |
305 | 308 | long runs of empty iterables. | long runs of empty iterables. |
306 | 309 |
File Modules/_datetimemodule.c changed (mode: 100644) (index 3661c78885..3439040d2d) | |||
... | ... | time_replace(PyDateTime_Time *self, PyObject *args, PyObject *kw) | |
3937 | 3937 | time_kws, | time_kws, |
3938 | 3938 | &hh, &mm, &ss, &us, &tzinfo, &fold)) | &hh, &mm, &ss, &us, &tzinfo, &fold)) |
3939 | 3939 | return NULL; | return NULL; |
3940 | if (fold != 0 && fold != 1) { | ||
3941 | PyErr_SetString(PyExc_ValueError, | ||
3942 | "fold must be either 0 or 1"); | ||
3943 | return NULL; | ||
3944 | } | ||
3940 | 3945 | tuple = Py_BuildValue("iiiiO", hh, mm, ss, us, tzinfo); | tuple = Py_BuildValue("iiiiO", hh, mm, ss, us, tzinfo); |
3941 | 3946 | if (tuple == NULL) | if (tuple == NULL) |
3942 | 3947 | return NULL; | return NULL; |
3943 | 3948 | clone = time_new(Py_TYPE(self), tuple, NULL); | clone = time_new(Py_TYPE(self), tuple, NULL); |
3944 | 3949 | if (clone != NULL) { | if (clone != NULL) { |
3945 | if (fold != 0 && fold != 1) { | ||
3946 | PyErr_SetString(PyExc_ValueError, | ||
3947 | "fold must be either 0 or 1"); | ||
3948 | return NULL; | ||
3949 | } | ||
3950 | 3950 | TIME_SET_FOLD(clone, fold); | TIME_SET_FOLD(clone, fold); |
3951 | 3951 | } | } |
3952 | 3952 | Py_DECREF(tuple); | Py_DECREF(tuple); |
... | ... | datetime_replace(PyDateTime_DateTime *self, PyObject *args, PyObject *kw) | |
5030 | 5030 | &y, &m, &d, &hh, &mm, &ss, &us, | &y, &m, &d, &hh, &mm, &ss, &us, |
5031 | 5031 | &tzinfo, &fold)) | &tzinfo, &fold)) |
5032 | 5032 | return NULL; | return NULL; |
5033 | if (fold != 0 && fold != 1) { | ||
5034 | PyErr_SetString(PyExc_ValueError, | ||
5035 | "fold must be either 0 or 1"); | ||
5036 | return NULL; | ||
5037 | } | ||
5033 | 5038 | tuple = Py_BuildValue("iiiiiiiO", y, m, d, hh, mm, ss, us, tzinfo); | tuple = Py_BuildValue("iiiiiiiO", y, m, d, hh, mm, ss, us, tzinfo); |
5034 | 5039 | if (tuple == NULL) | if (tuple == NULL) |
5035 | 5040 | return NULL; | return NULL; |
5036 | 5041 | clone = datetime_new(Py_TYPE(self), tuple, NULL); | clone = datetime_new(Py_TYPE(self), tuple, NULL); |
5037 | |||
5038 | 5042 | if (clone != NULL) { | if (clone != NULL) { |
5039 | if (fold != 0 && fold != 1) { | ||
5040 | PyErr_SetString(PyExc_ValueError, | ||
5041 | "fold must be either 0 or 1"); | ||
5042 | return NULL; | ||
5043 | } | ||
5044 | 5043 | DATE_SET_FOLD(clone, fold); | DATE_SET_FOLD(clone, fold); |
5045 | 5044 | } | } |
5046 | 5045 | Py_DECREF(tuple); | Py_DECREF(tuple); |