[issue27396] Change default filecmp.cmp shallow option

2016-06-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: The docs are already pretty clear. In general, there isn't a defense against a naive use of anything in the computing world. We can write docs but can't make a person read them and realize that their pre-existing mental model is off base. Sorry, but I'm

Re: argparse and subparsers

2016-06-26 Thread Lawrence D’Oliveiro
On Monday, June 27, 2016 at 4:56:10 PM UTC+12, Sachin Garg wrote: > # Set verbose flag > verbose = False > if arguments['--verbose']: > verbose = True > elif arguments['-q']: > verbose = False Don’t you just love code (and commenting) like this... --

[issue27396] Change default filecmp.cmp shallow option

2016-06-26 Thread Gabriel Hackebeil
Gabriel Hackebeil added the comment: All good points. Perhaps further emphasis on this in the documentation would be helpful to. As it stands, this module is a dangerous one for a naive user (like me) to stumble across. Maybe introducing an “exact” or “slow" diff function to the module would

[issue27255] More opcode predictions

2016-06-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: The second version of the patch mostly looks fine. The prediction from DUP_TOP_TWO to BINARY_SUBSCR is questionable. Because compile.c only uses it one context, the prediction rate is 100%; however, there is no intrinsic relationship between the two

[issue27173] Modern Unix key bindings for IDLE

2016-06-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I can't reproduce your issue (or understand it correctly). Could you please show the [Keys] section in your config-main.cfg? -- ___ Python tracker

[issue27397] email.message.Message.get_payload(decode=True) raises AssertionError that "should never happen"

2016-06-26 Thread Claudiu Saftoiu
Claudiu Saftoiu added the comment: See attached another file with more test cases. -- Added file: http://bugs.python.org/file43557/bugreport_moretests.py ___ Python tracker

Re: argparse and subparsers

2016-06-26 Thread Sachin Garg
On Sunday 26 June 2016 02:51 PM, Joseph L. Casale wrote: > I have some code where sys.argv is sliced up and manually fed to discrete > argparse > instances each with a single subparser. The reason the discrete parsers all > having a > single subparser was to make handling the input simpler, the

[issue27397] email.message.Message.get_payload(decode=True) raises AssertionError that "should never happen"

2016-06-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> r.david.murray nosy: +r.david.murray priority: normal -> high ___ Python tracker

[issue27380] IDLE: add base Query dialog with ttk widgets

2016-06-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You can use True and False instead of TRUE and FALSE. You can import constants with "from tkinter.constants import *". The benefit of using constants instead of string literals is early failing in case of typo. -- nosy: +serhiy.storchaka

[issue27397] email.message.Message.get_payload(decode=True) raises AssertionError that "should never happen"

2016-06-26 Thread Claudiu Saftoiu
New submission from Claudiu Saftoiu: I'm processing Yahoo! Groups backup archives, and came across an email message which causes the `.get_payload(decode=True)` step to raise an AssertionError. Particularly, the following exception is raised in `lib/python3.5/email/_encoded_words.py`, line

Language improvement: Get more from the `for .. else` clause

2016-06-26 Thread Victor Savu
tl;dr: 1. Add `StopAsyncIteration.value`, with the same semantic as `StopIteration.value` (documented in PEP 380). 2. Capture `StopIteration.value` and StopAsyncIteration.value in the `else` clauses of the `for` and `async for` statements respectively. Note: I already have a

Re: Question on compiling on linux

2016-06-26 Thread Zachary Ware
On Saturday, June 25, 2016, Steven Truppe wrote: > > i hope this email works like you expected! Not quite, but closer. You've quoted me properly, but you added your reply above the quote, so-called "top-posting". A: Because you have to read things in reverse order. Q:

[issue27396] Change default filecmp.cmp shallow option

2016-06-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: Changing an existing API is painful, especially so for cases like this that have existed for a very, very long time. Such as a change would likely have a detrimental effect on long-standing code relying on the existing behavior. The module itself is all

Re: Operator Precedence: One Thing Python Got Right

