Re: IDLEX association

2016-11-18 Thread eryk sun
On Fri, Nov 18, 2016 at 7:09 PM, Dennis Lee Bieber wrote: > On Fri, 18 Nov 2016 04:46:46 -0800 (PST), Luis Marzulli > declaimed the following: > >>When I double click a .py file, a windows appears and immediately disappears. >>How can I associate

[issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Here is a patch implementing Eryk’s suggestion, for both from_buffer() and from_buffer_copy() methods. This is exactly how it is already handled for Array.from_address(). The two buffer methods were added more recently than from_address(). --

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-18 Thread STINNER Victor
STINNER Victor added the comment: New approach: patch 5 now compares indexgroup, groupindex and code instead of comparing pattern, to handle correctly two equal pattern strings compiled with the re.LOCALE flag and two different locales. The patch also converts indexgroup list to a tuple to be

[issue28548] http.server parse_request() bug and error reporting

2016-11-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7c98768368cb by Martin Panter in branch 'default': Issue #28548: Parse HTTP request version even if too many words received https://hg.python.org/cpython/rev/7c98768368cb -- nosy: +python-dev ___ Python

Re: How to append a modified list into a list?

2016-11-18 Thread Steve D'Aprano
On Sat, 19 Nov 2016 12:44 pm, jf...@ms4.hinet.net wrote: > I have a working list 'tbl' and recording list 'm'. I want to append 'tbl' > into 'm' each time when the 'tbl' was modified. I will record the change > by append it through the function 'apl'. [...] > Obviously the most intuitive way

[issue28548] http.server parse_request() bug and error reporting

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Okay committed to 3.7 for the moment. I think that is all we can reasonably do unless we drop the pseudo-HTTP-0.9 support. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python

Re: help on "from deen import *" vs. "import deen"

2016-11-18 Thread Steve D'Aprano
On Sat, 19 Nov 2016 05:50 am, Dennis Lee Bieber wrote: > Python's name binding is very easy to state in English: Assignment in > Python attaches the name (on the left hand side of the statement) to the > object (that is the result of the right hand side). What do you mean "attach"? What's a

[issue28681] About function renaming in the tutorial

2016-11-18 Thread Vedran Čačić
Vedran Čačić added the comment: Obligatory link: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ :-P Yes, Python objects are simpler than people, but still not completely trivial. The core issue is "who does the calling". Even one's native language might

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

2016-11-18 Thread Martin Blais
Martin Blais added the comment: Adding nullcontext = ExitStack in the source file would solve this problem in a single line of code. -- nosy: +blais ___ Python tracker

[issue28740] Add sys.getandroidapilevel()

2016-11-18 Thread Xavier de Gaye
Xavier de Gaye added the comment: > I proposed to add a new function to the sys module: sys.getandroidapilevel() This would also help fixing the long standing issue 16255, and possibly also issue 16353. -- ___ Python tracker

[issue20572] subprocess.Popen.wait() undocumented "endtime" parameter

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Thanks Mariatta. Some people like to use the warn(stacklevel=2) parameter, then the warning message is potentially more useful. Also, I think it would be good to write a brief test case for the warning. There are probably lots of examples in the test suite,

[issue20572] subprocess.Popen.wait() undocumented "endtime" parameter

2016-11-18 Thread Martin Panter
Changes by Martin Panter : -- stage: -> patch review versions: +Python 3.6, Python 3.7 ___ Python tracker ___

[issue10656] "Out of tree" build fails on AIX

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Okay I will assume that $(srcdir) reference was just due to a mistake or bad cargo-culting then. Will commit this soon unless anyone has a good idea to avoid embedding @abs_srcdir@. -- stage: patch review -> commit review

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

2016-11-18 Thread Nick Coghlan
Nick Coghlan added the comment: The problem Martin is referring to is the SEO one, which is that the top link when searching for either "null context manager python" or "no-op context manager python" is this thread, rather than the "Use ExitStack for that" recipe in the docs:

[issue28710] Sphinx incompatible markup in configparser.ConfigParser.

2016-11-18 Thread Patrick Lehmann
Patrick Lehmann added the comment: Hello, I used this regexp on all files: -- match pattern: `([A-Za-z0-9_]+)' replace pattern ``\1`` -- I assumed that only identifiers where quoted in such way. I think my editor found

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

2016-11-18 Thread Josh Rosenberg
Josh Rosenberg added the comment: Why is this unexpected? Per the docs, the process is: find the module specified in the from clause, loading and initializing it if necessary; for each of the identifiers specified in the import clauses: check if the imported module has an

[issue26865] Meta-issue: support of the android platform

2016-11-18 Thread Xavier de Gaye
Xavier de Gaye added the comment: issue #28740: Add sys.getandroidapilevel() -- dependencies: +Add sys.getandroidapilevel() ___ Python tracker ___

[issue28710] Sphinx incompatible markup in configparser.ConfigParser.

2016-11-18 Thread Patrick Lehmann
Patrick Lehmann added the comment: I signed the CLA. -- ___ Python tracker ___ ___ Python-bugs-list

Re: How to append a modified list into a list?

2016-11-18 Thread jfong
Oh, I don't know slice well enough:-( So, slice tbl[:] will create a new object (a copy of tbl) which can be passed as a function argument m.append(tbl[:]) or bind to a new name w=tbl[:] or re-bind to itself w[:]=tbl Thanks you, Ian and Steve. Steve D'Aprano at 2016/11/19 11:01:26AM wrote: >

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

2016-11-18 Thread woo yoo
New submission from woo yoo: I've experiment with the statement,however the result did not match the official description. I created a namespace package named l007, within which submodule named l009 was placed.I typed "from l007 import l009" in the interpreter, the execution was ok, while in

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

2016-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a problem to me too. -- nosy: +serhiy.storchaka ___ Python tracker ___

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

2016-11-18 Thread woo yoo
woo yoo added the comment: The link associated with the documentation is https://docs.python.org/3/reference/simple_stmts.html#import. My package layout is : --l007 --l009.py My code is : >from l007 import l009 The excution was ok, which was not the case i had expected. --

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

2016-11-18 Thread woo yoo
woo yoo added the comment: Thanks for your advice. -- nosy: -docs@python, steven.daprano ___ Python tracker ___

[issue28740] Add sys.getandroidapilevel()

2016-11-18 Thread Xavier de Gaye
Xavier de Gaye added the comment: Patch tested with success on the android-24 emulator. -- ___ Python tracker ___

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

2016-11-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Please don't post screen shots of text. Copy and paste the text into the bug report. Some people (those who are blind, visually impaired or using a screen-reader for some other reason) cannot see the screen shot, and even those who can prefer to deal with

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

2016-11-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: If you're quoting from the docs, its a good idea to give the URL to *which* documentation you are reading, not just a copy of the text. -- ___ Python tracker

Re: help on "from deen import *" vs. "import deen"

2016-11-18 Thread Chris Angelico
On Sat, Nov 19, 2016 at 3:34 PM, Steve D'Aprano wrote: > What happens if you do this? > > spam = eggs = cheese = obj > > Is that different from: > > spam = obj > eggs = obj > cheese = obj > > > or from this? > > spam = obj > eggs = spam > cheese = eggs > ... > These

Style().configure don't works for all widgets

2016-11-18 Thread Luis Marzulli
Hi Why ttk.Style().configure(".", font=('Courier New', 30, "bold")) works for Button and Label widgets (and maybe others) and don't works for Entry widget? Example in Python 3: from tkinter import * from tkinter import ttk from tkinter import font root = Tk() ttk.Style().configure(".",

[issue28733] Show how to use mock_open in modules other that __main__

2016-11-18 Thread Michał Bultrowicz
New submission from Michał Bultrowicz: Documentation of mock_open doesn't say how to use it in real-life test situations (when you're probably not mocking in __main__). I've spent some time scratching my head and googling for the way to mock-out the "open" function, want to spare other people

Encountering fatal error x80070643 while installing Python

2016-11-18 Thread Irene Venditti
Hi everybody, I've got a problem with the installation of Python. I am a translator and currently I'm translating a book on programming Minecraft with Python, from English to Dutch. My computer is a Windows 10 computer, 64-bits (Toshiba Qosmio all in one). I already had a 2.7 version of

NumPy 1.12.0b1 released.

2016-11-18 Thread Charles R Harris
Hi All, I'm pleased to annouce the release of NumPy 1.12.0b1. This release supports Python 2.7 and 3.4 - 3.6 and is the result of 388 pull requests submitted by 133 contributors. It is quite sizeable and rather than put the release notes inline I've attached them as a file and they may also be

[issue28731] _PyDict_NewPresized() creates too small dict

2016-11-18 Thread STINNER Victor
STINNER Victor added the comment: Ok, it's an optimization, not a performance regression of Python 3.6. In this case, I suggest to first push the change to Python 3.7, and after 3.6.0 release, backport to 3.6 (if you want to), and maybe even 3.5 if it makes sense (and if you want). I didn't

[issue26928] _bootlocale imports locale at startup on Android, causing test_site to fail

2016-11-18 Thread STINNER Victor
STINNER Victor added the comment: In Python, the most important functions are Py_DecodeLocale() and Py_EncodeLocale() which use mbstowcs() and wvstombs(). -- ___ Python tracker

[issue28732] spawnl crash on windows7

2016-11-18 Thread STINNER Victor
STINNER Victor added the comment: I like the idea of using _Py_BEGIN_SUPPRESS_IPH, but also the idea of implementing most obvious checks on arguments. Sadly, I don't have access to Windows yet to write such patch. Eryk, if you write such patch, I would be happy to review it ;-) Especially if it

[issue28731] _PyDict_NewPresized() creates too small dict

2016-11-18 Thread INADA Naoki
New submission from INADA Naoki: _PyDict_NewPresized(6) creates dict which keysize is 8. But it's capacity is 5 (8 * 2 // 3 = 5). This internal API is used by BUILD_MAP and BUILD_CONST_KEYMAP. -- assignee: inada.naoki files: PyDict_NewPresized-too-small.patch keywords: patch messages:

[issue28731] _PyDict_NewPresized() creates too small dict

2016-11-18 Thread INADA Naoki
INADA Naoki added the comment: This patch includes fix for ESTIMATE_SIZE macro. (see below) Same fix is included in patch for issue28147. >>> def estimate_size(n): ... return n * 3 // 2 # Current ESTIMATE_SIZE ... >>> def usable(n): ... return n * 2 // 3 ... >>> def keysize(minsize):

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-18 Thread STINNER Victor
STINNER Victor added the comment: > '[abc]' and '[cba]' are compiled to the same code. Do we want to handle them > as equal? Comparison must be fast. If the comparison is just memcmp(code1, code2, codesize), it's ok. I agree that we must put a similar somewhere to say that some parts are

[issue28732] spawnl crash on windows7

2016-11-18 Thread srinivasaraoMaddukuri
New submission from srinivasaraoMaddukuri: in window7 (using python 3.4.3,3.5.2) following script crashes import os os.spawnl( os.P_NOWAIT, 'C:/Tcl/bin/tclsh.exe' )" Note: similar issue is already exist https://bugs.python.org/issue8036 -- components: Interpreter Core messages:

[issue28732] spawnl crash on windows7

2016-11-18 Thread srinivasaraoMaddukuri
srinivasaraoMaddukuri added the comment: small correction (removed " ) import os os.spawnl( os.P_NOWAIT, 'C:/Tcl/bin/tclsh.exe' ) -- ___ Python tracker

[issue28732] spawnl crash on windows7

2016-11-18 Thread STINNER Victor
STINNER Victor added the comment: Just to make sure: a crash means that the Python process is killed and you get a popup or something like that? Can you please try to run the script on Python 3.6 using: python.exe -X faulthandler script.py It should display the Windows error code at least.

[issue28732] spawnl crash on windows7

2016-11-18 Thread STINNER Victor
Changes by STINNER Victor : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker

[issue28731] _PyDict_NewPresized() creates too small dict

2016-11-18 Thread INADA Naoki
INADA Naoki added the comment: current: $ ~/work/python36/bin/python3 -m perf timeit -- 'd = {"a":1, "b":2, "c":3, "d":4, "e":5, "f":6}' . Median +- std dev: 925 ns +- 49 ns patched: $ ~/work/python36/bin/python3 -m perf timeit -- 'd = {"a":1, "b":2, "c":3, "d":4, "e":5,

[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-18 Thread Jeff Reback
Jeff Reback added the comment: ok thanks for the info. fixed in pandas here: https://github.com/pandas-dev/pandas/pull/14689 is this documented in the whatsnew? -- ___ Python tracker

[issue26273] Expose TCP_CONGESTION and TCP_USER_TIMEOUT to the socket module

2016-11-18 Thread Jelte Fennema
Jelte Fennema added the comment: Is there any issue in merging this? TCP_USER_TIMEOUT is quite useful, for automatic failover of connections that suddenly died. -- nosy: +JelteF ___ Python tracker

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I see two options: * Compare flags, isbytes and code. This makes some different patterns be compiled to equal objects. For example spaces in verbose mode are ignored. But this don't make equal all equivalent patterns. '[aA]' would be equal to '(?:a|A)' but

[issue26928] _bootlocale imports locale at startup on Android, causing test_site to fail

2016-11-18 Thread Xavier de Gaye
Xavier de Gaye added the comment: Patch that follows closely the conditionals in the __bootlocale module. -- stage: patch review -> commit review Added file: http://bugs.python.org/file45530/skip_test_2.patch ___ Python tracker

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is a problem with locale-depending flags. The same pattern may be compiled with the LOCALE flag to different pattern objects in different locales. Perhaps we should compare the compiled code instead of pattern strings. Or both. --

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-18 Thread STINNER Victor
STINNER Victor added the comment: Serhiy: "There is a problem with locale-depending flags. The same pattern may be compiled with the LOCALE flag to different pattern objects in different locales." Oh, I didn't know and you are right. "Perhaps we should compare the compiled code instead of

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: '[abc]' and '[cba]' are compiled to the same code. Do we want to handle them as equal? This is implementation defined. -- ___ Python tracker

[issue28724] Add method send_io, recv_io to the socket module.

2016-11-18 Thread INADA Naoki
INADA Naoki added the comment: FYI, multiprocessing.reduction module has send_fds and recv_fds. -- nosy: +inada.naoki ___ Python tracker ___

[issue26928] _bootlocale imports locale at startup on Android, causing test_site to fail

2016-11-18 Thread STINNER Victor
STINNER Victor added the comment: > The problem is caused by the fact that android does not have HAVE_LANGINFO_H > and CODESET set Hum, is it possible to get the locale encoding by another way? If not, what is the locale encoding? Does Android provide mbstowcs() and wcstombs() functions?

[issue20572] subprocess.Popen.wait() undocumented "endtime" parameter

2016-11-18 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks, Martin :) Attached is the patch where deprecation warning is emitted if endtime argument is passed. Let me know if this works. Thanks :) -- keywords: +patch Added file: http://bugs.python.org/file45532/issue20572.patch

[issue26928] _bootlocale imports locale at startup on Android, causing test_site to fail

2016-11-18 Thread STINNER Victor
STINNER Victor added the comment: If it is not possible to change the locale, it makes sense to hardcode utf8. Note: to avoid mojibake, it's better if sys.getfilesystemencoding() and locale.getpreferredencoding(False) are equal. I understand that both must be utf8. --

[issue28731] _PyDict_NewPresized() creates too small dict

2016-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The condition in the loop in _PyDict_NewPresized() contains the test newsize > 0. This is a check for integer overflow. But it doesn't make much sense. First, the overflow is undefined behavior, and it is too late to detect it when it already is happen.

[issue28731] _PyDict_NewPresized() creates too small dict

2016-11-18 Thread INADA Naoki
INADA Naoki added the comment: inada-n@test1:~/work/py36$ ~/local/py36/bin/patched -m perf timeit --compare-to ~/local/py36/bin/master -- 'd = {"a":1, "b":2, "c":3, "d":4, "e":5, "f":6}' master: . 910 ns +- 49 ns patched: . 713 ns +- 26 ns Median +- std

[issue28731] _PyDict_NewPresized() creates too small dict

2016-11-18 Thread INADA Naoki
INADA Naoki added the comment: Python 3.5 has similar issue: $ ~/local/py35/bin/patched -m perf timeit --compare-to ~/local/py35/bin/master -- 'd = {"a":1, "b":2, "c":3, "d":4, "e":5, "f":6}' master: . 1.15 us +- 0.09 us patched: . 885 ns +- 37 ns Median

[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It seems to me that this is not documented. I'm even not sure that this change is compatible. Additional bit is saved only with protocol 4. The default protocol is 3, thus your should explicitly specify it. But protocol 4 is supported since 3.4. It seems to

[issue26928] _bootlocale imports locale at startup on Android, causing test_site to fail

2016-11-18 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Seems Android/BioniC always uses UTF-8: https://android.googlesource.com/platform/bionic/+/master/libc/bionic/mbrtoc32.cpp#83 -- nosy: +Chi Hsuan Yen ___ Python tracker

[issue28731] _PyDict_NewPresized() creates too small dict

2016-11-18 Thread STINNER Victor
STINNER Victor added the comment: FYI if you rename Python binaries, you can use: ./python-patched perf timeit --compare-to=./python-orig -- ___ Python tracker

[issue28731] _PyDict_NewPresized() creates too small dict

2016-11-18 Thread STINNER Victor
STINNER Victor added the comment: > Median +- std dev: 925 ns +- 49 ns > Median +- std dev: 726 ns +- 30 ns Nice speedup. Can you please compare Python 3.5? Better if you compile it yourself with the same options. I'm curious if 925 ns is slower than py3.5 or if 726 ns is faster than py3.5.

[issue26928] _bootlocale imports locale at startup on Android, causing test_site to fail

2016-11-18 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: There are some locale strings supported in setlocale(): https://android.googlesource.com/platform/bionic/+/master/libc/bionic/locale.cpp#104. However, seems mbstowcs just ignores such a setting on Android. Here's an example: #include #include #include

IDLEX association

2016-11-18 Thread Luis Marzulli
Hi When I double click a .py file, a windows appears and immediately disappears. How can I associate the .py file extension to the IDLEX EDITOR? Thanks -- https://mail.python.org/mailman/listinfo/python-list

[issue28732] spawnl crash on windows7

2016-11-18 Thread Eryk Sun
Eryk Sun added the comment: spawnl is implemented by calling _spawnv [1], which is documented to invoke the invalid parameter handler if argv points to a NULL pointer. It wants the program name, or whatever, as long as argv[0] isn't NULL or an empty string, e.g. `os.spawnl(os.P_NOWAIT,

[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > On Nov 18, 2016, at 7:04 AM, Serhiy Storchaka wrote: > > Yet one doubtful detail is that the fold bit is added to the hour bit in > datetime.time, but to the month field in datetime.datetime. The reason behind this choice is

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-18 Thread STINNER Victor
STINNER Victor added the comment: Ok, I hope that it's the last attempt: patch 5 * Remove hash(b) != hash(a): only keep tests on hash(b)==hash(a) when b==a * Replace re.ASCII flag with no flag to test two patterns with different flags -- Added file:

Re: how to simulate the situation in DNA evolution for finding the minimum population needed and minimum samples selected to mating in order to no extinction in any one of original species and new spe

2016-11-18 Thread meInvent bbird
i noticed the faces of human repeated or similar, and would like to prove whether evolution a several generations will return to the original intelligence of ancester On Friday, November 18, 2016 at 1:55:31 PM UTC+8, meInvent bbird wrote: > how to simulate the situation in DNA evolution for

[issue20572] subprocess.Popen.wait() undocumented "endtime" parameter

2016-11-18 Thread Martin Panter
Martin Panter added the comment: I think other people wanted to add an automated deprecation warning in the code first, before removing it. -- nosy: +martin.panter ___ Python tracker

Re: Can signal.alarm be safely cleared in python?

2016-11-18 Thread Chris Angelico
On Fri, Nov 18, 2016 at 7:51 PM, dieter wrote: > Pedro Franco de Carvalho writes: > >> Assume a python program sets a handler function for the >> `signal.SIGALRM` signal, and then schedules an alarm in T seconds with >> `signal.alarm(T)`. >> >> Assume the

Re: Can signal.alarm be safely cleared in python?

2016-11-18 Thread dieter
Pedro Franco de Carvalho writes: > Assume a python program sets a handler function for the > `signal.SIGALRM` signal, and then schedules an alarm in T seconds with > `signal.alarm(T)`. > > Assume the program later cancels any scheduled alarm with `signal.alarm(0)`. I do not

[issue20572] subprocess.Popen.wait() undocumented "endtime" parameter

2016-11-18 Thread Martin Panter
Changes by Martin Panter : Removed file: http://bugs.python.org/file42579/downloadfile.htm ___ Python tracker ___

<    1   2