[issue36876] Global C variables are a problem.

2019-05-10 Thread Eric Snow
New submission from Eric Snow : We still have a bunch of "global" C variables (static globals, static locals, maybe thread-local storage) in our code-base that break the isolation between interpreters. I added Tools/c-globals/check-c-globals.py a while back to help identify such variables, h

[issue36877] [meta] Move fields from _PyRuntimeState to PyInterpreterState.

2019-05-10 Thread Eric Snow
New submission from Eric Snow : We have quite a bit of global state the runtime that effectively breaks the isolation between interpreters. Some of it exists as "global" C variables (see #36876) and the rest as fields on _PyRuntimeState. The offending state should be moved to PyInterpreterS

[issue36877] [meta] Move fields from _PyRuntimeState to PyInterpreterState.

2019-05-10 Thread Eric Snow
Eric Snow added the comment: FYI, I've already started some of this work: * #36737 warnings * #36854 gc * #33608 pending calls * #10915 & #15751 gilstate Other bits I'm planning on: * the rest of the global "ceval" state * the memory allocators * the GIL Note that, to make the GIL per-interp

[issue35495] argparse does not honor default argument for nargs=argparse.REMAINDER argument

2019-05-10 Thread Michael Blahay
Michael Blahay added the comment: Here is another take on the issue, this time illustrated through the lens of optional arguments. import argparse parser = argparse.ArgumentParser() parser.add_argument('--foo', nargs=1,default=['none']) parser.add_argument('--baz', nargs='*', default=['nada']

[issue36810] Recursive type annotations do not work in documentation tests

2019-05-10 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I think this is related to doc tests being executed in a namespace where the class definition is not available. I am not sure what is the best way here, a workaround is to explicitly pass the namespace, for example this passes: import typing def f(clazz,

[issue36863] argparse doesn't like options in the middle of arguments

2019-05-10 Thread Glenn Linderman
Change by Glenn Linderman : -- nosy: +v+python ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue34408] possible null pointer dereference in pystate.c

2019-05-10 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +13147 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue35495] argparse does not honor default argument for nargs=argparse.REMAINDER argument

2019-05-10 Thread Michael Blahay
Michael Blahay added the comment: With the optional arguments, the determination about whether to use the default value is made based on whether the flag is present or not. When positional arguments are involved, the need for the defaults seems to in part be determined based on whether the a

[issue36877] [meta] Move fields from _PyRuntimeState to PyInterpreterState.

2019-05-10 Thread Eric Snow
Eric Snow added the comment: In conjunction with #36876, there are a bunch of currently ignored globals (in Tools/c-globals/ignored-globals.txt) that should actually be moved to per-interpreter runtime state. This mostly applies to any globals that point to one or more objects, since object

[issue34408] possible null pointer dereference in pystate.c

2019-05-10 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I have backported the fix to 3.7 :) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue34408] possible null pointer dereference in pystate.c

2019-05-10 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 34ed40f2e56703de04241cbacb306113b59a84f9 by Pablo Galindo in branch '3.7': [3.7] bpo-34408: Prevent a null pointer dereference and resource leakage in `PyInterpreterState_New()` (GH-8767) (GH-13237) https://github.com/python/cpython/comm

[issue35495] argparse does not honor default argument for nargs=argparse.REMAINDER argument

2019-05-10 Thread Michael Blahay
Michael Blahay added the comment: Much detail has been provided regarding why the default is ignored when user the REMAINDER option. The desire to add an exception has not. Is there anyone that can provide guidance on whether the combination of: 1. Positional Argument 2. nargs=REMAINDER 3. d

[issue36876] Global C variables are a problem.

2019-05-10 Thread Eric Snow
Eric Snow added the comment: Also, Tools/c-globals/ignored-globals.txt is a bit out of date (some vars have been removed, renamed, or moved to another file). That should get cleaned up. It might also make sense to update check-c-globals.py to verify that all variables in ignored-globals.tx