2016-06-26 Thread Steven D'Aprano
On Mon, 27 Jun 2016 02:20 pm, Lawrence D’Oliveiro wrote: > There is one thing Python did not slavishly copy from C. Only one? -- Steven “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. --

[issue23804] SSLSocket.recv(0) receives up to 1024 bytes

2016-06-26 Thread Martin Panter
Martin Panter added the comment: This was not fixed properly. The first symptom is that recv(0) etc still blocks if the other end sends no data. The second symptom is that it does not work with suppress_ragged_eofs=False. The problem is SSL is still called to do a read, which returns zero,

Operator Precedence: One Thing Python Got Right

2016-06-26 Thread Lawrence D’Oliveiro
There is one thing Python did not slavishly copy from C. While it has (mostly) the same operators, and exclusively adopted the iso646 names for the Boolean operators (which you can also use in C and C++, by the way, but not Java), it made a slight tweak to the operator precedence rules

Re: Empty List

2016-06-26 Thread Christopher Reimer
On 6/26/2016 8:13 PM, Elizabeth Weiss wrote: Hi There, What is the point of this code?: word=[] print(word) The result is [] When would I need to use something like this? Thank you! Sometimes you need to assign an empty list to a variable prior to using it in a looping structure.

Re: Empty List

2016-06-26 Thread Steven D'Aprano
On Mon, 27 Jun 2016 01:13 pm, Elizabeth Weiss wrote: > Hi There, > > What is the point of this code?: > > word=[] > print(word) > > The result is [] > > When would I need to use something like this? As given, never. Nor would you need: num = 0 print(num) It's pretty boring, trivial code

Re: argparse and subparsers

2016-06-26 Thread Lawrence D’Oliveiro
On Monday, June 27, 2016 at 6:56:41 AM UTC+12, Joseph L. Casale wrote: > This has become unmaintainable as the manual slicing is always subject > to a new case by where a parser has a positional, switch or optional > parameter for example. Also, since argv is grouped by subparser > specifiers, if

Empty List

2016-06-26 Thread Elizabeth Weiss
Hi There, What is the point of this code?: word=[] print(word) The result is [] When would I need to use something like this? Thank you! -- https://mail.python.org/mailman/listinfo/python-list

Re: Can math.atan2 return INF?

2016-06-26 Thread Steven D'Aprano
On Mon, 27 Jun 2016 09:08 am, Gregory Ewing wrote: > Marko Rauhamaa wrote: >>>The singularity being talked about there is an artifact of a >>>particular coordinate system; the theory predicts that there is no >>>*physical* singularity at the event horizon. >> >> That theory can't be tested even

[issue26867] test_ssl test_options fails on ubuntu 16.04

2016-06-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4d04aca4afb0 by Matthias Klose in branch '3.5': Issue #26867: Ubuntu's openssl OP_NO_SSLv3 is forced on by default; fix test. https://hg.python.org/cpython/rev/4d04aca4afb0 New changeset 8f028d04df11 by Matthias Klose in branch '3.4': Issue #26867:

[issue26930] Upgrade installers to OpenSSL 1.0.2h

2016-06-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset e1e5691d02d8 by Zachary Ware in branch '3.5': Issue #26930: Update Windows build to OpenSSL 1.0.2h https://hg.python.org/cpython/rev/e1e5691d02d8 -- ___ Python tracker

[issue27365] Allow non-ascii chars in IDLE NEWS.txt (for contributor names)

2016-06-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset 30e563e2702e by Terry Jan Reedy in branch '3.5': Issue #27365: Allow non-ascii in idlelib/NEWS.txt - minimal part for 3.5.2. https://hg.python.org/cpython/rev/30e563e2702e -- ___ Python tracker

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Martin Panter
Martin Panter added the comment: Code samples in the documentation should also be fixed, like at . I think you can run “make -C Doc doctest” or something similar, which may help find some of these. Also, playing with your current patch, it

Re: Getting back into PyQt and not loving it.

2016-06-26 Thread Michael Torrie
On 06/26/2016 07:05 PM, llanitedave wrote: > Not sure that wxPython is really any different in that respect, and > Tkinter doesn't feel Pythonic to me, either -- considering how it's > Tk at heart. So what's the alternative? There really is no good > Python-based GUI tool, and that's a shame.

