Re: how to read in the newsreader

2017-10-15 Thread Andrew Z
hmm. i did do that.  maybe just a delay.
I'll see how it will go tomorrow then. Thank you gents.

On Mon, Oct 16, 2017 at 12:30 AM, Chris Angelico  wrote:

> On Mon, Oct 16, 2017 at 3:19 PM, Andrew Z  wrote:
> > Michael, that's what i use too - gmail. But i get the digest only and
> can't
> > really reply that way. i was hoping to get the mail.python.org list
>
> Turn off digests then. Easy!
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to read in the newsreader

2017-10-15 Thread Andrew Z
i'm typing without thinking. Sorry. Let me try again.

I subscribed to python-list@python.org. That has 0 spam ( as far as i can
see), but i can only get a digest.
They do say the list and comp.python group are bidirectional, but - at comp
- tons of spam, there - none.

The google groups doesn't seemed to filter anything in the comp group. But
what you recommend is to access the group using regular email client and
use it's spam filtering . Did i get that right ?


On Mon, Oct 16, 2017 at 12:19 AM, Andrew Z  wrote:

> Michael, that's what i use too - gmail. But i get the digest only and
> can't really reply that way. i was hoping to get the mail.python.org
> list
>
> On Mon, Oct 16, 2017 at 12:00 AM, Michael Torrie 
> wrote:
>
>> On 10/15/2017 08:50 PM, Andrew Z wrote:
>> > Gents,
>> >  how do i get this group in a newsreader? The digest i'm getting is not
>> > workable for me - i can't reply , can only read the replies from the
>> > members of the group. Or. maybe, it shouldn't be a news reader
>> > please advise..
>> >
>> > P.S. Oh the comp.lang.python is a nightmare because of spam...
>>
>> Regardless of what usenet reader you use, com.lang.python will have the
>> same spam everywhere.  So maybe reading via usenet isn't that useful
>> anyway.
>>
>> I just subscribe to the mailing list and then have a rule in my email
>> filter to stick all list messages in their own folder (or gmail label).
>> I'm using gmail, so I just use gmail's filtering settings.  Then I view
>> email using IMAP and a conventional email reader that supports real
>> threading of messages.  Works great.  A lot of spam is filtered out this
>> way, also.  In fact very little spam gets through to my folder between
>> python.org's filtering and gmail's spam detection.
>>
>> I'm subscribed to maybe a dozen email lists, and I filter all of them
>> into their own folders.
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to read in the newsreader

2017-10-15 Thread Chris Angelico
On Mon, Oct 16, 2017 at 3:19 PM, Andrew Z  wrote:
> Michael, that's what i use too - gmail. But i get the digest only and can't
> really reply that way. i was hoping to get the mail.python.org list

Turn off digests then. Easy!

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to read in the newsreader

2017-10-15 Thread Andrew Z
Michael, that's what i use too - gmail. But i get the digest only and can't
really reply that way. i was hoping to get the mail.python.org list

On Mon, Oct 16, 2017 at 12:00 AM, Michael Torrie  wrote:

> On 10/15/2017 08:50 PM, Andrew Z wrote:
> > Gents,
> >  how do i get this group in a newsreader? The digest i'm getting is not
> > workable for me - i can't reply , can only read the replies from the
> > members of the group. Or. maybe, it shouldn't be a news reader
> > please advise..
> >
> > P.S. Oh the comp.lang.python is a nightmare because of spam...
>
> Regardless of what usenet reader you use, com.lang.python will have the
> same spam everywhere.  So maybe reading via usenet isn't that useful
> anyway.
>
> I just subscribe to the mailing list and then have a rule in my email
> filter to stick all list messages in their own folder (or gmail label).
> I'm using gmail, so I just use gmail's filtering settings.  Then I view
> email using IMAP and a conventional email reader that supports real
> threading of messages.  Works great.  A lot of spam is filtered out this
> way, also.  In fact very little spam gets through to my folder between
> python.org's filtering and gmail's spam detection.
>
> I'm subscribed to maybe a dozen email lists, and I filter all of them
> into their own folders.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to read in the newsreader

2017-10-15 Thread Michael Torrie
On 10/15/2017 08:50 PM, Andrew Z wrote:
> Gents,
>  how do i get this group in a newsreader? The digest i'm getting is not
> workable for me - i can't reply , can only read the replies from the
> members of the group. Or. maybe, it shouldn't be a news reader
> please advise..
> 
> P.S. Oh the comp.lang.python is a nightmare because of spam...

