[issue28715] Check result of PyUnicode_AsUTF8

2016-11-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue28715] Check result of PyUnicode_AsUTF8

2016-11-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 38f321a6be41 by Serhiy Storchaka in branch '3.5': Issue #28715: Added error checks for PyUnicode_AsUTF8(). https://hg.python.org/cpython/rev/38f321a6be41 New changeset 0bb8ab158042 by Serhiy Storchaka in branch '3.6': Issue #28715: Added error

[issue28715] Check result of PyUnicode_AsUTF8

2016-11-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue25996] Add support of file descriptor in os.scandir()

2016-11-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Resolved conflicts in the documentation. -- Added file: http://bugs.python.org/file45554/os-scandir-fd-3.patch ___ Python tracker

[issue27998] Bytes paths now are supported in os.scandir() on Windows

2016-11-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Steve. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue27998] Bytes paths now are supported in os.scandir() on Windows

2016-11-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset ac63c70635db by Serhiy Storchaka in branch '3.6': Issue #27998: Documented bytes paths support on Windows. https://hg.python.org/cpython/rev/ac63c70635db New changeset 26195e07fcc5 by Serhiy Storchaka in branch 'default': Issue #27998: Documented

[issue28732] spawnl crash on windows7

2016-11-19 Thread Steve Dower
Steve Dower added the comment: Buildbots seem to be happy now so I'm closing the issue. Feel free to reopen if anyone spots anything in commit review. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python

[issue28747] Expose SSL_CTX_set_cert_verify_callback

2016-11-19 Thread Steve Dower
Steve Dower added the comment: Few patch updates - better tests and some docs. -- Added file: http://bugs.python.org/file45553/28747_2.patch ___ Python tracker

[issue28732] spawnl crash on windows7

2016-11-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2e1fb851dfb4 by Steve Dower in branch '3.6': Issue #28732: Adds new errors to spawnv emulation for platforms that only have fork and execv https://hg.python.org/cpython/rev/2e1fb851dfb4 New changeset ac6de11fbd50 by Steve Dower in branch

[issue24459] Mention PYTHONFAULTHANDLER in the man page

2016-11-19 Thread Joshua Jay Herman
Joshua Jay Herman added the comment: Thanks for pointing out that wasn't in the latest patch this has been corrected. -- Added file: http://bugs.python.org/file45552/corrected.patch ___ Python tracker

[issue27998] Bytes paths now are supported in os.scandir() on Windows

2016-11-19 Thread Steve Dower
Steve Dower added the comment: Doc change looks good to me. -- ___ Python tracker ___ ___ Python-bugs-list

[issue28732] spawnl crash on windows7

2016-11-19 Thread Steve Dower
Steve Dower added the comment: > ValueError should also be raised when argv[0] is an empty string. Added that too. Python 3.5 is missing the tests for these functions completely, so I only added those to 3.6 and later. Also the original issue was already resolved in 3.6, but I tidied up a

[issue28732] spawnl crash on windows7

2016-11-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset e076ace7b0ff by Steve Dower in branch '3.5': Issue #28732: Raise ValueError when argv[0] is empty. https://hg.python.org/cpython/rev/e076ace7b0ff New changeset af78b33704af by Steve Dower in branch '3.6': Issue #28732: Raise ValueError when argv[0]

[issue28732] spawnl crash on windows7

2016-11-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1a9e4b465497 by Steve Dower in branch '3.6': Issue #28732: Raise ValueError when os.spawn*() is passed an empty tuple of arguments https://hg.python.org/cpython/rev/1a9e4b465497 New changeset 75824899f0dd by Steve Dower in branch 'default': Issue

[issue28732] spawnl crash on windows7

2016-11-19 Thread Eryk Sun
Eryk Sun added the comment: A ValueError should also be raised when argv[0] is an empty string. -- ___ Python tracker ___

[issue28732] spawnl crash on windows7

2016-11-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 02f416441def by Steve Dower in branch '3.5': Issue #28732: Fix crash in os.spawnv() with no elements in args https://hg.python.org/cpython/rev/02f416441def -- nosy: +python-dev ___ Python tracker

[issue28732] spawnl crash on windows7

2016-11-19 Thread Steve Dower
Changes by Steve Dower : -- assignee: -> steve.dower versions: +Python 3.6, Python 3.7 -Python 3.4 ___ Python tracker ___

[issue24459] Mention PYTHONFAULTHANDLER in the man page

2016-11-19 Thread Antony Lee
Changes by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker ___ ___

[issue24459] Mention PYTHONFAULTHANDLER in the man page

