Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Marko Rauhamaa
Terry Reedy : > On 4/10/2016 8:17 PM, Fillmore wrote: > >> apparently my 'discontinuity' is mappable to the fact that there's no >> such thing as one-element tuples in Python, and attempts to create >> one will result in a string (i.e. an object of a different kind!)... > >

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 10:18 PM, Rustom Mody wrote: > On Monday, April 11, 2016 at 10:17:13 AM UTC+5:30, Stephen Hansen wrote: > > On Sun, Apr 10, 2016, at 09:03 PM, Fillmore wrote: > > > and the (almost always to be avoided) use of eval() > > > > FWIW, there's ast.literal_eval which is safe

Re: one-element tuples

2016-04-10 Thread Ben Finney
Fillmore writes: > I thought I had made the point clear with the REPL session below. I > had (what seemed to me like) a list of strings getting turned into a > tuple. I was surprised that a single string wasn't turned into a > single-element tuple. Sure. What about

[issue26200] SETREF adds unnecessary work in some cases

2016-04-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thank you. Can this be closed now? -- ___ Python tracker ___ ___

Re: Parens do create a tuple

2016-04-10 Thread Random832
On Mon, Apr 11, 2016, at 00:08, Steven D'Aprano wrote: > Should we say that the / and - operators therefore create tuples? I don't > think so. But I am talking about the tuple that is passed to FunctionType.__call__ at runtime, not a tuple created within some parser stage. --

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Rustom Mody
On Monday, April 11, 2016 at 10:17:13 AM UTC+5:30, Stephen Hansen wrote: > On Sun, Apr 10, 2016, at 09:03 PM, Fillmore wrote: > > and the (almost always to be avoided) use of eval() > > FWIW, there's ast.literal_eval which is safe and there's no reason to > avoid it. Its error reporting is

Re: Moderation and Usenet

2016-04-10 Thread Tim Golden
On 11/04/2016 04:32, Mario R. Osorio wrote: hmmm...He made an extremely kind comment a couple of days ago. It called my attention because is the first one ever (coming from) ... Now I'm thinking he might have just been sarcastic. Give him the benefit of the doubt. And BTW I myself have given

Re: one-element tuples

2016-04-10 Thread Rustom Mody
On Monday, April 11, 2016 at 9:45:20 AM UTC+5:30, Ben Finney wrote: > Clearly there is something of interest here. I'd like to know what the > facts of the matter were; "beginner's mind" is a precious resource, not > to be squandered. That's one sensible statement in a more than usually messed up

Re: one-element tuples

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 09:43 PM, Fillmore wrote: > I thought I had made the point clear with the REPL session below. Considering how many people expressed repeatedly they didn't know what was surprising, it wasn't clear at all. In general you need to explain these things with your words:

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 09:03 PM, Fillmore wrote: > and the (almost always to be avoided) use of eval() FWIW, there's ast.literal_eval which is safe and there's no reason to avoid it. You'll still have to deal with the fact that a single string on a line will return a string while multiples will

Re: one-element tuples

2016-04-10 Thread Fillmore
On 04/11/2016 12:10 AM, Ben Finney wrote: So, will we never get your statement of what surprised you between those examples? Clearly there is something of interest here. I'd like to know what the facts of the matter were; “beginner's mind” is a precious resource, not to be squandered. I

Re: one-element tuples

2016-04-10 Thread Ben Finney
Fillmore writes: > On 04/10/2016 09:36 PM, Ben Finney wrote: > > If the two examples give you different responses (one surprises you, the > > other does not), I would really like to know*what the surprise is*. > > What specifically did you expect, that did not

Re: Parens do create a tuple

2016-04-10 Thread Steven D'Aprano
On Mon, 11 Apr 2016 12:51 pm, Random832 wrote: > On Sun, Apr 10, 2016, at 22:32, Steven D'Aprano wrote: >> def func(arg1, arg2, arg3): >> pass >> >> func(1, 2, 3) >> >> does not create a tuple (1, 2, 3) anywhere in its execution. > > Well, the second argument to PyObject_Call and