Regardless of what usenet reader you use, com.lang.python will have the
same spam everywhere.  So maybe reading via usenet isn't that useful anyway.

I just subscribe to the mailing list and then have a rule in my email
filter to stick all list messages in their own folder (or gmail label).
I'm using gmail, so I just use gmail's filtering settings.  Then I view
email using IMAP and a conventional email reader that supports real
threading of messages.  Works great.  A lot of spam is filtered out this
way, also.  In fact very little spam gets through to my folder between
python.org's filtering and gmail's spam detection.

I'm subscribed to maybe a dozen email lists, and I filter all of them
into their own folders.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31795] Slicings documentation doesn't mention Ellipsis

2017-10-15 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

In regular Python, the ellipsis isn't used for slicing.  It does have special 
meaning for numpy.   So, I think the docs may be correct as is.

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



how to read in the newsreader

2017-10-15 Thread Andrew Z
Gents,
 how do i get this group in a newsreader? The digest i'm getting is not
workable for me - i can't reply , can only read the replies from the
members of the group. Or. maybe, it shouldn't be a news reader
please advise..

P.S. Oh the comp.lang.python is a nightmare because of spam...
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31796] The mccabe complexity output in module flake8.

2017-10-15 Thread Ned Deily

Ned Deily  added the comment:

flake8 is not part of the Python Standard Library.  You might start with its 
project page here: https://gitlab.com/pycqa/flake8

--
nosy: +ned.deily
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31796] The mccabe complexity output in module flake8.

2017-10-15 Thread fuqianz

New submission from fuqianz :

Dear,
  I have found that if a function name appears more than one time in a
file, the output of McCabe complexity for this function name only appear
once. I think it should output all of them. So, I send this email for
inquiring about this confusing problems.

Thanks,

Sincerely,

fuqianz

--
messages: 304450
nosy: fqbrighter
priority: normal
severity: normal
status: open
title: The mccabe complexity output in module flake8.

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31795] Slicings documentation doesn't mention Ellipsis

2017-10-15 Thread Nitish

New submission from Nitish :

Ellipsis object documentation[1] specifies that Ellipsis is mainly used by 
Slicings. But Slicing's documentation[2] doesn't mention anything about 
Ellipsis. Consequently - it is not immediately clear from Ellipsis 
documentation what it's used for.

[1] 
https://docs.python.org/3/library/stdtypes.html?highlight=ellipsis#the-ellipsis-object

[2] https://docs.python.org/3/reference/expressions.html#slicings

--
assignee: docs@python
components: Documentation
messages: 304449
nosy: docs@python, nitishch
priority: normal
severity: normal
status: open
title: Slicings documentation doesn't mention Ellipsis
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31791] Ensure that all PyTypeObject fields are set to non-NULL defaults

2017-10-15 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

For all the reasons Serhiy mentioned, I recommend rejecting this request.  This 
was an intentional and long-standing design decision. A substantial part of the 
Python ecosystem depends on it.

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Python 2 -> 3, urllib.urlopen (corrected the case)

2017-10-15 Thread Ben Bacarisse
Irv Kalb  writes:

>> On Oct 14, 2017, at 6:46 PM, Ben Bacarisse  wrote:
 Finally, wget -S shows that the resource has moved.  It is now at
 
 Location: http://download.finance.yahoo.com/d/quotes.csv?s=aapl=l1
 
 I don't think this has anything to do with your problem, but it's worth
 noting.
>>> 
>>> That DID fix it.  I changed the URL to add 'download/' and it worked
>>> perfectly.
>> 
>> That's... interesting.
>> 
>>> Apparently, Python 3 differs from Python 2 in the way that it is
>>> handling a missing/forwarding URL, because the original code in Python
>>> 2.7 works perfectly.
>> 
>> Python 3 works for me.  I still suspect it's some system difference
>> rather than being, say, a 3.6.1 vs 3.5.2 difference.  What happens if
>> you change the URL to use https rather than http?
>> 
>
> Trying https (with and without the "download." part) results in the
> same traceback as I was seeing earlier.

It looks like there may be something amiss with your local certificates,
at least as far as Python's SSL code in concerned.  That's a Dark Art to
me so I can't really help (and it might be Mac specific).

The error might have showed up in the first test because the redirection
was to an https: URL.

-- 
Ben.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31788] Typo in comments Modules/_ssl.c

