[issue37868] `is_dataclass` returns `True` if `getattr` always succeeds.

2019-08-19 Thread miss-islington
Change by miss-islington : -- pull_requests: +15056 pull_request: https://github.com/python/cpython/pull/15339 ___ Python tracker ___

[issue37868] `is_dataclass` returns `True` if `getattr` always succeeds.

2019-08-19 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset b0f4dab8735f692bcfedcf0fa9a25e238a554bab by Eric V. Smith in branch 'master': bpo-37868: Improve is_dataclass for instances. (GH-15325) https://github.com/python/cpython/commit/b0f4dab8735f692bcfedcf0fa9a25e238a554bab --

[issue37868] `is_dataclass` returns `True` if `getattr` always succeeds.

2019-08-19 Thread miss-islington
Change by miss-islington : -- pull_requests: +15057 pull_request: https://github.com/python/cpython/pull/15340 ___ Python tracker ___

[issue37890] Modernize several tests in test_importlib

2019-08-19 Thread Kyle Stanley
Change by Kyle Stanley : -- stage: -> needs patch type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37835] typing.get_type_hints wrong namespace for forward-declaration of inner class

2019-08-19 Thread Netzeband
Netzeband added the comment: I tried my idea with the small example code above. However it does not work like expected: (see zipped example project, attached to this comment) At the moment where the function decorator is applied to the method of the inner class, the local namespace

[issue37754] Persistence of Shared Memory Segment after process exits

2019-08-19 Thread Vinay Sharma
Vinay Sharma added the comment: Hi Davin, Thanks for replying! As you said I went through the issue, and now understand why segments should not be automatically created if they don't exist. But, after reading that thread I got to know that shared memory is supposed to exist even if the

[issue37835] typing.get_type_hints wrong namespace for forward-declaration of inner class

2019-08-19 Thread Netzeband
Netzeband added the comment: Thanks for your response. I was also thinking much about it and was not able to find a nice idea how to get this working. The problem is, that we loose the local-namespace information as soon as we leave the context of the function, where the class was defined

[issue37754] Persistence of Shared Memory Segment after process exits

2019-08-19 Thread Vinay Sharma
Change by Vinay Sharma : -- title: alter size of segment using multiprocessing.shared_memory -> Persistence of Shared Memory Segment after process exits ___ Python tracker

[issue37890] Modernize several tests in test_importlib

2019-08-19 Thread Kyle Stanley
Change by Kyle Stanley : -- nosy: +eric.snow, ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37890] Modernize several tests in test_importlib

2019-08-19 Thread Kyle Stanley
Kyle Stanley added the comment: I'm not entirely certain as to which parts should be modernized, and which ones can remain the same. A large part of my uncertainty is that there are no header comments for "test_pkg_import.py" to explain the test coverage, so I don't know if there are

[issue37890] Modernize several tests in test_importlib

2019-08-19 Thread Kyle Stanley
New submission from Kyle Stanley : Last month, several tests were moved into test_importlib (https://bugs.python.org/issue19696): "test_pkg_import.py", "test_threaded_import.py", and "threaded_import_hangers.py". Those tests were created quite a while ago though and do not currently utilize

[issue36502] str.isspace() for U+00A0 and U+202F differs from document

2019-08-19 Thread Greg Price
Greg Price added the comment: Thanks Victor for the reviews and merges! (Unmarking 2.7, because https://docs.python.org/2/library/stdtypes.html seems to not have this issue.) -- versions: -Python 2.7 ___ Python tracker

[issue37866] PyModule_GetState Segmentation fault when called Py_Initialize

2019-08-19 Thread Hua Liu
Change by Hua Liu : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37883] threading.Lock.locked is not documented

2019-08-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +newcomer friendly ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37887] some leak in the compiler_assert function

2019-08-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Hi hai shi, As you can see in other pars of the code base objects returned from PyUnicode_InternFromString that have static storage class do not need to be deallocated in case there is a failure, so this is not considered a leak as there will be

