[issue34529] add the option for json.dumps to return newline delimited json

2018-08-28 Thread Michał Radwański
Michał Radwański added the comment: So this format is just a series of JSON, delimited by a newline. Instead of changing API, you might consider this piece of code: def ndjsondump(objects): return '\n'.join(json.dumps(obj) for obj in objects) Conversely, first you `str.splitlines

[issue34443] enum repr should use __qualname__

2018-08-25 Thread Michał Radwański
Michał Radwański added the comment: Serhiy, would it be ok to put '__module__' + '.' + __qualname__ here? -- nosy: +enedil ___ Python tracker <https://bugs.python.org/issue34

[issue34501] PyType_FromSpecWithBases: spec->name is dereferenced before checking for NULL

2018-08-25 Thread Michał Radwański
Michał Radwański added the comment: But if the error message is set, then for consistency, it should be also the case that the later checks set some kind of error message. -- nosy: +enedil ___ Python tracker <https://bugs.python.org/issue34

[issue34498] Python 3.7 breaks on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2018-08-25 Thread Michał Radwański
Michał Radwański added the comment: The change is not only in the added `isinstance` check: ~ $ python3.6 -q >>> import typing >>> isinstance(typing.Sequence, type) True >>> ~ $ python3.7 -q >>> import typing >>> isinstance(typing.Sequen

[issue34453] ipaddress module accepts some strange IPv6 addresses that it shouldn't

2018-08-25 Thread Michał Radwański
Michał Radwański added the comment: The point is that the specification is not complete and thus left for the implementations to decide. Python's version hits the sweet spot between inclusive and correct - as long as a version is unambiguous, it is accepted

[issue34453] ipaddress module accepts some strange IPv6 addresses that it shouldn't

2018-08-24 Thread Michał Radwański
Michał Radwański added the comment: According to the RFC ( https://tools.ietf.org/html/rfc4291#section-2.2 ), last four bytes can be an address in the format of IPv4 address. The latter doesn't specify whether leading zeros are permitted or not. For illustration let's look

[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2018-08-23 Thread Michał Radwański
Michał Radwański added the comment: Although you're right - this issue is specific to pytime.c, when _Py_InIntegralTypeRange() is used with a double, it is actually true that _Py_InIntegralTypeRange() is used with double, in pytime.c only (as a quick recursive grep discovers). Perhaps

[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2018-08-17 Thread Michał Radwański
Change by Michał Radwański : -- keywords: +patch pull_requests: +8278 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34423> ___ ___ Py

[issue32367] [Security] CVE-2017-17522: webbrowser.py in Python does not validate strings

2018-08-17 Thread Michał Radwański
Change by Michał Radwański : -- pull_requests: +8277 ___ Python tracker <https://bugs.python.org/issue32367> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2018-08-17 Thread Michał Radwański
New submission from Michał Radwański : Code triggering bug: import time time.sleep(2**63 / 10**9) Result: ValueError: sleep length must be non-negative The problem is with the macro that checks the range of provided double: Line 228 of Include/pymath.h: #define _Py_InIntegralTypeRange(type

[issue30656] typo in PyModule_New documentation

2017-06-13 Thread Michał Radwański
Changes by Michał Radwański <lisklusow...@gmail.com>: -- pull_requests: + ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30637] Syntax error reported on compile(...), but not on compile(..., ast.PyCF_ONLY_AST)

2017-06-13 Thread Michał Radwański
Michał Radwański added the comment: Docs mention: ast.parse(source, filename='', mode='exec') Parse the source into an AST node. Equivalent to compile(source, filename, mode, ast.PyCF_ONLY_AST). If you just parse code into AST, you first check whether it is possible to turn such source