2017-10-15 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset cfc604722ff5ad64de96ddeb944661f1e94d8cd0 by Benjamin Peterson 
(Miss Islington (bot)) in branch '3.6':
[3.6] completly -> completely (GH-3999) (closes bpo-31788) (#4008)
https://github.com/python/cpython/commit/cfc604722ff5ad64de96ddeb944661f1e94d8cd0


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31788] Typo in comments Modules/_ssl.c

2017-10-15 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +3982

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31788] Typo in comments Modules/_ssl.c

2017-10-15 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 1295e11d397c6138427296d5f9653a9e7dd69062 by Benjamin Peterson 
(Semen Zhydenko) in branch 'master':
completly -> completely (#3999) (closes bpo-31788)
https://github.com/python/cpython/commit/1295e11d397c6138427296d5f9653a9e7dd69062


--
nosy: +benjamin.peterson
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-15 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

I have updated both the test and the implementation to address your feedback.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Python 2 -> 3, urllib.urlopen (corrected the case)

2017-10-15 Thread Irv Kalb

> On Oct 14, 2017, at 6:46 PM, Ben Bacarisse  wrote:
> 
> Irv Kalb  writes:
> 
>> Thank you!
> 
> You're welcome.
> 
> 
>>> Just a data point...  It works here:
>>> 
>>> $ python3 t.py
>>> Response is:  b'156.99\n'
>>> $ cat t.py
>>> import urllib.request
>>> fullURLWithParameters = 'http://finance.yahoo.com/d/quotes.csv?s=aapl=l1'
>>> # read all the data
>>> response = urllib.request.urlopen(fullURLWithParameters).read()
>>> 
>>> print('Response is: ', response)
>>> $ python3 --version
>>> Python 3.5.2
>> 
>> I have not tried this on anything but my Mac.  I'm running 3.6.1
> 
>>> For example, here:
>>> 
>>> $ wget -q -O - 'http://finance.yahoo.com/d/quotes.csv?s=aapl=l1' 
>>> 156.99
>>> 
>>> Finally, wget -S shows that the resource has moved.  It is now at
>>> 
>>> Location: http://download.finance.yahoo.com/d/quotes.csv?s=aapl=l1
>>> 
>>> I don't think this has anything to do with your problem, but it's worth
>>> noting.
>> 
>> That DID fix it.  I changed the URL to add 'download/' and it worked
>> perfectly.
> 
> That's... interesting.
> 
>> Apparently, Python 3 differs from Python 2 in the way that it is
>> handling a missing/forwarding URL, because the original code in Python
>> 2.7 works perfectly.
> 
> Python 3 works for me.  I still suspect it's some system difference
> rather than being, say, a 3.6.1 vs 3.5.2 difference.  What happens if
> you change the URL to use https rather than http?
> 
> -- 
> Ben.
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

Trying https (with and without the "download." part) results in the same 
traceback as I was seeing earlier.

Thanks again,

Irv
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31788] Typo in comments Modules/_ssl.c

2017-10-15 Thread Aniket Vyas

Aniket Vyas  added the comment:

My bad, didn't notice the PR already existing.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31788] Typo in comments Modules/_ssl.c

2017-10-15 Thread Aniket Vyas

Aniket Vyas  added the comment:

I can pick this up if it's okay.

--
nosy: +vyas45

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31792] test_buffer altered the execution environment

2017-10-15 Thread Stefan Krah

Stefan Krah  added the comment:

I'd push it so we don't have to worry about similar things in the
future.  The "warnings.catch_warnings()" thing is also a workaround
for some past numpy release.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31792] test_buffer altered the execution environment

2017-10-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The issue is fixed on NumPy side (will be included in the next release). Is the 
workaround on our side still needed?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: An endless loop

2017-10-15 Thread Steve D'Aprano
On Mon, 16 Oct 2017 01:38 am, Ned Batchelder wrote:

> We've covered this before.  A challenge for the group: let's not create
> yet another 100-reply thread rehashing the design of Python looping...
> Please? :)

Certainly!

So... who thinks that Python should implement tail recursion optimization so
that we can forgo iteration altogether?

*wicked grin*



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: An endless loop

2017-10-15 Thread Ned Batchelder

On 10/15/17 9:59 AM, bartc wrote:

On 15/10/2017 12:20, Chris Angelico wrote:

On Sun, Oct 15, 2017 at 9:15 PM, bartc  wrote:



I assume you're talking about the while-loop (because on my machine, it
hangs just using 'from turtle...' or 'import turtle').


(Machine was screwed up I think, as I had to restart it shortly after 
for other reasons. When the turtle graphics worked.)