[issue22079] Ensure in PyType_Ready() that base class of static type is static

2016-06-26 Thread Xiang Zhang
Xiang Zhang added the comment: Oh yes. The mro list can be customized so we can not even guarantee the type appears at index 0 and object at index n-1. It seems we should still keep what it is now, iterating the whole mro list. Sorry that my previous comments seem to be noise. But maybe we

Re: Getting back into PyQt and not loving it.

2016-06-26 Thread MRAB
On 2016-06-27 02:05, llanitedave wrote: On Sunday, June 26, 2016 at 2:45:18 PM UTC-7, Michael Torrie wrote: I'm starting to question the advice I gave not long ago to for new users to consider the Qt toolkit with Python. I just did a little project porting a simple graphical user interface

[issue27380] IDLE: add base Query dialog with ttk widgets

2016-06-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: Pushed with minor changes. I decided not to wait until I added more subclasses because file renames with post rename changes do not survive shelving. Reloading from the diff requires 'rediscovering' the renames. -- Added file:

[issue27380] IDLE: add base Query dialog with ttk widgets

2016-06-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4796d7fb00c5 by Terry Jan Reedy in branch 'default': Issue #27380: IDLE: add base Query dialog, with ttk widgets and subclass https://hg.python.org/cpython/rev/4796d7fb00c5 -- nosy: +python-dev ___

[issue27396] Change default filecmp.cmp shallow option

2016-06-26 Thread Gabriel Hackebeil
New submission from Gabriel Hackebeil: I would like to propose changing the default setting for the shallow compare option in filecmp.cmp to False (or providing access an exact comparison function that does not use various performance optimizations). I think many users will turn to this

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Emanuel Barry
Emanuel Barry added the comment: Indeed, we did, thanks for letting me know my mistake :) I didn't get very far into making bytes literal disallow invalid sequences, as I ran into issues with _codecs.escape_decode throwing the warning even when the literal was fine, and I think I stopped

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Martin Panter
Martin Panter added the comment: Hah, we posted the same fix almost at the same time :) -- ___ Python tracker ___

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Martin Panter
Martin Panter added the comment: Hello Emanual, I think I have fixed your problem with -Werror, by handling the exception returned by PyErr_WarnFormat() (see my patch). Thanks for separating the actual change from the escape violation fixes; it made it easier to spot the real problem :)

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Emanuel Barry
Emanuel Barry added the comment: Aaand I feel pretty stupid; I didn't check the return value of PyErr_WarnFormat, so it was my mistake. Attached new patch, actually done right this time. -- Added file: http://bugs.python.org/file43552/deprecate_invalid_escapes_only_2.patch

Re: Getting back into PyQt and not loving it.

2016-06-26 Thread Rustom Mody
On Monday, June 27, 2016 at 6:35:31 AM UTC+5:30, llanitedave wrote: > So what's the alternative? There really is no good Python-based GUI tool, > and that's a shame. The last time Ranting Rick made a big rant about this (saying wxpython should replace tkinter in core CPython) everyone took

[issue27394] Crash with compile returning a value with an error set

2016-06-26 Thread Emanuel Barry
Emanuel Barry added the comment: Nevermind, my mistake. -- resolution: -> not a bug stage: needs patch -> resolved status: open -> closed type: crash -> ___ Python tracker

[issue27395] Increase test coverage of unittest.runner.TextTestResult

2016-06-26 Thread Pam McA'Nulty
New submission from Pam McA'Nulty: While working on another issue, I added a test to increase (low-hanging fruit) test coverage in unittest.runner.TextTestResult -- components: Tests files: textresult_coverage.patch keywords: patch messages: 269330 nosy: Pam.McANulty priority: normal

Re: Getting back into PyQt and not loving it.