[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-10 Thread Michael Sullivan
New submission from Michael Sullivan : Per discussion during the typing summit at PyCon, it would be a good idea to allow extra information to be included in `# type: ignore` comments, in order to allow behavior such as suppressing individual errors (for example, with syntax like `# type: ign

[issue27639] UserList.__getitem__ doesn't account for slices

2019-05-10 Thread Michael Blahay
Michael Blahay added the comment: PR 13203 has finally made it through all checks successfully and is now awaiting merging. Please someone pick it up and merge it. Thank you -- ___ Python tracker __

[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-10 Thread Michael Sullivan
Change by Michael Sullivan : -- keywords: +patch pull_requests: +13148 stage: -> patch review ___ Python tracker ___ ___ Python-bug

[issue36879] bug with round() and "numpy floats"

2019-05-10 Thread Scaler
New submission from Scaler : round()'s documentation (https://docs.python.org/3/library/functions.html#round) says that "The return value is an integer if ndigits is omitted or None." Works well with "built-in floats", but not with "numpy floats" (didn't know they were different): >>> import

[issue36867] Make semaphore_tracker track other system resources

2019-05-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset f22cc69b012f52882d434a5c44a004bc3aa5c33c by Antoine Pitrou (Pierre Glaser) in branch 'master': bpo-36867: Make semaphore_tracker track other system resources (GH-13222) https://github.com/python/cpython/commit/f22cc69b012f52882d434a5c44a004bc3aa

[issue36818] Add PyInterpreterState.runtime.

2019-05-10 Thread STINNER Victor
STINNER Victor added the comment: Eric is working on a different approach: https://bugs.python.org/issue36854 -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue36345] Deprecate Tools/scripts/serve.py in favour of python -m http.server -d

2019-05-10 Thread STINNER Victor
STINNER Victor added the comment: Ok, thanks Berker for your longer answer. I have no opinion on this example anymore. Stéphane and others: I let you decide how to handle it ;-) -- ___ Python tracker ___

[issue36843] AIX build fails with failure to get random numbers

2019-05-10 Thread STINNER Victor
STINNER Victor added the comment: > open O_RDONLY failed Ah. That sounds like an issue on your machine or specific to AIX. I don't see what Python can do to support a platform where /dev/urandom doesn't work. Python really needs /dev/urandom at startup to initialize its "hash secret" to red

[issue34408] possible null pointer dereference in pystate.c

2019-05-10 Thread STINNER Victor
STINNER Victor added the comment: > I have backported the fix to 3.7 :) Ok, thanks. -- ___ Python tracker ___ ___ Python-bugs-list

[issue32587] Make REG_MULTI_SZ support PendingFileRenameOperations

2019-05-10 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +13149 stage: needs patch -> patch review ___ Python tracker ___ ___ Py

[issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable

2019-05-10 Thread STINNER Victor
STINNER Victor added the comment: New changeset 09532feeece39d5ba68a0d47115ce1967bfbd58e by Victor Stinner in branch 'master': bpo-36710: Add 'ceval' local variable to ceval.c (GH-12934) https://github.com/python/cpython/commit/09532feeece39d5ba68a0d47115ce1967bfbd58e -- __

[issue26317] Build Problem with GCC + Macintosh OS X 10.11 El Capitain

2019-05-10 Thread Jeffrey Kintscher
Jeffrey Kintscher added the comment: My mistake was not adding --enable-framework=${HOME}/sandbox/src/python3.7/inst to the configure script and then running make make install (I know... read the README file) gcc 8.3.0 doesn't like the Xcode system headers included by the .m files. I will

[issue32587] Make REG_MULTI_SZ support PendingFileRenameOperations

2019-05-10 Thread Zackery Spytz
Change by Zackery Spytz : -- nosy: +ZackerySpytz ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue36879] bug with round() and "numpy floats"

2019-05-10 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: round() delegates to class.__round__, so what's happening here is that numpy's float implements __round__ in a way it returns a float. There is no restriction on what the class can return: >>> class A: ... def __round__(self): ... return "

[issue36879] bug with round() and "numpy floats"

2019-05-10 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- assignee: -> docs@python components: +Documentation nosy: +docs@python resolution: -> not a bug versions: +Python 3.7, Python 3.8 ___ Python tracker

[issue36876] Global C variables are a problem.

2019-05-10 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue36810] Recursive type annotations do not work in documentation tests

2019-05-10 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +gvanrossum, lukasz.langa ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36880] Returning None from a callback with restype py_object decrements None's refcount too much

2019-05-10 Thread dgelessus
New submission from dgelessus : This occurs when writing a ctypes callback in Python whose restype is ctypes.py_object. If the callback returns None, the refcount of None is decremented once too often. This happens every time the callback is called, and if done often enough, Python attempts t

[issue27639] UserList.__getitem__ doesn't account for slices

2019-05-10 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue36620] Documentation missing parameter for Itertools.zip_longest

2019-05-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll take care of it. Thank you. -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is cp65001

2019-05-10 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +13150 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue36810] Recursive type annotations do not work in documentation tests

2019-05-10 Thread Guido van Rossum
Guido van Rossum added the comment: I don't think there's an actionable bug here. -- ___ Python tracker ___ ___ Python-bugs-list ma

[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-10 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I like the idea of separate smaller PRs, the first one looks good. -- ___ Python tracker ___ ___

[issue33303] ElementTree Comment text isn't escaped

2019-05-10 Thread Jeffrey Kintscher
Jeffrey Kintscher added the comment: Which characters would you escape in a processing instruction? The XML spec says not to escape '<' and '&', but doesn't say what should be escaped. It seems to me that escaping '?' when followed by '>' should be sufficient since the character sequence "?>

[issue36749] PPC64 AIX 3.x: compilation issue, linker fails to locate symbols

2019-05-10 Thread STINNER Victor
STINNER Victor added the comment: PPC64 AIX 3.x buildbot worker is back to green. It seems like my PR 13004 is useless. I close the issue. -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue36728] Remove PyEval_ReInitThreads() from the public C API

2019-05-10 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +13151 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-

[issue36728] Remove PyEval_ReInitThreads() from the public C API

2019-05-10 Thread STINNER Victor
STINNER Victor added the comment: The function was added 19 years ago: commit fee3a2dd8cf984b8261032086fe513bf7327b601 Author: Guido van Rossum Date: Sun Aug 27 17:34:07 2000 + Charles Waldman's patch to reinitialize the interpreter lock after a fork. This solves the test_fork

[issue21536] extension built with a shared python cannot be loaded with a static python

2019-05-10 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +13152 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue36471] PEP 432, PEP 587: Add _Py_RunMain()

2019-05-10 Thread STINNER Victor
STINNER Victor added the comment: The PEP 587 will decide if this function is made public or not. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker __

[issue21536] extension built with a shared python cannot be loaded with a static python

2019-05-10 Thread STINNER Victor
STINNER Victor added the comment: New changeset 4ebcd7e2980d650c711d21b93447af39a8604554 by Victor Stinner in branch 'master': bpo-21536: Update What's New in Python 3.8 entry (GH-13242) https://github.com/python/cpython/commit/4ebcd7e2980d650c711d21b93447af39a8604554 -- __

[issue36788] Add clamp() function to builtins

2019-05-10 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: +Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue35495] argparse does not honor default argument for nargs=argparse.REMAINDER argument

2019-05-10 Thread paul j3
paul j3 added the comment: At the start of parse_known_args, all defaults (except SUPPRESS ones) are placed in the namespace: # add any action defaults that aren't present for action in self._actions: if action.dest is not SUPPRESS: if not hasattr(n

[issue36875] argparse does not ship with translations

2019-05-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: Many modules contain translatable strings. CPython does not ship with translations of any of them and I believe it is against policy to do so. 1. Core developers, though an international group, are not competent to create or approve translations. 2. Core de

[issue36881] isinstance raises TypeError for metaclass with metaclass=ABCMeta

2019-05-10 Thread Randy Eckman
New submission from Randy Eckman : >>> from abc import ABCMeta >>> class AbstractMeta(type, metaclass=ABCMeta): pass ... >>> class Meta1(AbstractMeta): pass ... >>> class Meta2(AbstractMeta): pass ... >>> class ClassA(metaclass=Meta1): pass ... >>> isinstance(ClassA, Meta2) Traceback (most recen

[issue13824] argparse.FileType opens a file and never closes it

2019-05-10 Thread paul j3
paul j3 added the comment: While I continue to follow argparse issues, I'm not doing development (with my own repository, etc). I haven't revisited the issue since 2013, and don't know that much more about Python file handling. Occasionally 'FileType' issues come up on StackOverflow, and

[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2019-05-10 Thread paul j3
paul j3 added the comment: A variation on the problem I reported in https://bugs.python.org/issue9351#msg229968 is that a custom Namespace class as documented in https://docs.python.org/3/library/argparse.html#the-namespace-object will not be used by the subparsers. Only the main parser

[issue36751] Changes in the inspect module for PEP 570

2019-05-10 Thread Nick Coghlan
Nick Coghlan added the comment: This PR needs to be reverted - we previously deprecated this API, but then undeprecated it again in #27172, as the consequence of deprecating it was projects copying & pasting the getfullargspec() implementation into their own code, not switching to inspect.Si

[issue36751] Changes in the inspect module for PEP 570

2019-05-10 Thread Nick Coghlan
Change by Nick Coghlan : -- priority: normal -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue36751] Changes in the inspect module for PEP 570

2019-05-10 Thread Nick Coghlan
Nick Coghlan added the comment: And no, the undeprecation wasn't because of Python 2 (Py2 doesn't have getfullargspec() - it's a Py3 only API). The undeprecation was because there are a lot of 3rd party projects for whom the getfullargspec() representation is good enough, and switching to i

[issue27172] Undeprecate inspect.getfullargspec()

2019-05-10 Thread Nick Coghlan
Change by Nick Coghlan : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue36751] Changes in the inspect module for PEP 570

2019-05-10 Thread Nick Coghlan
Nick Coghlan added the comment: Also note #32190 regarding changing the way these APIs are documented, without introducing any programmatic deprecation warnings. -- ___ Python tracker __

[issue32573] All sys attributes (.argv, ...) should exist in embedded environments

2019-05-10 Thread Dieter Weber
Change by Dieter Weber : -- keywords: +patch pull_requests: +13153 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue36863] argparse doesn't like options in the middle of arguments

2019-05-10 Thread Martin Panter
Martin Panter added the comment: The “cmd” module doesn’t use “argparse” as far as I can see. You might have to provide more information or code for someone to make sense of or reproduce your bug. Also, see Issue 14191 which added new “parse_[known]_intermixed_args” APIs in 3.7, and have a l

[issue36883] 在ctypes里调用C库返回c_char_p类型时的问题

2019-05-10 Thread anthony shaw
anthony shaw added the comment: Closing as duplicate of 36882 -- nosy: +anthonypjshaw ___ Python tracker ___ ___ Python-bugs-list m

[issue36883] 在ctypes里调用C库返回c_char_p类型时的问题

2019-05-10 Thread anthony shaw
Change by anthony shaw : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue36882] 在ctypes里调用C库返回c_char_p类型时的问题

2019-05-10 Thread anthony shaw
anthony shaw added the comment: "When the C library is called in ctypes to return the c_char_p type, the problem that only the string before \0 can be obtained when the string contains \\0" This function is specifically for null-terminated strings (\0), please could you be more specific abo

[issue36880] Returning None from a callback with restype py_object decrements None's refcount too much

2019-05-10 Thread anthony shaw
anthony shaw added the comment: Thanks, I'll check this out -- assignee: -> anthonypjshaw nosy: +anthonypjshaw ___ Python tracker ___

[issue36880] Returning None from a callback with restype py_object decrements None's refcount too much

2019-05-10 Thread anthony shaw
anthony shaw added the comment: The documentation says: >> Note Make sure you keep references to CFUNCTYPE() objects as long as they are used from C code. ctypes doesn’t, and if you don’t, they may be garbage collected, crashing your program when a callback is made. Also, note that if the cal

[issue36881] isinstance raises TypeError for metaclass with metaclass=ABCMeta

2019-05-10 Thread SilentGhost
Change by SilentGhost : -- nosy: +rhettinger, stutzbach type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36879] bug with round() and "numpy floats"

2019-05-10 Thread SilentGhost
Change by SilentGhost : -- resolution: not a bug -> stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36880] Returning None from a callback with restype py_object decrements None's refcount too much

2019-05-10 Thread anthony shaw
anthony shaw added the comment: >From lldb (lldb) run ~/cpython/test_gc_ctypes.py Process 20059 launched: '/Users/anthonyshaw/CLionProjects/cpython/python.exe' (x86_64) Fatal Python error: deallocating None Current thread 0x0001005c85c0 (most recent call first): File "/Users/anthonysha

[issue36880] Returning None from a callback with restype py_object decrements None's refcount too much

2019-05-10 Thread anthony shaw
anthony shaw added the comment: Full trace for reference: (lldb) bt all * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT * frame #0: 0x7fff5984f2c6 libsystem_kernel.dylib`__pthread_kill + 10 frame #1: 0x7fff59904bf1 libsystem_pthread.dylib`pthread_kill +

[issue35398] SQLite incorrect row count for UPDATE

2019-05-10 Thread Berker Peksag
Change by Berker Peksag : -- nosy: +berker.peksag ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue35947] Update libffi_msvc to current version of libffi

2019-05-10 Thread STINNER Victor
STINNER Victor added the comment: Would it be possible to add a What's New in Python 3.8 entry about this change? IMHO it is big and important enough to be mentioned ;-) I also wanted libffi_msvc/ to be removed. Thanks! -- nosy: +vstinner ___ Pyth

[issue33303] ElementTree Comment text isn't escaped

2019-05-10 Thread Stefan Behnel
Stefan Behnel added the comment: Hmm, sorry, I was wrong here. I looked it up and also checked the behaviour of other libraries: the data content of PIs is application specific and must not be escaped, at all. It's not XML character data. Sorry for the confusion and the extra work on your si

[issue35947] Update libffi_msvc to current version of libffi

2019-05-10 Thread SilentGhost
SilentGhost added the comment: > I also wanted libffi_msvc/ to be removed. An empty directory is not really tracked by git, you should be able to just remove it manually without any problems, alternatively you could try git clean -fd # on a clean tree add -n for dry run. -- nosy:

<    1   2