2016-11-19 Thread Antony Lee
Antony Lee added the comment: PYTHONUSERBASE is also missing. -- nosy: +Antony.Lee ___ Python tracker ___ ___

[issue28747] Expose SSL_CTX_set_cert_verify_callback

2016-11-19 Thread Steve Dower
Steve Dower added the comment: When I was stepping through, this callback avoided all of those lookups, so I don't understand how it's being called too late? This approach basically takes the entire raw certificate and lets the OS do whatever it needs. OpenSSL doesn't ever have to crack it

[issue28740] Add sys.getandroidapilevel()

2016-11-19 Thread STINNER Victor
STINNER Victor added the comment: > I think we must use the reliable build time Android API level and implement sys.getandroidapilevel() (Victor patch) for knowing, in the standard library, whether we are running on an Android platform, and provide a best effort platform.android_ver() for the

[issue27583] configparser: modifying default_section at runtime

2016-11-19 Thread R. David Murray
Changes by R. David Murray : -- assignee: -> docs@python components: +Documentation nosy: +docs@python versions: +Python 3.7 ___ Python tracker

[issue28747] Expose SSL_CTX_set_cert_verify_callback

2016-11-19 Thread Christian Heimes
Christian Heimes added the comment: Hi Steve, there is a better approach to fix issue20916. The verify callback is not the correct API, because it is called too late. We want to hook into the cert resolution mechanism of OpenSSL and get trust anchors and CRLs in before OpenSSL builds the

[issue10049] Add a "no-op" (null) context manager to contextlib (Rejected: use contextlib.ExitStack())

2016-11-19 Thread Martin Blais
Martin Blais added the comment: Well that just echoes exactly what I originally thought, but somebody else said it was not needed because ExitStack already exists and could be used for that purpose. If this were at work and/or it were all just to me, I'd just implement a brand new

[issue28747] Expose SSL_CTX_set_cert_verify_callback

2016-11-19 Thread Steve Dower
Steve Dower added the comment: Oh, I also made the SSL module chain exceptions properly. That's probably the biggest and scariest part of the change, but it can't have been overwriting exceptions before anyway (because it calls back into Python code to instantiate SSLError), so it's only

[issue27583] configparser: modifying default_section at runtime

2016-11-19 Thread Wolfgang Maier
Wolfgang Maier added the comment: Well, you *can* change the value at runtime as you are demonstrating in your script, but you are misunderstanding the effect this will have. It *won't* cause a reevaluation of an already parsed config file. Instead it will affect the writing of the parsed

[issue28747] Expose SSL_CTX_set_cert_verify_callback

2016-11-19 Thread Steve Dower
Steve Dower added the comment: Patch attached with code changes and basic tests. Doc changes to follow. -- keywords: +patch Added file: http://bugs.python.org/file45551/28747_1.patch ___ Python tracker

[issue28747] Expose SSL_CTX_set_cert_verify_callback

2016-11-19 Thread Steve Dower
New submission from Steve Dower: As a prerequisite for fixing issues such as issue20916 (dynamic download/update of CAs and CRLs), we really need to be able to plug into the certificate verification function for OpenSSL. This patch adds SSLContext._set_cert_verify_callback, which will allow

[issue27945] Various segfaults with dict

2016-11-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The change to dict_equal() LGTM. It doesn't add an overhead. For dictiter_iternextitem() I propose other change. It doesn't add an overhead. There are bugs in the patch for _PyDict_FromKeys(). The change to dictitems_contains() adds an overhead, but it is

[issue27945] Various segfaults with dict

2016-11-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a consolidated patch for review. -- Added file: http://bugs.python.org/file45549/27945-dict-segv-py36.patch ___ Python tracker

[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2016-11-19 Thread Masayuki Yamamoto
Masayuki Yamamoto added the comment: I wrote a patch to avoid compile error for platforms that pthread_key_t is not integer. This patch changes to turn off Py_HAVE_NATIVE_TLS if pthread_key_t is not integer. Hence the platforms use TLS functions implemented by CPython self. And, I would

[issue28556] typing.py upgrades

2016-11-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1e49abb03e0f by Guido van Rossum in branch '3.5': Issue #28556: two more small upstream changes by Ivan Levkivskyi (#329, #330) https://hg.python.org/cpython/rev/1e49abb03e0f New changeset cdddf4ee0e00 by Guido van Rossum in branch '3.6': Issue

[issue28741] PEP 498: single '}' is not allowed

2016-11-19 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks. Fixed in the pep repo in 4e86033. -- assignee: docs@python -> eric.smith resolution: -> fixed status: open -> closed type: -> enhancement ___ Python tracker

[issue28746] cannot set_inheritable() for a file descriptor on Android

2016-11-19 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue28746] cannot set_inheritable() for a file descriptor on Android