2016-06-26 Thread llanitedave
On Sunday, June 26, 2016 at 2:45:18 PM UTC-7, Michael Torrie wrote: > I'm starting to question the advice I gave not long ago to for new users > to consider the Qt toolkit with Python. > > I just did a little project porting a simple graphical user interface > from GTK+ to Qt (PyQt4 for now as

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Emanuel Barry
Emanuel Barry added the comment: Ah right, assert() is only enabled in debug mode, I forgot that. My (very uneducated) guess is that compile() got the error (which was a warning) but then decided to return a value anyway, and the next thing that tries to call anything crashes Python. I opened

[issue27394] Crash with compile returning a value with an error set

2016-06-26 Thread Emanuel Barry
New submission from Emanuel Barry: My trivial patch exposed a bug in the ast/compiler, where compile() would return a value and set an exception. See http://bugs.python.org/issue27364#msg269323 for more information and steps to reproduce. I looked a bit into it, but I don't know enough about

[issue27173] Modern Unix key bindings for IDLE

2016-06-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: The change in v4 is the addition of self.AddChangedItem('main', 'Keys', 'name2', '') There is a bug in the get keys function. After applying, when I restart IDLE and go to 'Keys', my custom key set is 'Modern Unix' instead of 'Terry'. It is still

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, if you manage to trigger an assert() in the C code by writing some evil Python code, the C code is considered broken (unless it was using ctypes or one or two other explicit "void-the-warranty" exceptions). Maybe someone who has worked more with the C

Re: Assignment Versus Equality

2016-06-26 Thread Gregory Ewing
Christopher Reimer wrote: How can you not use chained assignments? I thought Python was the art of the clever one-liners. :) No, Python is the art of writing clever one-liners using more than one line. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

[issue27051] Create PIP gui

2016-06-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: With respect to threading: I have close to 0 experience. I know that tkinter is supposed to be 'thread-safe' (Martin Loewis) and that people have real problems mixing threads with tkinter. If you can create a minimal complete verifiable example (SO MCVE),

Re: Assignment Versus Equality

2016-06-26 Thread Gregory Ewing
BartC wrote: I did a year of it in the 1970s. Looks funny in lower case though. It's interesting how our perceptions of such things change. Up until my second year of university, my only experiences of computing had all been in upper case. Then we got a lecturer who wrote all his Pascal on the

Re: Assignment Versus Equality

2016-06-26 Thread BartC
On 27/06/2016 00:22, Gregory Ewing wrote: BartC wrote: On 26/06/2016 08:36, Lawrence D’Oliveiro wrote: One of Python’s few mistakes was that it copied the C convention of using “=” for assignment and “==” for equality comparison. One of C's many mistakes. Unfortunately C has been very

Re: Assignment Versus Equality

2016-06-26 Thread Gregory Ewing
BartC wrote: On 26/06/2016 08:36, Lawrence D’Oliveiro wrote: One of Python’s few mistakes was that it copied the C convention of using “=” for assignment and “==” for equality comparison. One of C's many mistakes. Unfortunately C has been very influential. I'm not sure it's fair to call it

[issue27051] Create PIP gui

2016-06-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: Upendra, with respect to the error installing timingwheel, msg268983, that looks like a bug in timingwheel. Report it to the pip or timingwheel list or tracker. I ran the command normally and got the same exception, with less noise. It is not a problem

Re: Can math.atan2 return INF?

2016-06-26 Thread Gregory Ewing
Marko Rauhamaa wrote: The singularity being talked about there is an artifact of a particular coordinate system; the theory predicts that there is no *physical* singularity at the event horizon. That theory can't be tested even in principle, can it? Therefore, it is not scientific. It can in

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Emanuel Barry
Emanuel Barry added the comment: I originally considered making two different patches, so there you go. deprecate_invalid_escapes_only_1.patch has the deprecation plus a test, and invalid_stdlib_escapes_1.patch fixes all invalid escapes in the stdlib. My code was the cause, although no

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Emanuel Barry
Changes by Emanuel Barry : Added file: http://bugs.python.org/file43550/invalid_stdlib_escapes_1.patch ___ Python tracker ___

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Guido van Rossum
Guido van Rossum added the comment: I am okay with making it a silent warning. Can we do it in two stages though? It doesn't have to be two releases, I just mean two separate commits: (1) fix all places in the stdlib that violate this principle; (2) separately commit the code that causes the