That looks to be a repeat-N-times loop. There isn't a dedicated 
statement
for that, the closest Python feature would be 'for i in range(n)' 
with i a

dummy loop variable.


You can use that or "for _ in range(n)" as a pretty effective form of
that loop. I've never had a problem with it. Python doesn't need
another type of loop.


I could understand that sentiment if there were already dozens. But I 
believe there's only, what, two loop types? To implement a number of 
basic looping requirements which, if not that numerous, are somewhat 
more than two.


Not exactly taxing the grey matter which already has those extra loop 
types in mind, and has to find a way to express them in terms of only 
two.




We've covered this before.  A challenge for the group: let's not create 
yet another 100-reply thread rehashing the design of Python looping... 
Please? :)


--Ned.

--
https://mail.python.org/mailman/listinfo/python-list


[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you Pablo. The initial test leaked a thread, now it is much better.

Could you please make the test testing different timeout values: None, -1, 
-1.0, -0.1, -1e-100?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-15 Thread Pablo

Pablo  added the comment:

I have added a Pull Request fixing this issue. The current implementation is 
checking in the syscall if the value for ms before rounding was negative.

To test for this, I call poll.poll in a thread and check that the thread is 
alive after a join with timeout (so this means it has blocked). Then to clean 
up, I write to a pipe and therefore it unblocks.

The implementation is available in the PR:

https://github.com/python/cpython/pull/4003

--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: An endless loop

2017-10-15 Thread bartc

On 15/10/2017 12:20, Chris Angelico wrote:

On Sun, Oct 15, 2017 at 9:15 PM, bartc  wrote:



I assume you're talking about the while-loop (because on my machine, it
hangs just using 'from turtle...' or 'import turtle').


(Machine was screwed up I think, as I had to restart it shortly after 
for other reasons. When the turtle graphics worked.)



That looks to be a repeat-N-times loop. There isn't a dedicated statement
for that, the closest Python feature would be 'for i in range(n)' with i a
dummy loop variable.


You can use that or "for _ in range(n)" as a pretty effective form of
that loop. I've never had a problem with it. Python doesn't need
another type of loop.


I could understand that sentiment if there were already dozens. But I 
believe there's only, what, two loop types? To implement a number of 
basic looping requirements which, if not that numerous, are somewhat 
more than two.


Not exactly taxing the grey matter which already has those extra loop 
types in mind, and has to find a way to express them in terms of only two.


--
bartc
--
https://mail.python.org/mailman/listinfo/python-list


[issue31792] test_buffer altered the execution environment

2017-10-15 Thread Stefan Krah

Stefan Krah  added the comment:

I can't figure out how to make the damn button green on GitHub,
so LGTM. :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31792] test_buffer altered the execution environment

2017-10-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +3981
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31792] test_buffer altered the execution environment

2017-10-15 Thread Stefan Krah

Stefan Krah  added the comment:

That's fine.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31792] test_buffer altered the execution environment

2017-10-15 Thread STINNER Victor

STINNER Victor  added the comment:

I suggest to always save/restore env vars on numpy import, since we don't
control 3rd party code.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31792] test_buffer altered the execution environment

2017-10-15 Thread Stefan Krah

Stefan Krah  added the comment:

Thanks. If it only occurs when mixing debug/non-debug I don't think we have to 
do anything about it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31792] test_buffer altered the execution environment

2017-10-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It is particularly a NumPy issue (I have opened a bug 
https://github.com/numpy/numpy/issues/9861). It is exposed because I have 
installed NumPy with non-debug build of CPython and run the test with debug 
build of CPython. The test is passes with non-debug build of CPython. I am 
wondering if we can make a workaround and if we should do this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31794] Issues with test.autotest

2017-10-15 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

There are issues with running tests by importing test.autotest.

1. test_builtin failed.

0:00:00 load avg: 0.70 [  4/407] test_builtin
test test_builtin failed -- Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1735, in 
test_input_no_stdout_fileno
lines = self.run_child(child, b"quux\r")
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1680, in 
run_child
% (len(lines), child_output))
AssertionError: got 1 lines in pipe but expected 2, child output was:
quux
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1646, in 
run_child
child(wpipe)
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1733, in child
input("prompt")
EOFError: EOF when reading a line


