[issue34122] inspect.getmembers does not retrive dataclass's __dataclass_fields__ properly

2018-07-15 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I think there is some note about this on the doc as below : https://docs.python.org/3/library/dataclasses.html#dataclasses.field . Relevant commit : 98d50cb8f57eb227c373cb94b8680b12ec8aade5 If the default value of a field is specified by a call to

[issue34122] inspect.getmembers does not retrive dataclass's __dataclass_fields__ properly

2018-07-15 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34122] inspect.getmembers does not retrive dataclass's __dataclass_fields__ properly

2018-07-15 Thread Dong-hee Na
New submission from Dong-hee Na : When I execute this script. import inspect from dataclasses import * import enum @dataclass class SimpleDataObject(object): field_a: int = field() field_b: str = "asdad" print([a[0] for a in inspect.getmembers(SimpleDataObject)]) I expected

[issue34121] configure fails to detect C11 atomic support on clang

2018-07-15 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset 8487ef61dea9fb0579f0be8f01d74fa20d3b8ed1 by Benjamin Peterson in branch '3.6': [3.6] bpo-34121: Fix detection of C11 atomic support on clang. (GH-8290) https://github.com/python/cpython/commit/8487ef61dea9fb0579f0be8f01d74fa20d3b8ed1

[issue34121] configure fails to detect C11 atomic support on clang

2018-07-15 Thread miss-islington
miss-islington added the comment: New changeset 3fc12f0e2ad9ba49243f5a43a8803018b2ff5904 by Miss Islington (bot) in branch '3.7': bpo-34121: Fix detection of C11 atomic support on clang. (GH-8288) https://github.com/python/cpython/commit/3fc12f0e2ad9ba49243f5a43a8803018b2ff5904 --

[issue21617] importlib reload can fail with AttributeError if module removed from sys.path

2018-07-15 Thread Brett Cannon
Brett Cannon added the comment: If there's no spec, Michael, then your work-around is the next best option (and reloading never actually replaces the actual module object or it's dict/global namespace because we don't know who is holding on to a reference). -- nosy: +ncoghlan

[issue21617] importlib reload can fail with AttributeError if module removed from sys.path

2018-07-15 Thread Michael Forbes
Michael Forbes added the comment: It seems that a reasonable workaround (if you generate your own `spec`) is to call `spec.loader.exec_module(mod)`. This seems to reload the module into the same namespace. (I was afraid that it might replace the namespace hence the desire to use

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-15 Thread Ammar Askar
Ammar Askar added the comment: Roger, personally I don't think its worth it to complicate the code in order to use the thread pool API. Especially considering this is just a private API and the only consumer will be the test suite runner. Let's see what the core devs think when this gets

[issue21617] importlib reload can fail with AttributeError if module removed from sys.path

2018-07-15 Thread Michael Forbes
Michael Forbes added the comment: What is the status of this issue? Is there a work-around? The 3.7 codebase raises an exception, but what is the correct solution for reloading a module that was loaded dynamically without modifying `sys.path`? -- nosy: +mforbes

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-15 Thread Jeremy Kloth
Jeremy Kloth added the comment: The RegisterWaitForSingleObject() function does use the thread pool API: https://docs.microsoft.com/en-us/windows/desktop/ProcThread/thread-pool-api However, PdhCollectQueryDataEx() also creates a user-space thread to handle its work of setting the event

[issue34121] configure fails to detect C11 atomic support on clang

2018-07-15 Thread Benjamin Peterson
Change by Benjamin Peterson : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue34121] configure fails to detect C11 atomic support on clang

2018-07-15 Thread Benjamin Peterson
Change by Benjamin Peterson : -- pull_requests: +7824 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34121] configure fails to detect C11 atomic support on clang

2018-07-15 Thread miss-islington
Change by miss-islington : -- pull_requests: +7823 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34121] configure fails to detect C11 atomic support on clang

2018-07-15 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset 15c7b2abdfb93f8902dd72474818aee2bf97fa66 by Benjamin Peterson in branch 'master': bpo-34121: Fix detection of C11 atomic support on clang. (GH-8288) https://github.com/python/cpython/commit/15c7b2abdfb93f8902dd72474818aee2bf97fa66

[issue34121] configure fails to detect C11 atomic support on clang

2018-07-15 Thread Benjamin Peterson
Change by Benjamin Peterson : -- keywords: +patch pull_requests: +7822 stage: -> patch review ___ Python tracker ___ ___

[issue34121] configure fails to detect C11 atomic support on clang

2018-07-15 Thread Benjamin Peterson
Change by Benjamin Peterson : -- components: +Build -Interpreter Core ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue34121] configure fails to detect C11 atomic support on clang

2018-07-15 Thread Benjamin Peterson
New submission from Benjamin Peterson : clang supports C11 atomic APIs just fine but Python's configure fails to detect it: configure:16529: checking for stdatomic.h configure:16545: clang -pthread -o conftestconftest.c -lpthread -ldl -lutil >&5 conftest.c:389:5: error: _Atomic cannot

[issue30400] Race condition in shutil.copyfile(): source file replaced file during copy