[issue23401] Add pickle support of Mapping views

2016-06-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue27173] Modern Unix key bindings for IDLE

2016-06-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue22890] StringIO.StringIO pickled in 2.7 is not unpickleable on 3.x

2016-06-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is the _compat_pickle module that purposed to support backward and forward compatibility for renamed or moved classes and modules. StringIO.StringIO in 2.x corresponds to io.StringIO or io.BytesIO. The problem is that we can't determine what of

[issue27372] Test_idle should stop changing locale

2016-06-26 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

Getting back into PyQt and not loving it.

2016-06-26 Thread Michael Torrie
I'm starting to question the advice I gave not long ago to for new users to consider the Qt toolkit with Python. I just did a little project porting a simple graphical user interface from GTK+ to Qt (PyQt4 for now as that's what I have installed). For the most part it worked out pretty well.

[issue27372] Test_idle should stop changing locale

2016-06-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3ffdb9277054 by Terry Jan Reedy in branch 'default': Issue 27372: Stop test_idle from changing locale, so test passes. https://hg.python.org/cpython/rev/3ffdb9277054 -- nosy: +python-dev ___ Python

[issue27372] Test_idle should stop changing locale

2016-06-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: Added a couple of blank lines and expanded a comment. -- ___ Python tracker ___

[issue23401] Add pickle support of Mapping views

2016-06-26 Thread Guido van Rossum
Guido van Rossum added the comment: Please close. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue23401] Add pickle support of Mapping views

2016-06-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Can this issue be closed? -- ___ Python tracker ___ ___ Python-bugs-list

[issue27372] Test_idle should stop changing locale

2016-06-26 Thread Terry J. Reedy
Changes by Terry J. Reedy : Added file: http://bugs.python.org/file43548/locale-change2.diff ___ Python tracker ___

[issue27252] Make dict views copyable

2016-06-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue27253] More efficient deepcopying of Mapping

2016-06-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-26 Thread Guido van Rossum
Guido van Rossum added the comment: I'm confused. create_connection() is meant for creating client connection, so I don't think a server_side flag makes sense. (There are lower-level internal APIs that do take a server_side flag, but create_connection() is just one caller for these.) If

[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-26 Thread Guido van Rossum
Guido van Rossum added the comment: Yeah, I'd like to see a more minimal repro to understand what's going in. -- ___ Python tracker ___

Re: Assignment Versus Equality

2016-06-26 Thread Michael Torrie
On 06/26/2016 12:47 PM, Christopher Reimer wrote: > I started writing a BASIC interpreter in Python. The rudimentary version > for 10 PRINT "HELLO, WORLD!" and 20 GOTO 10 ran well. The next version > to read each line into a tree structure left me feeling over my head. So > I got "Writing

[issue24833] IDLE tabnanny check fails

2016-06-26 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- assignee: -> terry.reedy resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue27391] server_hostname should only be required when checking host names