Re: Parens do create a tuple

2016-04-10 Thread Ben Finney
Steven D'Aprano writes: > On Mon, 11 Apr 2016 11:41 am, Ben Finney wrote: > > > Chris Angelico writes: > > > >> Fair enough. Let's instead say "commas create tuples", which is true > >> in all cases except the singleton empty tuple. Is that near enough >

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Fillmore
On 04/10/2016 11:54 PM, Steven D'Aprano wrote: On Mon, 11 Apr 2016 12:48 pm, Fillmore wrote: funny, but it seems to me that you are taking it personally... thank god i even apologized in advance for what was most probably a stupid question.. I hope you did get a laugh out of it, because it

[issue26585] Use html.escape to replace _quote_html in http.server

2016-04-10 Thread Martin Panter
Martin Panter added the comment: Thanks for the patch Xiang -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Steven D'Aprano
On Mon, 11 Apr 2016 12:48 pm, Fillmore wrote: > > funny, but it seems to me that you are taking it personally... thank god i > even apologized in advance for what was most probably a stupid question.. I hope you did get a laugh out of it, because it wasn't meant to be nasty. But it was meant to

[issue24291] wsgiref.handlers.SimpleHandler truncates large output blobs

2016-04-10 Thread Martin Panter
Martin Panter added the comment: In patch v2 I integrated a version of the test into test_wsgiref. I swapped the sleep() calls for a threading.Event object. Because my patch is such a large change, it would be good to get other people’s opinions or reviews. -- Added file:

Re: Moderation and Usenet

2016-04-10 Thread Mario R. Osorio
On Sunday, April 10, 2016 at 2:01:00 PM UTC-4, Terry Reedy wrote: > On 4/10/2016 1:05 PM, Ethan Furman wrote: > > > If you see offensive posts from him on the Usenet side please do not > > respond. > > Just a reminder for those who, like me, prefer a newsgroup interface for > python-list:

Re: Unacceptable behavior

2016-04-10 Thread Jeff Schumaker
On Sunday, April 10, 2016 at 9:33:47 PM UTC-4, Jeff Schumaker wrote: > On Sunday, April 10, 2016 at 10:03:37 AM UTC-4, Chris Angelico wrote: > > On Sun, Apr 10, 2016 at 11:54 PM, Jeff Schumaker wrote > > > > As a new member of this group, I am not sure on how to report > > > unacceptable

Re: Moderation and Usenet

2016-04-10 Thread Mario R. Osorio
hmmm...He made an extremely kind comment a couple of days ago. It called my attention because is the first one ever (coming from) ... Now I'm thinking he might have just been sarcastic. And BTW I myself have given a couple of sour responses every now and then. I guess we all have our bad days

[issue25187] bdist_rpm fails due to wrong hardcoded assumption about RPM filename format

2016-04-10 Thread David Ward
David Ward added the comment: Ping to review patch please... -- ___ Python tracker ___ ___ Python-bugs-list

Re: one-element tuples

2016-04-10 Thread Fillmore
Thank you for trying to help, Martin. So: On 04/10/2016 09:08 PM, Martin A. Brown wrote: #1: I would not choose eval() except when there is no other solution. If you don't need eval(), it may save you some headache in the future, as well, to find an alternate way. So, can we

Re: Parens do create a tuple

2016-04-10 Thread Chris Angelico
On Mon, Apr 11, 2016 at 12:51 PM, Random832 wrote: > On Sun, Apr 10, 2016, at 22:32, Steven D'Aprano wrote: >> def func(arg1, arg2, arg3): >> pass >> >> func(1, 2, 3) >> >> does not create a tuple (1, 2, 3) anywhere in its execution. > > Well, the second argument to

Re: Parens do create a tuple

2016-04-10 Thread Steven D'Aprano
On Mon, 11 Apr 2016 11:51 am, Chris Angelico wrote: > On Mon, Apr 11, 2016 at 11:41 AM, Ben Finney > wrote: >>> I'd rather be correct on the one-element case and wrong on the empty >>> than the other way around. >> >> To say “commas create tuples” is to say an