[issue37834] readlink on Windows cannot read app exec links

2019-08-19 Thread Steve Dower
Steve Dower added the comment: > So the order of the GetFileInformationByHandleEx and GetFileType blocks > actually needs to be flipped. I've done that now. And thanks for confirming. That was my suspicion, but I wasn't sure if you knew something here that I didn't (v. likely!).

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset d11c2c607768fa549b1aed7899edc061b2ebf19f by Victor Stinner in branch 'master': Revert "bpo-37788: Fix a reference leak if a thread is not joined (GH-15228)" (GH-15338)

[issue37878] Sub-Interpreters : Document PyThreadState_DeleteCurrent()

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: Is it safe to call PyThreadState_DeleteCurrent()? -- keywords: -easy ___ Python tracker ___ ___

[issue37889] Fatal Python error: Py_EndInterpreter: not the last thread

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: It's a regression caused by bpo-37788. I created PR 15338 to revert my change. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: > https://github.com/python/cpython/commit/d3dcc92778807ae8f7ebe85178f36a29711cd478 This change introduced a regression :-( https://github.com/python/cpython/pull/15228#issuecomment-522792133 I created PR 15338 to revert it --

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2019-08-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +15055 pull_request: https://github.com/python/cpython/pull/15338 ___ Python tracker ___

[issue37889] Fatal Python error: Py_EndInterpreter: not the last thread

2019-08-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- title: "Fatal Python error: Py_EndInterpreter: not the last thread" that's bad -> Fatal Python error: Py_EndInterpreter: not the last thread ___ Python tracker

[issue37889] "Fatal Python error: Py_EndInterpreter: not the last thread" that's bad

2019-08-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: See also https://bugs.python.org/issue37788 -- ___ Python tracker ___ ___

[issue37834] readlink on Windows cannot read app exec links

2019-08-19 Thread Eryk Sun
Eryk Sun added the comment: > Any particular reason you did GetFileAttributesW(path) in the > non-FILE_TYPE_DISK case when we have the hFile around? The point of getting the file attributes is to identify the root directory of the namedpipe and mailslot file systems. For example,

[issue37889] "Fatal Python error: Py_EndInterpreter: not the last thread" that's bad

2019-08-19 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : The x86-64 High Sierra 3.x buildbot and AMD64 FreeBSD CURRENT Shared 3.x are failing with: Fatal Python error: Py_EndInterpreter: not the last thread https://buildbot.python.org/all/#/builders/145/builds/2233

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset d3dcc92778807ae8f7ebe85178f36a29711cd478 by Victor Stinner in branch 'master': bpo-37788: Fix a reference leak if a thread is not joined (GH-15228) https://github.com/python/cpython/commit/d3dcc92778807ae8f7ebe85178f36a29711cd478 --

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2019-08-19 Thread miss-islington
Change by miss-islington : -- pull_requests: +15054 pull_request: https://github.com/python/cpython/pull/15337 ___ Python tracker ___

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2019-08-19 Thread miss-islington
Change by miss-islington : -- pull_requests: +15053 pull_request: https://github.com/python/cpython/pull/15336 ___ Python tracker ___

[issue37834] readlink on Windows cannot read app exec links

2019-08-19 Thread Steve Dower
Steve Dower added the comment: Thanks for the code snippet, that helped me a lot (and since you went to the trouble of fixing other bugs, I guess I'll have to merge it into my PR now). Any particular reason you did GetFileAttributesW(path) in the non-FILE_TYPE_DISK case when we have the

[issue23882] unittest discovery doesn't detect namespace packages when given no parameters

2019-08-19 Thread Roger Gammans
Change by Roger Gammans : -- nosy: +rgammans ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35617] unittest discover does not work with implicit namespaces

2019-08-19 Thread Roger Gammans
Change by Roger Gammans : -- nosy: +rgammans ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36723] Unittest Discovery for namespace subpackages dot notation fails