0:00:00 load avg: 0.70 [  5/407/1] test_exceptions -- test_builtin failed
test test_builtin failed -- Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1735, in 
test_input_no_stdout_fileno
lines = self.run_child(child, b"quux\r")
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1680, in 
run_child
% (len(lines), child_output))
AssertionError: got 1 lines in pipe but expected 2, child output was:
quux
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1646, in 
run_child
child(wpipe)
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1733, in child
input("prompt")
EOFError: EOF when reading a line


0:00:01 load avg: 0.70 [  5/407/1] test_exceptions -- test_builtin failed
0:00:01 load avg: 0.70 [  4/407] test_builtin
Warning -- reap_children() reaped child process 4752
0:00:01 load avg: 0.70 [  4/407] test_builtin
0:00:01 load avg: 0.70 [  6/407/1] test_types
test test_builtin failed -- Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1735, in 
test_input_no_stdout_fileno
lines = self.run_child(child, b"quux\r")
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1680, in 
run_child
% (len(lines), child_output))
AssertionError: got 1 lines in pipe but expected 2, child output was:
quux
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1646, in 
run_child
child(wpipe)
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1733, in child
input("prompt")
EOFError: EOF when reading a line


0:00:01 load avg: 0.70 [  5/407/1] test_exceptions -- test_builtin failed
Warning -- reap_children() reaped child process 4755
0:00:01 load avg: 0.70 [  6/407/1] test_types
0:00:01 load avg: 0.70 [  7/407/1] test_unittest
Warning -- reap_children() reaped child process 4758
0:00:01 load avg: 1.12 [  6/407/1] test_types
0:00:01 load avg: 1.12 [  7/407/1] test_unittest
0:00:01 load avg: 1.12 [  7/407/1] test_unittest
test test_builtin failed -- Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1735, in 
test_input_no_stdout_fileno
lines = self.run_child(child, b"quux\r")
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1680, in 
run_child
% (len(lines), child_output))
AssertionError: got 1 lines in pipe but expected 2, child output was:
quux
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1646, in 
run_child
child(wpipe)
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1733, in child
input("prompt")
EOFError: EOF when reading a line


0:00:01 load avg: 1.12 [  5/407/1] test_exceptions -- test_builtin failed
test test_builtin failed -- Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1735, in 
test_input_no_stdout_fileno
lines = self.run_child(child, b"quux\r")
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1680, in 
run_child
% (len(lines), child_output))
AssertionError: got 1 lines in pipe but expected 2, child output was:
quux
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1646, in 
run_child
child(wpipe)
  File "/home/serhiy/py/cpython/Lib/test/test_builtin.py", line 1733, in child
input("prompt")
EOFError: EOF when reading a line


0:00:01 load avg: 1.12 [  5/407/1] test_exceptions -- test_builtin failed
Warning -- reap_children() reaped child process 4761
0:00:01 load avg: 1.12 [  6/407/1] test_types
Warning -- reap_children() reaped child process 4763

Note that warnings and errors are emitted even after reporting that 
test_builtin failed.


2. Tests are ran multiple times.

0:02:32 load avg: 4.82 [ 77/407/1] test_concurrent_futures
0:02:35 load avg: 4.82 [ 76/407/1] test_complex
0:02:35 load avg: 4.82 [ 77/407/1] test_concurrent_futures
test test_concurrent_futures failed -- multiple errors occurred; run in 

[issue31792] test_buffer altered the execution environment

2017-10-15 Thread Stefan Krah

Stefan Krah  added the comment:

So it is a numpy issue? Which numpy version is it?

--
versions: +Python 3.8 -Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This particular issue can be fixed by adding the condition 
(PyFloat_Check(timeout_obj) && PyFloat_AsDouble(timeout_obj) < 0). The problem 
is only with writing good test for infinity timeout.

This test could be also used for testing issue31334.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: An endless loop

2017-10-15 Thread Chris Angelico
On Sun, Oct 15, 2017 at 9:15 PM, bartc  wrote:
> On 15/10/2017 03:10, Stefan Ram wrote:
>>
>>I made an error I made a thousand times before.
>>
>>I had programmed an endless loop.
>>
>>But never did I see before so clear why it's called
>>an endless loop. (Tested in IDLE.)
>>
>> from turtle import *
>>
>> reset(); reset(); shape( 'turtle' ); showturtle()
>>
>> def poly( n, length ):
>>  i = 0
>>  while i < n:
>>  forward( length )
>>  left( 360/n )
>>
>> poly( 5, 100 )
>> done()
>
>
> I assume you're talking about the while-loop (because on my machine, it
> hangs just using 'from turtle...' or 'import turtle').
>
> That looks to be a repeat-N-times loop. There isn't a dedicated statement
> for that, the closest Python feature would be 'for i in range(n)' with i a
> dummy loop variable.