2016-11-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2fb2e3dc450e by Xavier de Gaye in branch '3.6': Issue #28746: Fix the set_inheritable() file descriptor method on platforms https://hg.python.org/cpython/rev/2fb2e3dc450e New changeset 3248782c3176 by Xavier de Gaye in branch 'default': Issue

[issue28729] Exception from sqlite3 adapter masked by sqlite3.InterfaceError

2016-11-19 Thread Aviv Palivoda
Changes by Aviv Palivoda : -- nosy: +palaviv ___ Python tracker ___ ___ Python-bugs-list

[issue28740] Add sys.getandroidapilevel()

2016-11-19 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Both sys.androidapilevel() and platform.android_ver() return information about Android's API level. I guess that would be confusing so I hope to get them unified. Techinically it won't be a problem as Chromium is still using it (in a even dirty way) and the

[issue28746] cannot set_inheritable() for a file descriptor on Android

2016-11-19 Thread Xavier de Gaye
Xavier de Gaye added the comment: It seems the code path run by Android is not tested by any of the buildbots. Patch attached. -- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file45547/set_inheritable.patch

[issue28746] cannot set_inheritable() for a file descriptor on Android

2016-11-19 Thread Xavier de Gaye
New submission from Xavier de Gaye: test_socket on Android fails with: FAIL: test_set_inheritable (test.test_socket.InheritanceTest) -- Traceback (most recent call last): File

[issue28743] test_choices_algorithms() in test_random uses lots of memory

2016-11-19 Thread Gareth Rees
Gareth Rees added the comment: In order for this to work, the __getitem__ method needs to be: def __getitem__(self, key): if 0 <= key < self.n: return self.elem else: raise IndexError(key) But unfortunately this is very bad for the performance of the

[issue28743] test_choices_algorithms() in test_random uses lots of memory

2016-11-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The main memory consumer is a list of cumulated weights created inside choices(). -- ___ Python tracker ___

[issue28740] Add sys.getandroidapilevel()

2016-11-19 Thread Xavier de Gaye
Xavier de Gaye added the comment: The build time Android API level is also a valuable information to Python users (application developers), it may be used at installation time or to detect a version mismatch. -- ___ Python tracker

[issue28743] test_choices_algorithms() in test_random uses lots of memory

2016-11-19 Thread Gareth Rees
Gareth Rees added the comment: Couldn't the test case use something like this to avoid allocating so much memory? from collections.abc import Sequence class RepeatedSequence(Sequence): """Immutable sequence of n repeats of elem.""" def __init__(self, elem, n):

[issue28740] Add sys.getandroidapilevel()

2016-11-19 Thread Xavier de Gaye
Xavier de Gaye added the comment: __system_property_get() is not a public API, see Android bug report [1]. In this stackoverflow question, an Android developer confirms this point and suggests to use the file /system/build.prop instead, noting however that "build.prop isn't guaranteed to be

[issue10049] Add a "no-op" (null) context manager to contextlib (Rejected: use contextlib.ExitStack())

2016-11-19 Thread Nick Coghlan
Nick Coghlan added the comment: No, it wouldn't, as ExitStack() does far more than merely implement a null context. It would be like adding "nulliterable = ()" as a builtin, rather than just telling people "If you need a null iterable, use an empty tuple". --

[issue28740] Add sys.getandroidapilevel()

2016-11-19 Thread STINNER Victor
STINNER Victor added the comment: I didn't know that there are build and runtime versions. If the runtime version is available, it should be preferred. Hum, maybe its better to expose the __system_property_get() function in the os module, something similar to os.confstr()?

[issue28745] Python 3.5.2 "from ... import" statement is different from official documentation

2016-11-19 Thread Eric V. Smith
Changes by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

[issue28740] Add sys.getandroidapilevel()

2016-11-19 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: I translate the Python version at issue26855 to C. Quite new to the C API, hope I'm doing it right :) Codes only. Docs and tests later sys.getwindowsversion() uses named tuples. Is there a similar need for Android or just plain tuples are fine? --

[issue28719] zipfile increase in size

2016-11-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If the output file is not seekable, zipfile sets bit 3 in file header flags and writes 12 or 20 (if ZIP64 extension is used) additional bytes after the compressed data. These bytes contain the CRC, compressed and uncompressed sizes. Corresponding fields in

[issue28740] Add sys.getandroidapilevel()

2016-11-19 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Maybe time to re-implement android_ver() in issue26855 in C. -- ___ Python tracker ___