2019-08-19 Thread Roger Gammans
Roger Gammans added the comment: I think this is a duplicate of one (or both) of 35617, or 23882 . Both of those have unmerged proposed fixes. -- nosy: +rgammans ___ Python tracker

[issue37834] readlink on Windows cannot read app exec links

2019-08-19 Thread Eryk Sun
Eryk Sun added the comment: Here are two additional differences between mount points and symlinks: (1) A mount point in a remote path is always evaluated on the server and restricted to devices that are local to the server. So if we handle a mount point as if it's a POSIX symlink that works

[issue37834] readlink on Windows cannot read app exec links

2019-08-19 Thread Eryk Sun
Eryk Sun added the comment: Here's the requested overview for the case where name-surrogate reparse points are handled as winlinks (Windows links), but S_IFLNK is reserved for IO_REPARSE_TAG_SYMLINK. I took the time this afternoon to write it up in C, which hopefully is clearer than my

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-08-19 Thread Abhilash Raj
Abhilash Raj added the comment: 2.7 needs a separate PR since the code is very different and my familiarity with 2.7 version of email package is very limited. I am going to work on a separate patch later this week for 2.7. -- ___ Python tracker

[issue37884] Optimize Fraction() and statistics.mean()

2019-08-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: AFAICT, no end-user has ever requested this ever. Despite your insistence, we really don't have to clutter the math module with this. We sometimes do have two or three repetitions of logic in the standard library; however, our needs tend to be much

[issue37884] Optimize Fraction() and statistics.mean()

2019-08-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This issue if for optimization only. It does not expand the math module API. Adding public math.as_integer_ratio() has other benefits (it allows to simplify the user code), but it is a different issue (see issue37822). --

[issue37884] Optimize Fraction() and statistics.mean()

2019-08-19 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > ISTM that small and probably unimportant opimizations shouldn't spill-over > into API feature creep. The way I see it, the optimization is besides the point here. Regardless of performance, the added function is a useful feature to have to avoid forcing

[issue37888] Sub-interpreters : Confusing docs about state after calling Py_NewInterpreter()

2019-08-19 Thread Joannah Nanjekye
New submission from Joannah Nanjekye : In the documentation for Py_NewInterpreter(): It is said that : The return value points to the first thread state created in the new sub-interpreter. This thread state is made in the current thread state. I think changing : This thread state is made

[issue37875] gzip module any difference for compressing png file in version 2.X and 3.X

2019-08-19 Thread Zachary Ware
Change by Zachary Ware : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue37884] Optimize Fraction() and statistics.mean()

2019-08-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Mark, I don't think the math module API should be expanded for as_integer_ratio(). ISTM that small and probably unimportant opimizations shouldn't spill-over into API feature creep. What do you think? -- assignee: -> mark.dickinson

[issue37764] email.Message.as_string infinite loop

2019-08-19 Thread Ashwin Ramaswami
Ashwin Ramaswami added the comment: Thanks, I've fixed the first case as you suggested. I found an example of the 2nd case -- '=?utf-8?q?=somevalue?=' -- which causes the method to hang. I've added a fix, though I'm not sure if it treats the string properly -- it parses it as

[issue37886] PyStructSequence_UnnamedField not exported

2019-08-19 Thread Jeff Robbins
Jeff Robbins added the comment: Editing one line in structseq.h seems to fix the issue. I changed this extern char* PyStructSequence_UnnamedField; to PyAPI_DATA(char*) PyStructSequence_UnnamedField; rebuilt, and now my C extension can use PyStructSequence_UnnamedField. -- Added

[issue37878] Sub-Interpreters : Document PyThreadState_DeleteCurrent()

2019-08-19 Thread Joannah Nanjekye
Joannah Nanjekye added the comment: >From what I know the GIL is released by calling PyEval_ReleaseThread() or >PyEval_SaveThread(). I see we can use PyThreadState_Delete() to clean up-specifically destroy thread state but does not release the GIL and requires a thread state. On the other