You can use that or "for _ in range(n)" as a pretty effective form of
that loop. I've never had a problem with it. Python doesn't need
another type of loop.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


what is credit in data mining?

2017-10-15 Thread Umar Yusuf
Hello, 

Anyone useful idea or material on: credit in data mining?



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: An endless loop

2017-10-15 Thread Peter J. Holzer
On 2017-10-15 10:15, bartc  wrote:
> On 15/10/2017 03:10, Stefan Ram wrote:
>>I made an error I made a thousand times before.
>> 
>>I had programmed an endless loop.
>> 
>>But never did I see before so clear why it's called
>>an endless loop. (Tested in IDLE.)
>> 
>> from turtle import *
>> 
>> reset(); reset(); shape( 'turtle' ); showturtle()
>> 
>> def poly( n, length ):
>>  i = 0
>>  while i < n:
>>  forward( length )
>>  left( 360/n )
>> 
>> poly( 5, 100 )
>> done()
>
> I assume you're talking about the while-loop (because on my machine, it 
> hangs just using 'from turtle...' or 'import turtle').

No graphics? 

For those of you who can't use turtle graphics and aren't familiar
enough with it to see what it does without running the program: It
displays a turtle running through the same (pentagon-shaped) loop over
and over again.

Yes, that's a very nice visualization of an endless loop.

hp

-- 
   _  | Peter J. Holzer| Fluch der elektronischen Textverarbeitung:
|_|_) || Man feilt solange an seinen Text um, bis
| |   | h...@hjp.at | die Satzbestandteile des Satzes nicht mehr
__/   | http://www.hjp.at/ | zusammenpaßt. -- Ralph Babel
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: An endless loop

2017-10-15 Thread bartc

On 15/10/2017 03:10, Stefan Ram wrote:

   I made an error I made a thousand times before.

   I had programmed an endless loop.

   But never did I see before so clear why it's called
   an endless loop. (Tested in IDLE.)

from turtle import *

reset(); reset(); shape( 'turtle' ); showturtle()

def poly( n, length ):
 i = 0
 while i < n:
 forward( length )
 left( 360/n )

poly( 5, 100 )
done()


I assume you're talking about the while-loop (because on my machine, it 
hangs just using 'from turtle...' or 'import turtle').


That looks to be a repeat-N-times loop. There isn't a dedicated 
statement for that, the closest Python feature would be 'for i in 
range(n)' with i a dummy loop variable.


--
bartc
--
https://mail.python.org/mailman/listinfo/python-list


[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-15 Thread Berker Peksag

Change by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31792] test_buffer altered the execution environment

2017-10-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I just have installed NumPy. It temporary sets these two environment variables 
for importing the multiarray numpy extension module, but forgot to remove them 
if the import is failed.

test_buffer imports numpy.

try:
with warnings.catch_warnings():
from numpy import ndarray as numpy_array
except ImportError:
numpy_array = None

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31793] Allow to specialize smart quotes in documentation translations

2017-10-15 Thread Roundup Robot

Change by Roundup Robot :


--
keywords: +patch
pull_requests: +3980
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31793] Allow to specialize smart quotes in documentation translations

2017-10-15 Thread Julien Palard

New submission from Julien Palard :

It would be great to allow each translation to specify their smart-quotes 
configuration, typically Japanese prefer no smart-quotes:

- https://github.com/python/docsbuild-scripts/issues/32

It's easily done by adding a Doc/docutils.conf file, I'm opening a PR.

--
assignee: docs@python
components: Documentation
messages: 304429
nosy: docs@python, mdk
priority: normal
severity: normal
status: open
title: Allow to specialize smart quotes in documentation translations
versions: Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Case Solution: Doing Business in Sierra Leone Graeme Hossie at London Mining (A) by Brian C. Pinkham, Ken Mark

2017-10-15 Thread premikasharma97
1.  What priorities should Hossie consider?

2.  What are some of the concerns around enforcement of the contracts?

3.  How should Hossie carry out negotiations?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31792] test_buffer altered the execution environment

2017-10-15 Thread STINNER Victor

STINNER Victor  added the comment:

Why the env changed wasn't noticed before? Is it a recent change?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-15 Thread STINNER Victor

STINNER Victor  added the comment:

I suggest to implement ROUND_UP in pytime and use it in all functions
accepting a timeout, not only poll. Search for ROUND_CEILING in the code to
find them. But functions accepting time like clock_settime() must continue
to use ROUND_CEILING.