Re: one-element tuples

2016-04-10 Thread Fillmore
On 04/10/2016 09:36 PM, Ben Finney wrote: If the two examples give you different responses (one surprises you, the other does not), I would really like to know*what the surprise is*. What specifically did you expect, that did not happen? now that I get the role of commas it's not surprising

Re: Parens do create a tuple

2016-04-10 Thread Random832
On Sun, Apr 10, 2016, at 22:32, Steven D'Aprano wrote: > def func(arg1, arg2, arg3): > pass > > func(1, 2, 3) > > does not create a tuple (1, 2, 3) anywhere in its execution. Well, the second argument to PyObject_Call and function_call is a tuple, which had to come from somewhere. That may

[issue26685] Raise errors from socket.close()

2016-04-10 Thread Martin Panter
Martin Panter added the comment: I tweaked the test again for Windows, anticipating that it will raise ENOTSOCK rather than EBADF. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Fillmore
funny, but it seems to me that you are taking it personally... thank god i even apologized in advance for what was most probably a stupid question.. On 04/10/2016 09:50 PM, Steven D'Aprano wrote: Fillmore, you should feel very pleased with yourself. All the tens of thousands of Python

[issue14456] Relation between threads and signals unclear

2016-04-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 73050563053f by Martin Panter in branch '3.5': Issue #14456: Remove contradiction about blocking signals from bad merge https://hg.python.org/cpython/rev/73050563053f New changeset a8dbe6016a31 by Martin Panter in branch 'default': Issue #14456:

Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-10 Thread Chris Angelico
On Mon, Apr 11, 2016 at 12:22 PM, Dan Sommers wrote: > On Mon, 11 Apr 2016 01:33:10 +0100, MRAB wrote: > >> There _is_ one exception though: (). It's the empty tuple (a 0-element >> tuple). It doesn't have a comma and the parentheses are mandatory. >> There's no other way

Re: Parens do create a tuple

2016-04-10 Thread Steven D'Aprano
On Mon, 11 Apr 2016 11:41 am, Ben Finney wrote: > Chris Angelico writes: > >> Fair enough. Let's instead say "commas create tuples", which is true >> in all cases except the singleton empty tuple. Is that near enough >> that we can avoid the detail? > > It's a fine thing to

Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-10 Thread Dan Sommers
On Mon, 11 Apr 2016 01:33:10 +0100, MRAB wrote: > There _is_ one exception though: (). It's the empty tuple (a 0-element > tuple). It doesn't have a comma and the parentheses are mandatory. > There's no other way to write it. The other way to write it is: tuple() --