[issue37887] some leak in the compiler_assert function

2019-08-19 Thread hai shi
New submission from hai shi : Some reference leak in compiler_assert function, due to not using Py_DECREF(assertion_error) before return. And having a question about code order in compiler_assert function. -- components: Interpreter Core files: compiler_assert.patch keywords: patch

[issue37835] typing.get_type_hints wrong namespace for forward-declaration of inner class

2019-08-19 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Thanks for reporting! I spent some time thinking about this and I can't find any reasonable way of doing this, sorry. Anyway, let's keep this open, maybe someone will come up with a proposal. -- ___ Python

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: > Created a backport PR for 3.5. Thanks. I reviewed it (LGTM). What about Python 2.7, it's also vulnerable, no? -- ___ Python tracker ___

[issue37886] PyStructSequence_UnnamedField not exported

2019-08-19 Thread Jeff Robbins
New submission from Jeff Robbins : Python 3.8.0b3 has the fixed https://docs.python.org/3/c-api/tuple.html#c.PyStructSequence_NewType, but one of the documented features of PyStructSequence is the special https://docs.python.org/3/c-api/tuple.html#c.PyStructSequence_UnnamedField which is

[issue37866] PyModule_GetState Segmentation fault when called Py_Initialize

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: Python 3.5 no longer accept bug fixes. Are you able to reproduce the bug with Python 3.8, or Python 3.7? > the crash file came out when i tried to call Py_Initialize in a C file. Can you provide this file? What is your OS and OS version? How did you

[issue37878] Sub-Interpreters : Document PyThreadState_DeleteCurrent()

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: I'm not sure why PyThreadState_DeleteCurrent() is exposed. Why would anyone use it? It is used internally by the _thread module when the thread function completes. I suggest to make the function internal instead of documenting it. Eric, Joannah: what do

[issue37565] test_faulthandler: test_register_chain() crash with SIGSEGV (signal 11) on Skylake chipset

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: Bennet Fauber: > It would appear that jshelly was correct and this is resolved by fixing the > problem isolated in issue 21131, which was closed and a patch was committed. Great! I close this issue as a duplicate of bpo-21131. -- resolution: ->

[issue18835] Add PyMem_AlignedAlloc()

2019-08-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +15052 pull_request: https://github.com/python/cpython/pull/15333 ___ Python tracker ___

[issue37732] Possible uninitialized variable in Objects/obmalloc.c

2019-08-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +15051 pull_request: https://github.com/python/cpython/pull/15333 ___ Python tracker ___

[issue37869] Compilation warning on GCC version 7.4.0-1ubuntu1~18.04.1

2019-08-19 Thread STINNER Victor
Change by STINNER Victor : -- stage: -> resolved status: open -> closed superseder: -> Possible uninitialized variable in Objects/obmalloc.c ___ Python tracker ___

[issue37732] Possible uninitialized variable in Objects/obmalloc.c

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: bpo-37869 has been marked as a duplicate of this issue. -- nosy: +vstinner ___ Python tracker ___

[issue37869] Compilation warning on GCC version 7.4.0-1ubuntu1~18.04.1

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: Duplicate of bpo-37732. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36502] str.isspace() for U+00A0 and U+202F differs from document

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: str.isspace() documentation has been fixed, thanks Greg Price for the fix! I close the issue. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: > Its interesting to read the comment on the IA64 definition for SIGSTKSZ: Python doesn't support IA64 architecture. Note: I'm not sure that this architecture is going to survive in the long term... More and more systems stopped to support it. > Well, one

[issue36502] str.isspace() for U+00A0 and U+202F differs from document

2019-08-19 Thread miss-islington
miss-islington added the comment: New changeset 0fcdd8d6d67f57733203fc79e6a07a89b924a390 by Miss Islington (bot) in branch '3.7': bpo-36502: Correct documentation of str.isspace() (GH-15019) (GH-15296) https://github.com/python/cpython/commit/0fcdd8d6d67f57733203fc79e6a07a89b924a390

