[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2018-03-16 Thread miss-islington
Change by miss-islington : -- pull_requests: +5890 ___ Python tracker ___

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2018-03-16 Thread miss-islington
Change by miss-islington : -- pull_requests: +5891 ___ Python tracker ___

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2018-03-16 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset c2b0b12d1a137ada1023ab7c10b8d9a0249d95f9 by Nick Coghlan (Marcel Plch) in branch 'master': bpo-32374: m_traverse may be called with m_state=NULL (GH-5140)

[issue33047] "RuntimeError: dictionary changed size during iteration" using trace.py module

2018-03-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Running on MacOs, I can't reproduce the failure. -- nosy: +rhettinger ___ Python tracker

[issue29270] super call in ctypes sub-class fails in 3.6

2018-03-16 Thread Asdger Gdsfe
Asdger Gdsfe added the comment: Hey 3.6 is pretty old now so can we get this patch merged I'd really like this code to start working again, appreciate all your hard work! class Something(ctypes.c_ulong): def __repr__(self): return super(Something, self).value

[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-03-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Ah wait, I appear to have misunderstood Raymond's request. Sorry Raymond! (I've been spending too much time teaching Pythagoras' theorem and my mind was primed to go directly from Euclidean distance to hypotenuse.) Not

[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-03-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: The obvious work-around of calling hypot multiple times is not only tedious, but it loses precision. For example, the body diagonal through a 1x1x1 cube should be √3 exactly: py> from math import hypot, sqrt py> hypot(hypot(1,

[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-16 Thread Nir Soffer
Nir Soffer added the comment: Attaching reproducer for os.fdopen() -- Added file: https://bugs.python.org/file47492/fdopen_nfs_test.py ___ Python tracker

[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-16 Thread Nir Soffer
Nir Soffer added the comment: Attaching reproducer for mmapobject.size() -- Added file: https://bugs.python.org/file47491/mmap_size_nfs_test.py ___ Python tracker

[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-16 Thread Nir Soffer
Nir Soffer added the comment: Antoine, thanks for fixing this on master! but I don't think this issue can be closed yet. First, the issue is not a performance but reliability. I probably made bad choice when I marked this as performance. When you call mmap.mmap() in one

[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-03-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: This was requested once before, but rejected. I would like to see that decision re-considered. https://bugs.python.org/issue1880 Some months ago, there was a very brief discussion started by Lawrence D’Oliveiro about this on the

[issue33047] "RuntimeError: dictionary changed size during iteration" using trace.py module

2018-03-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: I copied the three lines into a file, deleted '> ', added print('done'), and saved. I ran the file, on Windows 10, with installed 2.7, 3.5, 3.6, and repository 3.6, 3.7, and 3.8. No failures. Adrien, please retest by copying what you

[issue33055] bytes does not implement __bytes__()

2018-03-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: It is against Guido's general policy to add things not needed purely for consistency. Unless there is a compelling use case, I think this should be closed. FHTM: I don't think Serhiy posts on SO, so you might consider adding his answer to

[issue33049] itertools.count() confusingly mentions zip() and sequence numbers

2018-03-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Since I don't like "sequential numbers", let's opt for the "leave it alone" option :-) -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue33049] itertools.count() confusingly mentions zip() and sequence numbers

2018-03-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: I think 'sequential numbers' would be slightly better than 'sequence numbers'. To be, it better includes stepped and descending sequences. (Enough better that I would be willing to do the PR and merge.) Otherwise, I think leave it alone.

[issue33044] pdb from base class, get inside a method of derived class

2018-03-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: bugs.python.org is for issues about patching the Python docs or the CPython implementation, for future releases. Questions about using python/cpython should go to Q forums, such a python-list or Stackoverflow. -- nosy: +terry.reedy

[issue33091] ssl.SSLError: Invalid error code (_ssl.c:2217)

2018-03-16 Thread Alfred Krohmer
New submission from Alfred Krohmer : OpenSSL version: 1.1.0.g-1 OS: Arch Linux I'm creating an SSL socket like this: s = socket.create_connection((self.host, 443), 60) c = ssl.create_default_context() c.set_alpn_protocols(['spdy/2']) self.ss =

[issue33084] Computing median, median_high an median_low in statistics library

2018-03-16 Thread Luc
Luc added the comment: If we are trying to fix this, the behavior should be like computing the mean or harmonic mean with the statistics library when there are missing values in the data. At least that way, it is consistent with how the statistics library works when

[issue33088] Cannot pass a SyncManager proxy to a multiprocessing subprocess on Windows

2018-03-16 Thread Ned Deily
Change by Ned Deily : -- nosy: +davin, pitrou ___ Python tracker ___ ___ Python-bugs-list

[issue33053] Running a module with `-m` will add empty directory to sys.path

2018-03-16 Thread Ned Deily
Change by Ned Deily : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list

[issue33086] pip: IndexError

2018-03-16 Thread Eric V. Smith
Change by Eric V. Smith : -- status: open -> pending ___ Python tracker ___ ___

[issue33061] NoReturn missing from __all__ in typing.py

2018-03-16 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +5889 stage: -> patch review ___ Python tracker ___

[issue25410] Clean up and fix OrderedDict

2018-03-16 Thread Cheryl Sabella
Cheryl Sabella added the comment: Is this issue still relevant? -- nosy: +csabella ___ Python tracker ___

[issue33090] race condition between send and recv in _ssl with non-zero timeout

2018-03-16 Thread Robert Xiao
New submission from Robert Xiao : Environment: Several versions of Python (see below), macOS 10.12.6 The attached script creates an SSL echo server (fairly standard), connects to the server, and spawns a read and write thread. The write thread repeatedly shovels data into

[issue33087] No reliable clean shutdown method

2018-03-16 Thread Josh Rosenberg
Josh Rosenberg added the comment: To my knowledge, there is no safe way to do this for other threads for a reason. If you make all your worker threads daemons, then they will terminate with the main thread, but they won't perform cleanup actions. If you don't

[issue30940] Documentation for round() is incorrect.

2018-03-16 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: docs@python -> lisroach nosy: +lisroach ___ Python tracker ___

[issue32822] finally block doesn't re-raise exception if return statement exists inside

2018-03-16 Thread David Rebbe
David Rebbe added the comment: I'll have to look into this as I have yet to commit anything but I'll put it on my list of things to do. -- ___ Python tracker

[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-03-16 Thread Raymond Hettinger
New submission from Raymond Hettinger : A need for a distance-between-two-points function arises frequently enough to warrant consideration for inclusion in the math module. It shows-up throughout mathematics -- everywhere from simple homework problems for kids

[issue33053] Running a module with `-m` will add empty directory to sys.path

2018-03-16 Thread Jakub Wilk
Jakub Wilk added the comment: FWIW, this behavior is documented: https://docs.python.org/3/using/cmdline.html#cmdoption-m "As with the -c option, the current directory will be added to the start of sys.path." With the -c option, at least you could easily remove the sys.path

[issue33084] Computing median, median_high an median_low in statistics library

2018-03-16 Thread Maheshwar Kumar
Maheshwar Kumar added the comment: So From the above i am to conclude that removing np.nan is the best path to be taken? Also the above step is to be included in median_grouped as well right? -- ___ Python tracker

[issue33088] Cannot pass a SyncManager proxy to a multiprocessing subprocess on Windows

2018-03-16 Thread Jeff DuMonthier
New submission from Jeff DuMonthier : The following simple example code creates a started SyncManager and passes it as an argument to a subprocess started with multiprocessing.Process(). It works on Linux and Mac OS but fails on Windows. import multiprocessing

[issue33061] NoReturn missing from __all__ in typing.py

2018-03-16 Thread Guido van Rossum
Guido van Rossum added the comment: Yes please! Updating __all__ is too easy to forget. IIRC there are scripts that check for this but they are too strict. -- ___ Python tracker

[issue33061] NoReturn missing from __all__ in typing.py

2018-03-16 Thread Ivan Levkivskyi
New submission from Ivan Levkivskyi : This is clearly a bug. Would you like to make a PR? -- nosy: +levkivskyi ___ Python tracker

[issue33061] NoReturn missing from __all__ in typing.py

2018-03-16 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +gvanrossum ___ Python tracker ___ ___

[issue33087] No reliable clean shutdown method

2018-03-16 Thread Elliot Jenner
New submission from Elliot Jenner : Ptyhon lacks a reliable clean shutdown method. sys.exit(), which should be this method, does not reliably perform this function as it merely terminates the thread it is called from (duplicating the functionality of thread.exit()), exit()

[issue33086] pip: IndexError

2018-03-16 Thread Eric V. Smith
Eric V. Smith added the comment: You did not provide enough information for us to reproduce this problem. To see the kind of information we need, see for example https://leantesting.com/write-good-bug-report/ And if you already have determined this is a problem with pip,

[issue32476] Add concat functionality to ElementTree xpath find

2018-03-16 Thread Stefan Behnel
Stefan Behnel added the comment: I can't see why this should be restricted to attribute values and not text content in general. Therefore, I would suggest adding general support for functions, and making this only a special case. Otherwise, this would only solve a very

[issue33086] pip: IndexError

2018-03-16 Thread Gabriel Hearot
New submission from Gabriel Hearot : Traceback (most recent call last): File "setup.py", line 45, in classifiers=[] File "/usr/lib/python3.6/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.6/distutils/dist.py", line 955, in

[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Would it be worthwhile to show an example of a subclass that overrides or extends __new__? Elsewhere in Python, the usual technique for changing method defaults is for a subclass to override or extend the method in

[issue33084] Computing median, median_high an median_low in statistics library

2018-03-16 Thread Luc
Luc added the comment: Just to make sure we are focused on the issue, the reported bug is with the statistics library (not with numpy). It happens, when there is at least one missing value in the data and involves the computation of the median, median_low and median_high

[issue21018] [patch] added missing documentation about escaping characters for configparser

2018-03-16 Thread Arun Persaud
Arun Persaud added the comment: > @Arun.Persaud, would you be interested in converting your patch to a Github > pull request? sure, I'll give it a try. Arun -- ___ Python tracker

[issue29673] Some gdb macros are broken in 3.6

2018-03-16 Thread Marcel Plch
Marcel Plch added the comment: I have created a PR here - https://github.com/python/cpython/pull/6126 The problem was, indeed, change in the code structure. The macro checked for presence inside of PyEval_EvalFrame() using address of a neighbouring function. Also,

[issue29673] Some gdb macros are broken in 3.6

2018-03-16 Thread Marcel Plch
Change by Marcel Plch : -- keywords: +patch pull_requests: +5888 stage: -> patch review ___ Python tracker ___

[issue33084] Computing median, median_high an median_low in statistics library

2018-03-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, Mar 16, 2018 at 02:32:36PM +, Mark Dickinson wrote: > For what it's worth, NumPy gives a result of NaN for the median of an array > that contains NaNs: By default, R gives the median of a list containing either NaN or

[issue33036] test_selectors.PollSelectorTestCase failing on macOS 10.13.3

2018-03-16 Thread Ned Deily
Ned Deily added the comment: Glad you found the problem - and that it wasn't a Python bug! -- resolution: -> works for me status: open -> closed ___ Python tracker

[issue33036] test_selectors.PollSelectorTestCase failing on macOS 10.13.3

2018-03-16 Thread Nathan Henrie
Nathan Henrie added the comment: Update -- I found the following plist at `/Library/LaunchDaemons/limit.maxfiles.plist`: ```xml http://www.apple.com/DTDs/PropertyList-1.0.dtd;> Label limit.maxfiles ProgramArguments launchctl limit

[issue33084] Computing median, median_high an median_low in statistics library

2018-03-16 Thread Mark Dickinson
Mark Dickinson added the comment: > then the answer being 90 is correct,right? How do you deduce that? Why 90 rather than 85 (or 87.5, or some other value)? For what it's worth, NumPy gives a result of NaN for the median of an array that contains NaNs: >>>

[issue33084] Computing median, median_high an median_low in statistics library

2018-03-16 Thread Maheshwar Kumar
Maheshwar Kumar added the comment: Well if i dont consider np.nan as missing data and consider all other values then the answer being 90 is correct,right? -- ___ Python tracker

[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2018-03-16 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Hello, just a small reminder for this issue and the PR ;-) when you have time -- ___ Python tracker

[issue21611] int() docstring - unclear what number is

2018-03-16 Thread Cheryl Sabella
Change by Cheryl Sabella : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Documentation for int constructor mentions __int__ but not __trunc__ ___ Python tracker

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-16 Thread Matt Eaton
Matt Eaton added the comment: Jonathan, thank you very much for your thoughts I appreciate the pros and cons of each option. In regards to your option C, if we provided a flag to optionally raise the error in urlsplit and urlparse were you thinking the default flag to

[issue33057] logging.Manager.logRecordFactory is never used

2018-03-16 Thread Ben Feinstein
Ben Feinstein added the comment: General loggers are used in the standard way (message, args, etc), but data loggers are used for different types of data. Instead of message, they receive the experiment results (dict/list/np.array/binary data) and their `formatMessage()`

[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-16 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Apart from the fact that it's too late, if you had to do it over again, could it be done as a class decorator? Yes, this could be done as a decorator which would replace the original class with a named tuple after inspecting

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-16 Thread Jonathan
Jonathan added the comment: Interesting conversation As I see it, there are two ways to solve this, both discussed above: A) Python can compute and ValueError at parse-time B) Python can ValueError at property-call time. (Current method) But both have

[issue32328] ttk.Treeview: _tkinter.TclError: list element in quotes followed by "; " instead of space

2018-03-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > If the issue really boils down to incorrectly passing a single string when > there is only one item in 'values', and a single-item tuple should be used > instead, then shouldn't the better solution be for Python to handle this

[issue33083] math.factorial accepts non-integral Decimal instances

2018-03-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree. And I suggest also to deprecate accepting integral float instances. -- ___ Python tracker

[issue21611] int() docstring - unclear what number is

2018-03-16 Thread Dmitry Andreychuk
Dmitry Andreychuk added the comment: I created this issue almost 4 years ago. Looking at it now, I think that I was asking too much of that docstring. I believe it's current version quite sufficient. I would close the issue, but I'm not sure if it's up to me to decide.

[issue33084] Computing median, median_high an median_low in statistics library

2018-03-16 Thread Mark Dickinson
Mark Dickinson added the comment: > Will just removing all np.nan values do the job? Unfortunately, I don't think it's that simple. You want consistency across the various library calls, so if the various `median` functions are changed to treat NaNs as missing data, then

[issue33084] Computing median, median_high an median_low in statistics library

2018-03-16 Thread Maheshwar Kumar
Maheshwar Kumar added the comment: Will just removing all np.nan values do the job? Btw the values will be: median = 88.5 median_low = 85 median_high = 90 I can correct it and send a pull request. -- nosy: +maheshwark97 ___

[issue33073] Add as_integer_ratio() to int() objects

2018-03-16 Thread Nathaniel Smith
Nathaniel Smith added the comment: Sorry, I misspoke -- I meant he opened a related PR. The PR is to add as_integer_ratio to np.float16, np.float32, np.longdouble, not to add it to the numpy integer types. There are similar issues though. --

[issue33073] Add as_integer_ratio() to int() objects

2018-03-16 Thread Nathaniel Smith
Nathaniel Smith added the comment: Eric Wieser (added to CC) actually just opened a PR for this against NumPy: https://github.com/numpy/numpy/pull/10741 I have weak and mixed feelings about the whole thing: https://github.com/numpy/numpy/pull/10741#issuecomment-373637440

[issue33083] math.factorial accepts non-integral Decimal instances

2018-03-16 Thread Mark Dickinson
Mark Dickinson added the comment: I'd suggest that in the not-float branch of math_factorial, we use PyNumber_Index to catch integer-like things. (That would also be consistent with what we do in math_gcd.) -- ___ Python

[issue32328] ttk.Treeview: _tkinter.TclError: list element in quotes followed by "; " instead of space

2018-03-16 Thread Joshua Kinard
Joshua Kinard added the comment: I have to disagree rather strongly with closing this as "not a bug". If the issue really boils down to incorrectly passing a single string when there is only one item in 'values', and a single-item tuple should be used instead, then

[issue33085] *** Error in `python': double free or corruption (out): 0x00007ff5254d50d0 ***

2018-03-16 Thread chenkai
New submission from chenkai <13016135...@163.com>: When I finished the installation of readline (6.2.4.1) and then run python, it's crashed: *** Error in `python': double free or corruption (out): 0x7ff5254d50d0 *** === Backtrace: = /lib64/libc.so.6(+0x7c503)[0x7ff52416e503]