Re: QWERTY was not designed to intentionally slow typists down (was: Unicode normalisation [was Re: [beginner] What's wrong?])

2016-04-10 Thread pyotr filipivich
Ian Kelly on Sun, 10 Apr 2016 07:43:13 -0600 typed in comp.lang.python the following: >On Sat, Apr 9, 2016 at 9:09 PM, pyotr filipivich wrote: >> ASINTOER are the top eight English letters (not in any order, it >> is just that "A Sin To Err"

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Steven D'Aprano
On Mon, 11 Apr 2016 08:51 am, Fillmore wrote: > at which point did the language designers decide to betray the > "path of least surprise" principle and create a 'discontinuity' in the > language? It was March 1996, and I was there. I don't remember the date, I'm afraid. Some of the core Python

Re: Parens do create a tuple

2016-04-10 Thread Chris Angelico
On Mon, Apr 11, 2016 at 11:41 AM, Ben Finney wrote: >> I'd rather be correct on the one-element case and wrong on the empty >> than the other way around. > > To say “commas create tuples” is to say an unobjectionably true > statement about Python syntax. It remains

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Terry Reedy
On 4/10/2016 8:17 PM, Fillmore wrote: apparently my 'discontinuity' is mappable to the fact that there's no such thing as one-element tuples in Python, and attempts to create one will result in a string (i.e. an object of a different kind!)... Please work through the tutorial before posting

Re: Parens do create a tuple

2016-04-10 Thread Ben Finney
Chris Angelico writes: > Fair enough. Let's instead say "commas create tuples", which is true > in all cases except the singleton empty tuple. Is that near enough > that we can avoid the detail? It's a fine thing to say, because it's simply true. Commas create tuples. There

Re: one-element tuples

2016-04-10 Thread Ben Finney
Fillmore writes: > On 04/10/2016 08:31 PM, Ben Finney wrote: > > Can you describe explicitly what that “discontinuation point” is? I'm > > not seeing it. > > Here you go: > > >>> a = '"string1"' > >>> b = '"string1","string2"' > >>> c =

Re: Unacceptable behavior

2016-04-10 Thread Jeff Schumaker
On Sunday, April 10, 2016 at 10:03:37 AM UTC-4, Chris Angelico wrote: > On Sun, Apr 10, 2016 at 11:54 PM, Jeff Schumaker wrote > > As a new member of this group, I am not sure on how to report unacceptable > > behavior. If this is not the correct way, I apologize. > > > > Please check the

Re: Unacceptable behavior

2016-04-10 Thread Ned Batchelder
On Sunday, April 10, 2016 at 9:29:19 PM UTC-4, Jeff Schumaker wrote: > On Sunday, April 10, 2016 at 1:15:18 PM UTC-4, bream...@gmail.com wrote: > > On Sunday, April 10, 2016 at 2:54:45 PM UTC+1, Jeff Schumaker wrote: > > > On Thursday, April 7, 2016 at 2:50:32 AM UTC-4, Ethan Furman wrote: > > > >

Re: Parens do create a tuple (was: one-element tuples [Was: Most probably a stupid question, but I still want to ask])

2016-04-10 Thread Tim Chase
On 2016-04-11 10:45, Ben Finney wrote: > Also, there is another obvious way to create an empty tuple: call > the ‘tuple’ type directly: > > >>> foo = tuple() > >>> print(type(foo), len(foo)) > 0 But here the parens make the tuple too: >>> foo = tuple >>> print(type(foo))

Re: Unacceptable behavior

2016-04-10 Thread Jeff Schumaker
On Sunday, April 10, 2016 at 1:15:18 PM UTC-4, bream...@gmail.com wrote: > On Sunday, April 10, 2016 at 2:54:45 PM UTC+1, Jeff Schumaker wrote: > > On Thursday, April 7, 2016 at 2:50:32 AM UTC-4, Ethan Furman wrote: > > > On 04/05/2016 01:05 PM, Thomas 'PointedEars' Lahn wrote: > > > > > > > |

[issue26685] Raise errors from socket.close()

2016-04-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset bd665613ed67 by Martin Panter in branch 'default': Issue #26685: Raise OSError if closing a socket fails https://hg.python.org/cpython/rev/bd665613ed67 -- nosy: +python-dev ___ Python tracker

[issue26585] Use html.escape to replace _quote_html in http.server

2016-04-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset bf44913588b7 by Martin Panter in branch 'default': Issue #26585: Eliminate _quote_html() and use html.escape(quote=False) https://hg.python.org/cpython/rev/bf44913588b7 -- nosy: +python-dev ___ Python

Re: one-element tuples

2016-04-10 Thread Martin A. Brown
Hello Fillmore, > Here you go: > > >>> a = '"string1"' > >>> b = '"string1","string2"' > >>> c = '"string1","string2","string3"' > >>> ea = eval(a) > >>> eb = eval(b) > >>> ec = eval(c) > >>> type(ea) ><--- HERE > >>> type(eb) > > >>> type(ec) > > > I can tell you that it exists

Re: one-element tuples

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 05:48 PM, Fillmore wrote: > On 04/10/2016 08:31 PM, Ben Finney wrote: > > Can you describe explicitly what that “discontinuation point” is? I'm > > not seeing it. > > Here you go: > > >>> a = '"string1"' Here, "a" is a string that contains a double quoted string. So if

Re: Parens do create a tuple (was: one-element tuples [Was: Most probably a stupid question, but I still want to ask])

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 05:45 PM, Ben Finney wrote: > So, let's please stop saying “parens don't create a tuple”. They do, and > because of that I've stopped saying that false over-simplification. I stand by "parens don't make a tuple", with the caveat that I should have mentioned the empty

Re: one-element tuples

2016-04-10 Thread Ned Batchelder
On Sunday, April 10, 2016 at 8:48:49 PM UTC-4, Fillmore wrote: > On 04/10/2016 08:31 PM, Ben Finney wrote: > > Can you describe explicitly what that "discontinuation point" is? I'm > > not seeing it. > > Here you go: > > >>> a = '"string1"' > >>> b = '"string1","string2"' > >>> c =

Re: Parens do create a tuple

2016-04-10 Thread Chris Angelico
On Mon, Apr 11, 2016 at 10:57 AM, Ben Finney wrote: > Chris Angelico writes: > >> On Mon, Apr 11, 2016 at 10:45 AM, Ben Finney >> wrote: >> > So the expanation that remains true when you examine it is: People >> > wanted

Re: Parens do create a tuple

2016-04-10 Thread Ben Finney
Chris Angelico writes: > On Mon, Apr 11, 2016 at 10:45 AM, Ben Finney > wrote: > > So the expanation that remains true when you examine it is: People > > wanted a literal syntax to create a zero-length tuple. A pair of parens > > is that literal

Re: one-element tuples

2016-04-10 Thread Ben Finney
Fillmore writes: > Here you go: > > >>> a = '"string1"' > >>> b = '"string1","string2"' > >>> c = '"string1","string2","string3"' > >>> ea = eval(a) > >>> eb = eval(b) > >>> ec = eval(c) > >>> type(ea) ><--- HERE > >>> type(eb) > > >>> type(ec) > > > I can

Re: Parens do create a tuple (was: one-element tuples [Was: Most probably a stupid question, but I still want to ask])

2016-04-10 Thread Chris Angelico
On Mon, Apr 11, 2016 at 10:45 AM, Ben Finney wrote: > So the expanation that remains true when you examine it is: People > wanted a literal syntax to create a zero-length tuple. A pair of parens > is that literal syntax, and it's the parens that create the (empty) >

Re: one-element tuples

2016-04-10 Thread Fillmore
On 04/10/2016 08:31 PM, Ben Finney wrote: Can you describe explicitly what that “discontinuation point” is? I'm not seeing it. Here you go: >>> a = '"string1"' >>> b = '"string1","string2"' >>> c = '"string1","string2","string3"' >>> ea = eval(a) >>> eb = eval(b) >>> ec = eval(c) >>> type(ea)

Parens do create a tuple (was: one-element tuples [Was: Most probably a stupid question, but I still want to ask])

2016-04-10 Thread Ben Finney
Stephen Hansen writes: > […] parens don't make tuples, commas do. Chris Angelico writes: > The thing you're confused at is that it's not the parentheses that > create a tuple. Parentheses merely group. MRAB writes: > As

Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-10 Thread Chris Angelico
On Mon, Apr 11, 2016 at 10:33 AM, MRAB wrote: > For example, object are passed into a function thus: > > f(x, y) > > (In reality, it's making a tuple and then passing that in.) Actually that's not the case; certain syntactic constructs allow you to specify

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 05:17 PM, Fillmore wrote: > On 04/10/2016 07:30 PM, Stephen Hansen wrote: > > > There's nothing inconsistent or surprising going on besides you doing > > something vaguely weird and not really expressing what you find > > surprising. > > well, I was getting some

Re: one-element tuples

2016-04-10 Thread Ben Finney
Fillmore writes: > So, my original question makes sense. Why was a discontinuation point > introduced by the language designer? Can you describe explicitly what that “discontinuation point” is? I'm not seeing it. -- \ “People are very open-minded about

Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-10 Thread Ben Finney
Fillmore writes: > Sorry guys. It was not my intention to piss off anyone...just trying > to understand how the languare works Frustration is understandable when learning something new :-) Hopefully that can be a signal to take a breath, and compose messages to

Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-10 Thread MRAB
On 2016-04-11 01:13, Fillmore wrote: Sorry guys. It was not my intention to piss off anyone...just trying to understand how the languare works I guess that the answer to my question is: there is no such thing as a one-element tuple, and Python will automatically convert a one-element tuple

Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 05:22 PM, Fillmore wrote: > Hold on a sec! it turns up that there is such thing as single-element > tuples in python: > > >>> c = ('hello',) > >>> c > ('hello',) > >>> c[0] > 'hello' > >>> c[1] > Traceback (most recent call last): >File "", line 1, in >

Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-10 Thread Chris Angelico
On Mon, Apr 11, 2016 at 10:13 AM, Fillmore wrote: > Sorry guys. It was not my intention to piss off anyone...just trying to > understand how the languare works > > I guess that the answer to my question is: there is no such thing as a > one-element tuple, > and Python

Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-10 Thread Fillmore
On 04/10/2016 08:13 PM, Fillmore wrote: Sorry guys. It was not my intention to piss off anyone...just trying to understand how the languare works I guess that the answer to my question is: there is no such thing as a one-element tuple, and Python will automatically convert a one-element

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Fillmore
On 04/10/2016 07:30 PM, Stephen Hansen wrote: There's nothing inconsistent or surprising going on besides you doing something vaguely weird and not really expressing what you find surprising. well, I was getting some surprising results for some of my data, so I can guarantee that I was

[issue26712] Unify (r)split(), (l/r)strip() method tests

2016-04-10 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 05:18 PM, Stephen Hansen wrote: > The parens are optional, I always put them in because: > >>> b = "hello", Ahem, "because its easy to miss the trailing comma" is what I meant to say here. -- https://mail.python.org/mailman/listinfo/python-list

Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 05:13 PM, Fillmore wrote: > I guess that the answer to my question is: there is no such thing as a > one-element tuple, > and Python will automatically convert a one-element tuple to a string... > hence the > behavior I observed is explained... > > >>> a =

one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-10 Thread Fillmore
Sorry guys. It was not my intention to piss off anyone...just trying to understand how the languare works I guess that the answer to my question is: there is no such thing as a one-element tuple, and Python will automatically convert a one-element tuple to a string... hence the behavior I

[issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written

2016-04-10 Thread Martin Panter
Martin Panter added the comment: David: I guess the seek() is to support rollover() when you are positioned halfway through the file. Serhiy’s patch seems to be about the best we can do, although it does break the documented promise that the “ ‘_file’ attribute is either an io.BytesIO or

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 03:51 PM, Fillmore wrote: > > let's look at this: > > $ python3.4 > Python 3.4.0 (default, Apr 11 2014, 13:05:11) > [GCC 4.8.2] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> line1 = '"String1" | bla' > >>> parts1 =

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Ben Finney
Fillmore writes: > let's look at this: Can you set a “Subject” field that pertains to the actual question? As is, it doesn't help know what you want to discuss. > the question is: at which point did the language designers decide to > betray the "path of least

[issue26731] subprocess on windows leaks stdout/stderr handle to child process when stdout/stderr overridden

2016-04-10 Thread Sai
Sai added the comment: You can workaround this problem by adding a middleman process that sets close_fds=True: ### childworkaround.py # import os import subprocess with open(os.devnull, 'w') as devnull: script = "import subprocess; import sys;

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Chris Angelico
On Mon, Apr 11, 2016 at 8:51 AM, Fillmore wrote: > the question is: at which point did the language designers decide to betray > the > "path of least surprise" principle and create a 'discontinuity' in the > language? > Open to the idea that I am getting something

Most probably a stupid question, but I still want to ask

2016-04-10 Thread Fillmore
let's look at this: $ python3.4 Python 3.4.0 (default, Apr 11 2014, 13:05:11) [GCC 4.8.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> line1 = '"String1" | bla' >>> parts1 = line1.split(" | ") >>> parts1 ['"String1"', 'bla'] >>> tokens1 = eval(parts1[0])

[issue26729] Incorrect __text_signature__ for sorted

2016-04-10 Thread Martin Panter
Martin Panter added the comment: This is a strange case. It looks like “iterable” is half-supported as a keyword argument. So Silent Ghost’s patch fixes the signature, but the code still tries to accept keyword arguments: >>> sorted(iterable=None) TypeError: 'NoneType' object is not iterable

[issue26732] multiprocessing sentinel resource leak

2016-04-10 Thread Davin Potts
Changes by Davin Potts : -- nosy: +davin ___ Python tracker ___ ___

[issue26732] multiprocessing sentinel resource leak

2016-04-10 Thread Kevin Quick
Kevin Quick added the comment: (Sorry, an unnamed pipe, but a pipe nonetheless.) -- ___ Python tracker ___

[issue26732] multiprocessing sentinel resource leak

2016-04-10 Thread Kevin Quick
New submission from Kevin Quick: The sentinel creates a named pipe, but the parent's end of the pipe is inherited by subsequently created children. import multiprocessing,signal,sys def sproc(x): signal.pause() for each in range(int(sys.argv[1])): multiprocessing.Process(target=sproc,

[issue25609] Add a ContextManager ABC and type

2016-04-10 Thread Brett Cannon
Brett Cannon added the comment: Thanks for fixing the doc bug, Martin. Too much Markdown lately. :) -- ___ Python tracker ___

[issue26705] logging.Handler.handleError should be called from logging.Handler.handle

2016-04-10 Thread Aviv Palivoda
Aviv Palivoda added the comment: I see the backwards compatibility issue. I have two suggestion's how to improve the code without breaking backwards compatibility: 1. Add a new Handler class named SafeHandler that will implement handle in the way suggested in the previous patch. All the

[issue26705] logging.Handler.handleError should be called from logging.Handler.handle

2016-04-10 Thread Aviv Palivoda
Changes by Aviv Palivoda : Added file: http://bugs.python.org/file42426/logging-handleException.patch ___ Python tracker ___

[issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written

2016-04-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that fixes SpooledTemporaryFile by getting rid of StringIO. -- keywords: +patch nosy: +serhiy.storchaka stage: needs patch -> patch review Added file: http://bugs.python.org/file42424/spooled_text_tempfile.patch

[issue26731] subprocess on windows leaks stdout/stderr handle to child process when stdout/stderr overridden

2016-04-10 Thread Matt Peters
New submission from Matt Peters: Tested in on Windows 8.1 with python 2.7.5. I have a parent process that creates a child process and calls communicate to get stdout/stderr from the child. The child process calls a persistent process, with stdout/stderr/stdin set to os.devnull, and then

Re: Unacceptable behavior

2016-04-10 Thread Tim Golden
On 10/04/2016 18:15, breamore...@gmail.com wrote: [... snip Mark again, using a different address to avoid the moderation check ...] Mark, Please don't do this. If you genuinely want this list to be a useful and friendly resource, which is what your posts suggest, then please step back and

[issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written

2016-04-10 Thread R. David Murray
R. David Murray added the comment: I can't see why it even does the seek. The existing tests pass without it. Does your example? Either way, the first step here is for someone to turn this into a unit test for the tempfile module (in test_tempfile). -- nosy: +r.david.murray stage:

Re: Change Windows Tkinter after some time

2016-04-10 Thread Terry Reedy
On 4/10/2016 2:11 PM, Terry Reedy wrote: On 4/10/2016 9:36 AM, Diego Lelis wrote: I need to make a change between windows, after some time. But i am have a little bit of trouble making my code work: My windows change only when i click on button, i tried to put lambda in my command and also

[issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written

2016-04-10 Thread James Hennessy
New submission from James Hennessy: The tempfile.SpooledTemporaryFile class doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written. The attached program demonstrates the failure. It creates a SpooledTemporaryFile object, writes

[issue24557] Refactor LibreSSL / EGD detection

2016-04-10 Thread Bernard Spil
Bernard Spil added the comment: This is now also required for the upcoming OpenSSL 1.1.0 which also removed EGD by default -- ___ Python tracker ___

[issue26729] Incorrect __text_signature__ for sorted

2016-04-10 Thread SilentGhost
Changes by SilentGhost : -- components: +Interpreter Core -Extension Modules, Library (Lib) nosy: +ncoghlan stage: -> patch review versions: +Python 3.6 ___ Python tracker

Re: Change Windows Tkinter after some time

2016-04-10 Thread Terry Reedy
On 4/10/2016 9:36 AM, Diego Lelis wrote: I need to make a change between windows, after some time. But i am have a little bit of trouble making my code work: My windows change only when i click on button, i tried to put lambda in my command and also don't work. I and others have written

Re: Moderation and Usenet

2016-04-10 Thread Terry Reedy
On 4/10/2016 1:05 PM, Ethan Furman wrote: If you see offensive posts from him on the Usenet side please do not respond. Just a reminder for those who, like me, prefer a newsgroup interface for python-list: gmane.comp.python.general at news.gmane.org mirrors the moderated output of

Re: Unacceptable behavior

2016-04-10 Thread Random832
On Sun, Apr 10, 2016, at 13:15, breamore...@gmail.com wrote: > Or are you in the camp that believes when someone > is too bone idle to do any work for themselves, and turns up here asking > for us to write all of their code for them, we should kill the fatted > calf, roll out the red carpet, and

[issue26729] Incorrect __text_signature__ for sorted

2016-04-10 Thread Erik Welch
New submission from Erik Welch: The first argument to sorted is positional-only, so the text signature should be: sorted($module, iterable, /, key=None, reverse=False) instead of sorted($module, iterable, key=None, reverse=False) To reproduce the issue, attempt to use "iterable" as a

Re: Unacceptable behavior

2016-04-10 Thread breamoreboy
On Sunday, April 10, 2016 at 3:03:37 PM UTC+1, Chris Angelico wrote: > On Sun, Apr 10, 2016 at 11:54 PM, Jeff Schumaker > wrote: > > As a new member of this group, I am not sure on how to report unacceptable > > behavior. If this is not the correct way, I apologize. > >

Re: Unacceptable behavior

2016-04-10 Thread breamoreboy
On Sunday, April 10, 2016 at 2:54:45 PM UTC+1, Jeff Schumaker wrote: > On Thursday, April 7, 2016 at 2:50:32 AM UTC-4, Ethan Furman wrote: > > On 04/05/2016 01:05 PM, Thomas 'PointedEars' Lahn wrote: > > > > > | >>> from email import ID10T > > > > Thomas, as has been pointed out to you in

Re: Untrusted code execution

2016-04-10 Thread Jon Ribbens
On 2016-04-07, Jon Ribbens wrote: > I've put an example script here: > > https://github.com/jribbens/unsafe/blob/master/unsafe.py > > When run as a script, it will execute whatever Python code you pass it > on stdin. > > If anyone can break it (by which I mean

Moderation and Usenet

2016-04-10 Thread Ethan Furman
Mark Lawrence is currently being moderated. If you see offensive posts from him on the Usenet side please do not respond. Thank you. -- ~Ethan~ Python List Owners -- https://mail.python.org/mailman/listinfo/python-list

Re: function to remove and punctuation

2016-04-10 Thread Peter Otten
Thomas 'PointedEars' Lahn wrote: > Peter Otten wrote: > >> gesh...@gmail.com wrote: >>> how to write a function taking a string parameter, which returns it >>> after you delete the spaces, punctuation marks, accented characters in >>> python ? >> >> Looks like you want to remove more characters

[issue20210] Provide configure options to enable/disable Python modules and extensions

2016-04-10 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue26200] SETREF adds unnecessary work in some cases

2016-04-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9cf8572abe58 by Serhiy Storchaka in branch '2.7': Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREF https://hg.python.org/cpython/rev/9cf8572abe58 New changeset 66fafa13a711 by Serhiy Storchaka in branch '3.5': Issue #26200:

  1   2   >