[issue36502] str.isspace() for U+00A0 and U+202F differs from document

2019-08-19 Thread miss-islington
Change by miss-islington : -- pull_requests: +15050 pull_request: https://github.com/python/cpython/pull/15332 ___ Python tracker ___

[issue36502] str.isspace() for U+00A0 and U+202F differs from document

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset 8c1c426a631ba02357112657193f82c58d3e08b4 by Victor Stinner (Greg Price) in branch '3.8': bpo-36502: Correct documentation of str.isspace() (GH-15019) (GH-15296) https://github.com/python/cpython/commit/8c1c426a631ba02357112657193f82c58d3e08b4

[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-19 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > Sorry, but I do not understand why adding Fraction.as_integer_ratio() > prevents adding math.as_integer_ratio(). I also support a public function for that. It seems that we're planning this "as_integer_ratio" thing to become public API, so why not have a

[issue37836] Support .as_integer_ratio() in fractions.Fraction

2019-08-19 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > I afraid this can slow down the Fraction constructor. No, it doesn't! It even speeds up the constructor in some cases: ./python -m perf timeit --duplicate 200 -s 'from fractions import Fraction; x = 1' 'Fraction(x)' BEFORE: Mean +- std dev: 826 ns +- 20

[issue37885] venv: Don't produce unbound variable warning on deactivate

2019-08-19 Thread Daniel Abrahamsson
Change by Daniel Abrahamsson : -- keywords: +patch pull_requests: +15048 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15330 ___ Python tracker

[issue37885] venv: Don't produce unbound variable warning on deactivate

2019-08-19 Thread Daniel Abrahamsson
New submission from Daniel Abrahamsson : Running deactivate from a bash shell configured to treat undefined variables as errors (`set -u`) produces a warning: ``` $ python3 -m venv test $ source test/bin/activate (test) $ deactivate -bash: $1: unbound variable ``` -- components:

[issue37884] Optimize Fraction() and statistics.mean()

2019-08-19 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > There is a 14% regression in creating a Fraction from an integer Isn't that the main use case? I suggest to keep the special case for 'int' as fast path to avoid this regression. -- nosy: +jdemeyer ___ Python

[issue37836] Support .as_integer_ratio() in fractions.Fraction

2019-08-19 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > See issue37884 which uses a C accelerator. Note that that doesn't replace this issue, because I need to support as_integer_ratio both in the *numerator* and *denominator*. -- ___ Python tracker

[issue37664] Update bundled pip and setuptools

2019-08-19 Thread Pradyun Gedam
Pradyun Gedam added the comment: There wasn't a new setuptools release when I updated these the last time, IIRC. Anyway, I'll cut a new release for pip, file a new b.p.o. issue and get to updating both of these sometime this week. On Mon, 19 Aug 2019 at 11:20 AM, Inada Naoki wrote: > >

[issue37836] Support .as_integer_ratio() in fractions.Fraction

2019-08-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue37884 which uses a C accelerator. -- ___ Python tracker ___ ___ Python-bugs-list

[issue37884] Optimize Fraction() and statistics.mean()

2019-08-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15047 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15329 ___ Python tracker

[issue37884] Optimize Fraction() and statistics.mean()

2019-08-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The proposed PR optimizes the Fraction constructor and statistics.mean() (and several other statistics functions) by using a private helper implemented in C which abstracts converting a number to an integer ratio. $ ./python -m timeit -s "from fractions

[issue37873] unittest: execute tests in parallel

2019-08-19 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +ezio.melotti, michael.foord ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37873] unittest: execute tests in parallel

2019-08-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: test.regrtest has a -j option. Perhaps some of the Python coding for that could be used for unitest also. -- nosy: +terry.reedy ___ Python tracker