Does someone want to work on such patch? The new rounding mode must be test
in test_time, you should just add the new mode at the top once if I recall
correctly.

---

select.poll currently uses ROUND_CEILING: round towards +infinity.

It looks like you would prefer ROUND_UP: round away from zero, right?

In the history of CPython, the rounding mode of functions accepting time,
timeout, duration, etc. changed many times, mostly because the C code
changed in subtle ways to fix different bugs. I mean that the exact
rounding mode wasn't really chosen on purpose. I'm now trying to get better
defined rouding modes in pytime, but it seems poll uses the wrong one.

https://haypo.github.io/pytime.html

I think that my problem is that I wanted to reuse the same rounding modes
for different use cases. It seems like clocks need ROUND_CEILING but
timeouts need ROUND_UP. Well, in the case of poll, the previous code before
moving to pytime was using ceil() which uses ROUND_CEILING.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31792] test_buffer altered the execution environment

2017-10-15 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

test_buffer adds two environment variables: 'OPENBLAS_MAIN_FREE': '1', 
'GOTOBLAS_MAIN_FREE': '1'.

$ ./python -m test -v test_buffer
...
Warning -- os.environ was modified by test_buffer
  Before: (140174267697792, environ({...})
  After:  (140174267697792, environ({..., 'OPENBLAS_MAIN_FREE': '1', 
'GOTOBLAS_MAIN_FREE': '1'}) 
test_buffer failed (env changed)

1 test altered the execution environment:
test_buffer

Total duration: 8 sec
Tests result: SUCCESS

--
components: Tests
messages: 304426
nosy: ezio.melotti, haypo, michael.foord, serhiy.storchaka, skrah
priority: normal
severity: normal
status: open
title: test_buffer altered the execution environment
type: resource usage
versions: Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31788] Typo in comments Modules/_ssl.c

2017-10-15 Thread Roundup Robot

Change by Roundup Robot :


--
keywords: +patch
pull_requests: +3979
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31788] Typo in comments Modules/_ssl.c

2017-10-15 Thread Berker Peksag

Change by Berker Peksag :


--
versions:  -Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31788] Typo in comments Modules/_ssl.c

2017-10-15 Thread Berker Peksag

Change by Berker Peksag :


--
keywords: +easy
stage:  -> needs patch
type:  -> behavior
versions:  -Python 3.4, Python 3.5, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31754] Documented type of parameter 'itemsize' to PyBuffer_FillContiguousStrides is incorrect.

2017-10-15 Thread Berker Peksag

Change by Berker Peksag :


--
stage: patch review -> backport needed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31754] Documented type of parameter 'itemsize' to PyBuffer_FillContiguousStrides is incorrect.

2017-10-15 Thread Berker Peksag

Berker Peksag  added the comment:


New changeset e881302b70ab36bafcf37e3917be118bbec97763 by Berker Peksag (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-31754: Fix type of 'itemsize' in PyBuffer_FillContiguousStrides 
(GH-3993)
https://github.com/python/cpython/commit/e881302b70ab36bafcf37e3917be118bbec97763


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31754] Documented type of parameter 'itemsize' to PyBuffer_FillContiguousStrides is incorrect.

2017-10-15 Thread Berker Peksag

Change by Berker Peksag :


--
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31754] Documented type of parameter 'itemsize' to PyBuffer_FillContiguousStrides is incorrect.

2017-10-15 Thread Berker Peksag

Berker Peksag  added the comment:


New changeset 1b9e76ed3a055a53ca67397e928e1b408461900b by Berker Peksag 
(vyas45) in branch 'master':
bpo-31754: Fix type of 'itemsize' in PyBuffer_FillContiguousStrides (GH-3993)
https://github.com/python/cpython/commit/1b9e76ed3a055a53ca67397e928e1b408461900b


--
nosy: +berker.peksag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31754] Documented type of parameter 'itemsize' to PyBuffer_FillContiguousStrides is incorrect.

2017-10-15 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +3978

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31791] Ensure that all PyTypeObject fields are set to non-NULL defaults

2017-10-15 Thread pdox

pdox  added the comment:

serhiy.storchaka:

1) Where tp_as_number would normally be NULL, instead it would point to a fixed 
PyNumberMethods structure containing the default functions. This would make the 
memory increase negligible, as all non-number types would use the same 
structure.