2016-06-26 Thread R. David Murray
R. David Murray added the comment: (To clarify: I haven't used the ssl interface enough for it to be obvious to me where the bug is.) -- ___ Python tracker

[issue27391] server_hostname should only be required when checking host names

2016-06-26 Thread R. David Murray
R. David Murray added the comment: Where is it required? -- nosy: +r.david.murray ___ Python tracker ___ ___

[issue27387] Thread hangs on str.encode() when locale is not set

2016-06-26 Thread R. David Murray
R. David Murray added the comment: This situation is warned about explicitly in the threading docs (https://docs.python.org/2/library/threading.html#importing-in-threaded-code). The import deadlock is fixed in python3, but it is still a really bad idea to launch threads on module import.

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Andre Merzky
Andre Merzky added the comment: It seems you were right, that needed a DecRef indeed: the IncRef is already called on construction. The DecRef for the result also needed fixing - an updated patch is attached. -- Added file: http://bugs.python.org/file43546/issue23395.2.patch

[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-26 Thread Марк Коренберг
Марк Коренберг added the comment: Please reduce program, and make sure it still hangs. -- nosy: +mmarkk ___ Python tracker ___

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Andre Merzky
Andre Merzky added the comment: thanks for looking into this! And also, thanks for the details in the original bug report -- I found this by chance, after unsuccessfully banging my head against this very problem for quite a while! I am not sure if the DecRef needs to be called really if the

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2016-06-26 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

Re: Assignment Versus Equality

2016-06-26 Thread Christopher Reimer
On 6/26/2016 8:41 AM, MRAB wrote: On 2016-06-26 11:48, BartC wrote: On 26/06/2016 08:36, Lawrence D’Oliveiro wrote: One of Python’s few mistakes was that it copied the C convention of using “=” for assignment and “==” for equality comparison. One of C's many mistakes. Unfortunately C has

[issue27352] Bug in IMPORT_NAME

2016-06-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, I was wrong. The level argument is always non-negative integer (if a bytecode is not corrupted). The second branch can be just removed. Following patch also fixes the validation of the ImportFrom AST node. -- nosy: +benjamin.peterson,

Re: Assignment Versus Equality

2016-06-26 Thread Christopher Reimer
On 6/26/2016 6:21 AM, Steven D'Aprano wrote: On Sun, 26 Jun 2016 08:48 pm, BartC wrote: On 26/06/2016 08:36, Lawrence D’Oliveiro wrote: One of Python’s few mistakes was that it copied the C convention of using “=” for assignment and “==” for equality comparison. One of C's many mistakes.

Re: Break and Continue: While Loops

2016-06-26 Thread Elizabeth Weiss
On Thursday, June 23, 2016 at 12:17:23 AM UTC-4, Elizabeth Weiss wrote: > CODE #1: > > i=0 > while 1==1: >print(i) >i=i+1 >if i>=5: > print("Breaking") > break > > -- > I understand that i=0 and i will only be printed if 1=1 > The results of this is > 0 > 1 > 2 > 3 > 4

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2016-06-26 Thread Eryk Sun
Eryk Sun added the comment: To resolve the crash on Windows in 2.7 requires backporting checktm(). Using asctime_s doesn't solve the problem. The CRT still calls the default invalid parameter handler, which kills the process -- as shown by the following ctypes example: from ctypes import

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Thomas Kluyver
Thomas Kluyver added the comment: Does Py_DECREF(arglist); need to be called in all cases? I'm genuinely unsure, as I don't usually work on C code, but my guess would be that it does. I'm not sure whether review is now done on Github. -- ___ Python

Re: Break and Continue: While Loops

2016-06-26 Thread Elizabeth Weiss
On Thursday, June 23, 2016 at 1:20:37 AM UTC-4, DFS wrote: > On 6/23/2016 12:17 AM, Elizabeth Weiss wrote: > > > CODE #1: > > > > i=0 > > while 1==1: > >print(i) > >i=i+1 > >if i>=5: > > print("Breaking") > > break > > > > -- > > I understand that i=0 and i will only be

Re: Break and Continue: While Loops

2016-06-26 Thread Elizabeth Weiss
On Thursday, June 23, 2016 at 1:06:09 AM UTC-4, Rustom Mody wrote: > On Thursday, June 23, 2016 at 9:47:23 AM UTC+5:30, Elizabeth Weiss wrote: > > CODE #1: > > > > i=0 > > while 1==1: > >print(i) > >i=i+1 > >if i>=5: > > print("Breaking") > > break > > > > -- > > I

Re: Break and Continue: While Loops

2016-06-26 Thread Elizabeth Weiss
On Thursday, June 23, 2016 at 12:49:30 AM UTC-4, Lawrence D’Oliveiro wrote: > On Thursday, June 23, 2016 at 4:17:23 PM UTC+12, Elizabeth Weiss wrote: > > > > i=0 > > while 1==1: > >print(i) > >i=i+1 > >if i>=5: > > print("Breaking") > > break > > > > Why is Breaking going

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Andre Merzky
Andre Merzky added the comment: Attached is a patch which seems to resolve the issue for me -- this now triggers the expected `KeyboardInterrupt` in the main thread. For verification one can run the unaltered code as provided by Thomas. I would very much appreciate feedback, to make sure

argparse and subparsers

2016-06-26 Thread Joseph L. Casale
I have some code where sys.argv is sliced up and manually fed to discrete argparse instances each with a single subparser. The reason the discrete parsers all having a single subparser was to make handling the input simpler, the first arg in the slice could be left in. This has become

Re: Proposal: named return values through dict initialization and unpacking

2016-06-26 Thread Michael Selik
On Tue, Jun 21, 2016 at 9:41 PM Steven D'Aprano wrote: > On Tue, 21 Jun 2016 05:34 pm, Ari Freund wrote: > > var3, var1, var2 = **d > > But I don't want to use the key names your function uses. I want to > use names which makes sense for my application > Note that

Re: Python Access logging of another program ran in subprocess

2016-06-26 Thread p . infante413
On Monday, June 27, 2016 at 1:36:24 AM UTC+8, MRAB wrote: > > > The output you're seeing might be going to stderr, not stdout. Wow, huhuhu. Thank you. I did not know that. Thanks man! -- https://mail.python.org/mailman/listinfo/python-list

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Andre Merzky
Andre Merzky added the comment: Thanks Thomas. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Thomas Kluyver
Thomas Kluyver added the comment: It's waiting for someone to make a patch - I'm no longer running into it, so it's not high on my priority list. Given that it's been over a year since I created this issue, it's probably not about to get fixed unless you've got some time to work on it.

Re: Python Access logging of another program ran in subprocess

2016-06-26 Thread MRAB
On 2016-06-26 17:38, p.infante...@gmail.com wrote: Hello, I'm currently running another Python program (prog2.py) in my program via subprocess. input_args = ['python', '/path/to/prog2.py'] + self.chosen_args file = open("logfile.txt",'w') self.process = Popen((input_args), stdout=file)

[issue27393] Command to activate venv in Windows has wrong path

2016-06-26 Thread Manuel Kaufmann
New submission from Manuel Kaufmann: The `venv` module has a bug in the command to activate it on Windows. In 3.3 and 3.4 the bar used is wrong: `/` instead `\` * https://docs.python.org/3.4/library/venv.html#creating-virtual-environments *

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Andre Merzky
Changes by Andre Merzky : -- versions: +Python 2.7 ___ Python tracker ___ ___

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Andre Merzky
Andre Merzky added the comment: Thanks for the PingBack, Thomas. I am not very familiar with the Python community approach to bug reports, so can someone comment if that is worth waiting for to get fixed, or is it that a rather futile hope without providing a patch myself? I don't think I

Python Access logging of another program ran in subprocess

2016-06-26 Thread p . infante413
Hello, I'm currently running another Python program (prog2.py) in my program via subprocess. input_args = ['python', '/path/to/prog2.py'] + self.chosen_args file = open("logfile.txt",'w') self.process = Popen((input_args), stdout=file) However, the logs that prog2.py contains still show at the

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-26 Thread Yury Selivanov
Yury Selivanov added the comment: > On Jun 26, 2016, at 12:05 PM, Jim Fulton wrote: > > I've switched my code to use create_server, but this has led to stability > problems. BTW, did you try to run ZEO tests on uvloop? I'm just curious if stability is somehow related

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

2016-06-26 Thread Xavier de Gaye
Xavier de Gaye added the comment: issue #22724: byte-compile fails for cross-builds -- dependencies: +byte-compile fails for cross-builds ___ Python tracker

Re: How to reset IPython notebook file association

2016-06-26 Thread eryk sun
On Sat, Jun 25, 2016 at 11:00 AM, David Shi via Python-list wrote: > I use IPython Notebook to do Python programming. > I used "Open with" and set it with Google Chrome. Then, my IPython notebook > does not load properly. > How can I reset IPython notebook file

Re: Assignment Versus Equality

2016-06-26 Thread Marko Rauhamaa
Dennis Lee Bieber : > It did... but I'm sure we'd have a revolt if Python comparison > operators looked like: > > a .eq. b > a .ne. b > a .gt. b .or. c .lt. d > a .le. b .and. c .ge. d Yuck, who'd ever want to look at an eyesore like that. In

  1   2   >