2018-07-15 Thread STINNER Victor
STINNER Victor added the comment: Python doesn't use FD of directories by default because it introduces issues of FD limit with deep directory tree, issue of managing FD lifetime, etc. That's why some API have one flavor for path and another for FD. --

[issue33120] infinite loop in inspect.unwrap(unittest.mock.call)

2018-07-15 Thread ppperry
Change by ppperry : -- type: crash -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33111] Merely importing tkinter breaks parallel code (multiprocessing, sharedmem)

2018-07-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: I was uncertain from Ethan's post what does work best. "endless errors with both 'spawn", "Only 'fork' works...but without graphics", "method='spawn'and ... does work". Do the 1st and 3rd sentences mean that spawn + graphics fails without the proper

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-15 Thread Ammar Askar
Ammar Askar added the comment: Is the function I used for the callback, RegisterWaitForSingleObject https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-registerwaitforsingleobject using the thread pooling system you're talking about underneath? The documentation seems to

[issue33111] Merely importing tkinter breaks parallel code (multiprocessing, sharedmem)

2018-07-15 Thread Ronald Oussoren
Ronald Oussoren added the comment: As I mentioned in msg314304 this is almost certainly expected behavior on macOS because Appleā€™s GUI frameworks are not fork()-safe. There is nothing we can do about this other than changing the default spawn mechanism for multiprocessing on macOS. -- On

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-15 Thread Jeremy Kloth
Jeremy Kloth added the comment: Correct. Windows provides the building blocks for implementing getloadavg(), but does not provide an interface that does the averaging. That is deferred to a per application basis. The best that an application can do for that is to use thread pools. You

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-15 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I suppose there is no way to emulate os.getloadavg() on Windows because that would necessarily imply using a thread to call the necessary routine (WMI, PDH, whatever...) every X secs or something, correct? --

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-15 Thread Jeremy Kloth
Jeremy Kloth added the comment: Not that it matters all that much, but from a terminology standpoint, WMI != PDH != Performance Counters. Performance counters (the objects, not the topic) are provided by DLLs registered in the HKLM\SYSTEM\CurrentControlSet\Services key. Their data is

[issue27741] datetime.datetime.strptime functionality description incorrect

2018-07-15 Thread Farhaan Bukhsh
Farhaan Bukhsh added the comment: Hey I would like to remove this bug I was going through the discussion so does that mean remove the about mentioned lines from https://docs.python.org/3/library/datetime.html#datetime.datetime.strptime will fix this issue? Or should we add some more

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-15 Thread Ammar Askar
Ammar Askar added the comment: Aah, yeah I don't think there's a good way of doing it purely from the windows API. There might be a way to enumerate through all the processes and see if they're queued up but I didn't look into it. In this case it should be fine, we just pay a bit of WMI

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-15 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > Giampaolo, on your psutil issue you specifically said, "(possibly without > using WMI)" Is there any particular problem with using WMI? Performance. In general WMI is (a lot) slower than the Windows API counterpart (psutil never uses WMI except in unit

[issue34120] IDLE Caret/Focus Lost

2018-07-15 Thread Vlad Tudorache
New submission from Vlad Tudorache : When closing the IDLE's Preferences dialog the IDLE's Console window and/or Editor window (whichever was active before) doesn't show cursor/caret any more. One must click on Desktop or another window then click again in the IDLE's window in order to

[issue34047] IDLE: on macOS, scroll slider 'sticks' at bottom of file

2018-07-15 Thread Vlad Tudorache
Vlad Tudorache added the comment: I can reproduce this problem only with Tk 8.6.7, both compiled by myself or installed from ActiveState (Python 3.7 and 3.6 compiled by myself, too). I can't see it with Tk 8.6.8 provided with the installers, nor with Tk 8.5.18. -- nosy: +vtudorache

[issue34112] 3.7.0 build error with --enable-optimizations

2018-07-15 Thread Jayanth Koushik
Jayanth Koushik added the comment: Updating gcc to 8.1.0 fixed the problem. -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker ___

[issue29710] Incorrect representation caveat on bitwise operation docs

2018-07-15 Thread Nick Coghlan
Nick Coghlan added the comment: OK, that makes sense to me. Given that, there'd be two changes proposed. 1. Replace the opening paragraph of https://docs.python.org/3/library/stdtypes.html#bitwise-operations-on-integer-types (the one I originally quoted when opening this issue) with the

[issue29710] Incorrect representation caveat on bitwise operation docs

2018-07-15 Thread Tim Peters
Tim Peters added the comment: Well, all 6 operations "are calculated as though carried out in two's complement with an infinite number of sign bits", so I'd float that part out of the footnote and into the main text. When, e.g., you're thinking of ints _as_ bitstrings, it's essentially

[issue34119] Able to name a variable as 'input'. This creates problem when using input() function.

2018-07-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: While "shadowing a builtin" was irritating in your case, it is an unavoidable part of how Python works and is in some cases considered a feature. FWIW, there is a workaround. You can reference the real input() function directly in the __builtins__

[issue34119] Able to name a variable as 'input'. This creates problem when using input() function.

2018-07-15 Thread Kishore Aadada
New submission from Kishore Aadada : When i used input as a variable name, there is no error provided. After that I am calling input() function to read data. In such case, below error is reported. Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)] on win32 Type