2) If this is behavior we want to formally support, then we should provide 
macros for it. (all they must do is compare against the default pointer value, 
rather than NULL). Are there particular extension(s) you suspect may be doing 
this?

3) This has to be handled on a case-by-case basis. I would not remove inlined 
optimizations. If there are some fields that truly benefit from remaining NULL, 
those can be left alone. I would like to focus on the functions for which the 
common case (in code without type errors) is to make the indirect call.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31791] Ensure that all PyTypeObject fields are set to non-NULL defaults

2017-10-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

1. This will increase the size of type object. Most types are not numbers, not 
collections and don't support the buffer protocol, thus save memory for 
tp_as_number, tp_as_sequence, tp_as_mapping and tp_as_buffer. This also can 
increase the time of type creation.

2. This will make harder testing that the particular protocol is supported 
(e.g. see PyIndex_Check or PyObject_CheckBuffer). And this will break any 
third-party code that does this directly, without using C API.

3. Calling function instead of executing inlined code after checking can 
increase stack consumption and slow down execution (see the usage of 
tp_descr_get).

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31791] Ensure that all PyTypeObject fields are set to non-NULL defaults

2017-10-15 Thread pdox

pdox  added the comment:

I believe it would also make sense to inline the 'as' structures (tp_as_async, 
tp_as_number, tp_as_sequence, tp_as_mapping, and tp_as_buffer), instead of 
having them be pointers. This would save one pointer dereference with each use. 
But this would have API compatibility consequences, so for this change it is 
off the table.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31791] Ensure that all PyTypeObject fields are set to non-NULL defaults

2017-10-15 Thread pdox

New submission from pdox :

Ensure that every function pointer in every PyTypeObject is set to a non-NULL 
default, to spare the cost of checking for NULL with every use. As a basic 
example, consider PyNumber_Negative:

PyObject *
PyNumber_Negative(PyObject *o)
{
PyNumberMethods *m;

if (o == NULL) {
return null_error();
}

m = o->ob_type->tp_as_number;
if (m && m->nb_negative)
return (*m->nb_negative)(o);

return type_error("bad operand type for unary -: '%.200s'", o);
}

If "tp_as_number" and "nb_negative" were always guaranteed non-NULL, then the 
function could omit the second if statement, and invoke the function pointer 
directly. To maintain the existing behavior, the default nb_negative function 
would be set to the following:

PyObject* nb_negative_default(PyObject *o) {
return type_error("bad operand type for unary -: '%.200s'", o);
}

This removes two NULL-checks from the PyNumber_Negative. Many other operators 
and builtins would be able to benefit in the same way.

--
components: Interpreter Core
messages: 304420
nosy: pdox
priority: normal
severity: normal
status: open
title: Ensure that all PyTypeObject fields are set to non-NULL defaults
type: performance
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30744] Local variable assignment is broken when combined with threads + tracing + closures

2017-10-15 Thread Nick Coghlan

Nick Coghlan  added the comment:

Just confirming that the locals() vs frame.f_locals distinction also exists in 
the C API: the former is PyEval_GetLocals() (which implicitly ensures the 
snapshot is up to date), while the equivalent of the latter is direct access to 
frame->f_locals (and it's left to code accessing the field to decide whether it 
needs an up to date snapshot or not).

That means I'll be able to change what we store in frame->f_locals, while 
updating PyEval_GetLocals to check for a _FastLocalsProxy instance and return a 
reference to the underlying snapshot instead.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31790] double free or corruption (while using smem)

2017-10-15 Thread Zoltan Krajcsovics

New submission from Zoltan Krajcsovics :

Command executed when the crash happened:

/usr/bin/python /usr/bin/smem -t -c command pss -P /usr/lib/chromium/chromium

The attached error.log contains the backtrace and memory map printed.

This is a sporadic error, the command is called every second 0-24, and I got 
one such error after half a day of running. I probably had another after a few 
days, but I failed to save that one, so I am not sure, if they are really the 
same.

It would seem that using a more overloaded / older machine triggers the error 
more often, the machine I got it on was a

Hewlett-Packard HP Compaq dc7900 Small Form Factor/3031h, BIOS 786G1 v01.27 
10/22/2015

The problem seems to have emerged after updating to Debian Stretch.

python version:
Python 2.7.13

smem version:
pool/main/s/smem/smem_1.4-2_all.deb
(could not get an internal smem version, only the debian package)

--
components: Library (Lib)
messages: 304418
nosy: zulthan
priority: normal
severity: normal
status: open
title: double free or corruption (while using smem)
type: crash
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com