[issue21470] Better seeding for the random module

2014-05-11 Thread Charles-François Natali

Charles-François Natali added the comment:

 The default seeding for the random module currently used 32 bytes from
 urandom() to create the initial state of the random number generator.
 This is far less than the number of possible states 2**19937-1.

I'm not a cryptography expert, but IMO 32 bytes is more than enough:
for example, ssh-keygen only reads 32 bytes from /dev/urandom when
generating a new key (and I assume the authors know what they're
doing).
So I'm not sure that convering the state space is a good enough
reason to increase the amount of data read: it can hut performance,
not only for the singla process case, but also because /dev/urandom is
protected by a spinlock/mutex, it can hurt workloads where multiple
processes are simultaneously reading from /dev/urandom (which is the
reason we switched to a persistent /dev/urandom FD), see e.g.
http://drsnyder.us/2014/04/16/linux-dev-urandom-and-concurrency.html

And I especially like this answer by Ted Ts'o (once again, I assume he
knows what he's talking about):

Doctor, doctor it hurts when I do this. Well, then don't do that!

The reason for the spinlock is to avoid having two reads from
/dev/urandom return the same results. That would be undesirable...

If people are trying to read from /dev/urandom a huge number of times
per second, then they're doing something wrong. The real issue, as
Sebastian has pointed out, is that issue spawning a huge number of
curl processes for each request. Then hopefully curl is using
/dev/urandom to initialize its own userspace RNG (many crypto
libraries do this; most *should* do this), so you're not trying to
read from /dev/urandom for every single request. /dev/urandom is
designed for security, not for speed.


--

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



[issue21424] Simplify and speed-up heaqp.nlargest()

2014-05-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fadc06047314 by Raymond Hettinger in branch 'default':
Issue #21424:  Optimize heaqp.nlargest() to make fewer tuple comparisons.
http://hg.python.org/cpython/rev/fadc06047314

--
nosy: +python-dev

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



[issue21467] IDLE icon not included in Windows installer

2014-05-11 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage: test needed - resolved

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



[issue21424] Simplify and speed-up heaqp.nlargest()

2014-05-11 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file35213/rip_nsmallest.diff

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



[issue21470] Better seeding for the random module

2014-05-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Several thoughts:

* We're not reading urandom a huge number of times per second.  This is just 
one read of 2,500 bytes.  What Ted is talking about and what we're doing are as 
different as night and day.

* We're also not doing this in a loop.  It is just once when Random() is 
initialized.  There are no threading issues here.

* 32 bytes is good but it is not enough.  There is a reason that the state 
space for the Mersenne Twister is so large to begin with.  Functions as simple 
as shuffle() eat through the possibilities very quickly.

* The doctor, it hurts quote is funny, but we don't have any hurt here.  
Running import os; os.urandom(2500) takes under a millisecond on my system.

--

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



[issue21470] Better seeding for the random module

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 http://www.2uo.de/myths-about-urandom/

Thanks, interesting read.

--

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



[issue21470] Better seeding for the random module

2014-05-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue21471] subprocess line-buffering only works in universal newlines mode

2014-05-11 Thread Antoine Pitrou

New submission from Antoine Pitrou:

The docs for subprocess.Popen seem to imply that line-buffering is always 
available. However, bufsize=1 is a special value only when open the pipes in 
text mode, i.e. when universal newlines are enabled.

In the short term, we should probably fix the subprocess docs.
In the long term, perhaps we can add a line buffering capability to 
BufferedWriter?

--
components: Library (Lib)
messages: 218257
nosy: benjamin.peterson, gregory.p.smith, hynek, pitrou, stutzbach
priority: normal
severity: normal
status: open
title: subprocess line-buffering only works in universal newlines mode
type: behavior
versions: Python 3.5

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



[issue21472] Fix wsgiref handling of absolute HTTP Request-URI

2014-05-11 Thread mouad

New submission from mouad:

Hi,

As most of you know, working behind a HTTP proxy raise all this corner cases 
that no one think about until he has to, one of them i had to deal with some 
months ago is absolute request URI in HTTP request, that some client will send 
when they detect that they are behind an HTTP proxy, to be more precise i am 
talking about this section of rfc2616 
(https://gist.github.com/mouadino/7930974), i.e.

  GET http://domain.com/path HTTP/1.1

As my surprise i found that most WSGI server that are out there doesn't support 
very well this feature including wsgiref, to test that i have created this 
simple python script https://gist.github.com/mouadino/7930974 that include also 
status of this bug in different other projects.

In term of bug impact, if a WSGI server doesn't support this, the WSGI 
environment variable PATH_INFO will end up containing an absolute URI instead 
of relative as the standard require 
(http://legacy.python.org/dev/peps/pep-0333/), which mean that most uri routing 
that web framework do end up failing (Returning 404) b/c most of them will try 
to much PATH_INFO with there different routes (which are relative paths) to 
find which controller action should they executed e.g. 
https://pypi.python.org/pypi/Routes .

FWIW i found this bug while trying to debug boto library (that use absolute uri 
if proxy is detected 
https://github.com/mouadino/boto/blob/v2.13.2/boto/connection.py#L955) that was 
communicating with an OpenStack API that use eventlet wsgi server  (That 
doesn't handle absolute URI 
https://github.com/eventlet/eventlet/blob/v0.14/eventlet/wsgi.py#L471) and 
routes (that match PATH_INFO with action path 
https://github.com/bbangert/routes/blob/master/routes/mapper.py#L678).

--
components: Library (Lib)
messages: 218258
nosy: mouad, pje
priority: normal
severity: normal
status: open
title: Fix wsgiref handling of absolute HTTP Request-URI
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue21471] subprocess line-buffering only works in universal newlines mode

2014-05-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue21472] Fix wsgiref handling of absolute HTTP Request-URI

2014-05-11 Thread mouad

Changes by mouad mouad...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file35214/issue21472.patch

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



[issue21471] subprocess line-buffering doesn't work

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ha, it seems actually worse than that, since no buffering argument is ever 
passed to the TextIOWrapper constructor. bufsize=1 will simply get ignored, 
and line buffering doesn't work at all.

Example under 2.7:

$ python -c 'import subprocess; p = subprocess.Popen([/bin/cat], 
stdin=subprocess.PIPE, stdout=subprocess.PIPE, bufsize=1, 
universal_newlines=True); p.stdin.write(foo\n); print(p.stdout.readline()); 
p.stdin.close()'
foo

Under 3.4, the same line hangs in the p.stdout.readline() call.

--
title: subprocess line-buffering only works in universal newlines mode - 
subprocess line-buffering doesn't work

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue21471] subprocess line-buffering only works in universal newlines mode

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, the not working at all part is issue #21332. Let's make this issue 
specific to binary mode, again.

--
nosy: +akira
title: subprocess line-buffering doesn't work - subprocess line-buffering only 
works in universal newlines mode

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



[issue20115] NUL bytes in commented lines

2014-05-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ab3e012c45d0 by Antoine Pitrou in branch '3.4':
Issue #21425: Fix flushing of standard streams in the interactive interpreter.
http://hg.python.org/cpython/rev/ab3e012c45d0

New changeset d1c0cf44160c by Antoine Pitrou in branch 'default':
Issue #21425: Fix flushing of standard streams in the interactive interpreter.
http://hg.python.org/cpython/rev/d1c0cf44160c

--
nosy: +python-dev

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks for the report. This should now be fixed in 3.4 and 3.5.

--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue21389] The repr of BoundMethod objects sometimes incorrectly identifies the bound function

2014-05-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue18564] Integer overflow in socketmodule

2014-05-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue21226] PyImport_ExecCodeModuleObject not setting module attributes

2014-05-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue21422] int 0: return the number unmodified

2014-05-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue21121] -Werror=declaration-after-statement is added even for extension modules through setup.py

2014-05-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue21420] Optimize 2 ** n: implement it as 1 n

2014-05-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue20383] Add a keyword-only spec argument to types.ModuleType

2014-05-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue21436] Consider leaving importlib.abc.Loader.load_module()

2014-05-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue21471] subprocess line-buffering only works in universal newlines mode

2014-05-11 Thread akira

akira added the comment:

Until the current patch for issue #21332 is committed; bufsize=1 is 
equivalent to bufsize=-1 in both binary and text mode. 

You are correct the patch in #21332 fixes only the text mode
(universal_newlines=True) -- it also updates the documentation
to mention that bufsize=1 works only in text mode.

--

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



[issue21332] subprocess bufsize=1 docs are misleading

2014-05-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Apparently the new tests hang on the Fedora without threads buildbot.
Stefan, could you take a look?

http://buildbot.python.org/all/builders/AMD64%20Fedora%20without%20threads%203.4/builds/123

--
nosy: +skrah
status: closed - open

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Also on the PowerLinux buildbot:
http://buildbot.python.org/all/builders/PPC64%20PowerLinux%203.4/builds/113/

--
nosy: +David.Edelsohn

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Judging by the faulthandler traceback in the PowerLinux build:

Timeout (1:00:00)!
Thread 0x008074e46670 (most recent call first):
  File 
/home/shager/cpython-buildarea/3.4.edelsohn-powerlinux-ppc64/build/Lib/test/test_cmd_line_script.py,
 line 192 in interactive_python
  File 
/home/shager/cpython-buildarea/3.4.edelsohn-powerlinux-ppc64/build/Lib/contextlib.py,
 line 59 in __enter__
  File 
/home/shager/cpython-buildarea/3.4.edelsohn-powerlinux-ppc64/build/Lib/test/test_cmd_line_script.py,
 line 205 in check_repl_stderr_flush
  File 
/home/shager/cpython-buildarea/3.4.edelsohn-powerlinux-ppc64/build/Lib/test/test_cmd_line_script.py,
 line 220 in test_repl_stderr_flush
[snip]

... the test is actually stuck trying to read the interactive prompt from 
stderr:

# Drain stderr until prompt
while True:
data = stderr.read(4)
if data == b :
break
stderr.readline()-- HERE

--

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ffae7aad9dfa by Antoine Pitrou in branch 'default':
Add debugging output for #21425
http://hg.python.org/cpython/rev/ffae7aad9dfa

--

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



[issue6305] islice doesn't accept large stop values

2014-05-11 Thread Alok Singhal

Alok Singhal added the comment:

Yes, I signed it a few days ago.

--

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



[issue21472] Fix wsgiref handling of absolute HTTP Request-URI

2014-05-11 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage:  - patch review
versions:  -Python 3.1, Python 3.2, Python 3.3

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

So, it seems like under Fedora (or PowerLinux), the Python interactive prompt 
produces different byte contents on stderr:

[ 21/389] test_cmd_line_script
repl stderr[:4]: b'Pyth'
repl stderr[:4]: b'[GCC'
repl stderr[:4]: b'Type'
repl stderr[:4]: b'\x1b[?1'

I wonder if it's because of GNU readline?

--

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



[issue21470] Better seeding for the random module

2014-05-11 Thread Mark Dickinson

Mark Dickinson added the comment:

Raymond:

 Functions as simple as shuffle() eat through the possibilities very quickly.

Can you elaborate on this?  Are there example scenarios where seeding with 32 
bytes isn't likely to be enough?

In the case of shuffle, for a large list, if you do a seed followed by a 
shuffle, the restriction to 32 bytes is restricting us to 'only' about 10**77 
possible different shuffle results.  It's hard to imagine a situation where 
that would be a problem.

--
nosy: +mark.dickinson

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This looks like a well-known issue on Fedora (and Red Hat?):
http://stackoverflow.com/questions/15760712/python-readline-module-prints-escape-character-during-import
http://reinout.vanrees.org/weblog/2009/08/14/readline-invisible-character-hack.html
http://lists.gnu.org/archive/html/bug-readline/2007-08/msg4.html

Apparently using XTERM=vt100 would workaround the issue.
(I can't reproduce under Ubuntu)

--
nosy: +dmalcolm

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e57718ac8ff8 by Antoine Pitrou in branch 'default':
Try workaround for test issues in #21425
http://hg.python.org/cpython/rev/e57718ac8ff8

--

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



[issue21470] Better seeding for the random module

2014-05-11 Thread Charles-François Natali

Charles-François Natali added the comment:

 * We're not reading urandom a huge number of times per second.  This is 
 just one read of 2,500 bytes.  What Ted is talking about and what we're doing 
 are as different as night and day.

 * We're also not doing this in a loop.  It is just once when Random() is 
 initialized.  There are no threading issues here.

Well, you don't know how people will use it though: some code spawns
many processes per second (see recent discussion on python-dev).

 * 32 bytes is good but it is not enough.  There is a reason that the state 
 space for the Mersenne Twister is so large to begin with.  Functions as 
 simple as shuffle() eat through the possibilities very quickly.

As I said, I'm not a cryptography expert, but quoting the link you gave:
About 256 bits of entropy are enough to get computationally secure
numbers for a long, long time.

The kernel's CSPRNG itself considers 256 bits enough, so I'm curious
as to what makes you think that 32 *bytes* is not enough.

openssl itself only reads 32 bytes from /dev/urandom:

$ strace -e open,read openssl genrsa
open(/dev/urandom, O_RDONLY|O_NOCTTY|O_NONBLOCK) = 3
read(3, 
\336\314\312\355\305\312\375\244\276G\n\201^\32\236\301\243\327\277\344\320\0\5\3017-\\\346\333G?,
32) = 32


In short, everyone seems to think that 32bytes seeding is more than enough.

--

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

According to https://bugzilla.redhat.com/show_bug.cgi?id=880393, this has 
actually been reported to us as issue19884.

--

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



[issue19884] Importing readline produces erroneous output

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

We seem to have gotten bit by this in issue21425.

Dave, is it possible for you to validate the proposed fix? I can't test this 
under Ubuntu.

Setting priority to high as it seems to actually annoy many people:

http://stackoverflow.com/questions/15760712/python-readline-module-prints-escape-character-during-import
http://reinout.vanrees.org/weblog/2009/08/14/readline-invisible-character-hack.html
http://lists.gnu.org/archive/html/bug-readline/2007-08/msg4.html

--
nosy: +skrah
priority: normal - high
versions: +Python 3.5 -Python 3.3

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Workarounds seem to work.

--

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 58e2116576cf by Antoine Pitrou in branch '3.4':
Try workaround for test issues in #21425
http://hg.python.org/cpython/rev/58e2116576cf

--

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
status: open - closed

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



[issue21455] add default backlog to socket.listen()

2014-05-11 Thread Charles-François Natali

Charles-François Natali added the comment:

Any objection to the last version?

If not, I'll commit it within a few days.

--

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



[issue21455] add default backlog to socket.listen()

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Looks good to me!

--

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Workaround actually broke tests under shared library builds, because 
LD_LIBRARY_PATH isn't forwarded anymore. Will try another fix :-(

--
status: closed - open

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5a1b2566d68e by Antoine Pitrou in branch 'default':
Try to fix issue #21425 workaround for shared library builds
http://hg.python.org/cpython/rev/5a1b2566d68e

--

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



[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 974c0718c7e0 by Antoine Pitrou in branch '3.4':
Try to fix issue #21425 workaround for shared library builds
http://hg.python.org/cpython/rev/974c0718c7e0

--

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



[issue21466] General Index link to del statement is wrong

2014-05-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 951775c68b1b by Benjamin Peterson in branch '2.7':
remove confusing delete indexing (closes #21466)
http://hg.python.org/cpython/rev/951775c68b1b

New changeset 2e26703d7d2a by Benjamin Peterson in branch '3.4':
remove confusing delete indexing (closes #21466)
http://hg.python.org/cpython/rev/2e26703d7d2a

--
nosy: +python-dev
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue21469] Hazards in robots.txt parser

2014-05-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Attaching a draft patch:

* Repair the broken link to norobots-rfc.txt.

* HTTP response codes = 500 treated as a failed read rather than as a not 
found.  Not found means that we can assume the entire site is allowed.  A 5xx 
server error tells us nothing.

* A successful read() updates the mtime (which is defined to be the time the 
robots.txt file was last fetched).

* The can_fetch() method returns False unless we've had a read() with a 2xx or 
4xx response.  This avoids false positives in the case where a user calls 
can_fetch() before calling read().

--
assignee:  - rhettinger
keywords: +patch
Added file: http://bugs.python.org/file35215/fix_false_pos.diff

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



[issue21469] Hazards in robots.txt parser

2014-05-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Update patch to move the modified() call to parse().  That lets the mtime 
update whenever rules (either by a read() or by directly parsing text).

--

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



[issue21469] Hazards in robots.txt parser

2014-05-11 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


Added file: http://bugs.python.org/file35216/fix_false_pos2.diff

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



[issue7776] http.client.HTTPConnection tunneling is broken

2014-05-11 Thread Nikolaus Rath

Nikolaus Rath added the comment:

Cybjit rep...@bugs.python.org writes:
 Cybjit added the comment:

 On 2014-05-10 00:23, nikratio wrote:
 Is pip maybe doing its own certificate check, and relying on
 HTTPSConnection.host to contain the final hostname rather than the proxy?

 I think the culprit might be here
 https://github.com/pypa/pip/blob/1.5.4/pip/_vendor/requests/packages/urllib3/connection.py#L172

Yes, that's the problem. I guess that nicely demonstrates why using
inheritance as an API is not a good idea.

I guess we nevertheless need to repair/work around this in Python 3.4?
Unfortunately pip explicitly relies on _set_tunnel() to set self.host =
self._tunnel_host. So we would need to change _set_tunnel() to save the
original attribute somewhere, change the other methods to use the saved
attribute in favor of the real one, and have connect() restore it (so
that we can reconnect). This still would not allow pip to reconnect
(because it overwrites the connect method), but then reconnecting a
tunneled connection with pip did not work before either. Still, rather
ugly.

Alternatively, maybe we could also do nothing, because if pip is
depending on undocumented semantics of a private method (_set_tunnel),
they have to live with the consequences?

Thinking about this, I think we should just revert the entire patch for
3.4, but keep it in for 3.5. That gives the pip folks enough time to fix
their code. Fixing the issue in 3.4 is probably not that crucial (after
all, it existed since about 2.6.3).

Best,
Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

 »Time flies like an arrow, fruit flies like a Banana.«

--

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



[issue21470] Better seeding for the random module

2014-05-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

  32 bytes seeding is more than enough.

Not enough to cover *our* state space (2 ** 19937 - 1).

This tracker item boils down to balancing fear that something bad will happen 
when you call urandom(2500) versus having seeding sufficient to cover the 
state space.

My judgment (based on the cited article) is the first is FUD and that the 
second is something that has gives us the full value from the Mersenne Twister.

What constitutes enough is a value judgment that many vary from application 
to application.  For some applications, a much weaker PRNG  would suffice, but 
we decided long ago that we wanted the full power of MT.

If you an show an actual downside (not just fear of badness), then we have 
bigger issues (i.e. needing to document that SystemRandom() and os.urandom() 
have major limitations and should be avoided).

On my system, the difference between a call to urandom(32) and urandom(2500) is 
measured in microseconds.   I believe (but am having a hard time measuring) 
that the call is even cheaper than the subsequent processing we do 
random_seed() and init_by_array().

In other words, the worry about calling urandom(2500) appears to baseless or 
immaterial.  If you have timings that show evidence to the contrary, I would 
like to see them.

--

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



[issue21470] Better seeding for the random module

2014-05-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/C-LANG/MersenneTwister.h

http://www.omnetpp.org/doc/omnetpp/api/mersennetwister_8h_source.html

--

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



[issue21470] Better seeding for the random module

2014-05-11 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
Removed message: http://bugs.python.org/msg218288

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



[issue21470] Better seeding for the random module

2014-05-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/C-LANG/MersenneTwister.h

http://www.omnetpp.org/doc/omnetpp/api/mersennetwister_8h_source.html

http://www0.cs.ucl.ac.uk/staff/d.jones/GoodPracticeRNG.pdf

--

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



[issue21470] Better seeding for the random module

2014-05-11 Thread STINNER Victor

STINNER Victor added the comment:

The default seeding for the random module currently used 32 bytes from 
urandom() to create the initial state of the random number generator.  This is 
far less than the number of possible states 2**19937-1.

I suggest to document how the PRNG is initialized instead of reading more bytes 
from /dev/urandom.

--
nosy: +haypo

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



[issue21470] Better seeding for the random module

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 What constitutes enough is a value judgment that many vary from
 application to application.  For some applications, a much weaker PRNG 
 would suffice, but we decided long ago that we wanted the full power of MT.

I don't really understand for which application 2 bits of seeding entropy 
would be required *in practice*. Surely MT has other interesting properties 
(such as the statistical distribution of the output) than its insanely large 
cycle length, that make it desirable as a PRNG.

The paper you linked to (Good Practice in (Pseudo) Random Number Generation 
for Bioinformatics Applications) doesn't suggest feeding a 2 bits seed, it 
actually seems to say that 64 bits is enough for numerical simulations run on 
large clusters.

While reading 2 bits off of /dev/urandom might be fast under Linux, it 
might not necessarily be the case on other systems. It doesn't sound reasonable 
to read this many data if there isn't a strong reason for doing it.

--

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



[issue10744] ctypes arrays have incorrect buffer information (PEP-3118)

2014-05-11 Thread mattip

mattip added the comment:

Here are updated patches for 2.7 and HEAD. 

I've updated the patches for both python 2 and python 3 and addressed some of 
the issues here:
1. Added _ctypes_alloc_format_string_with_shape() to ctypes.h
2. Changed the buffer size calculation to 32 *ndim + 3 (for the question asked 
before, the 32 size is just because this was the size used before the patch)
3. Changed the sprintf to use the macro: sprintf(buf, %PY_FORMAT_SIZE_Td,, 
shape[k]);

I really hope this patch makes it to 2.7.7 and python 3 versions, as currently 
the situation is broken and code that once worked with older numpy versions 
does not work today (and we have legacy code that stopped working).

--
nosy: +mattip
versions: +Python 2.7
Added file: 
http://bugs.python.org/file35217/hg-python2.7-ctypes-fix-pep3118-format-strings-for-arrays-updated.patch

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



[issue10744] ctypes arrays have incorrect buffer information (PEP-3118)

2014-05-11 Thread mattip

mattip added the comment:

Here is the patch for HEAD

--
Added file: 
http://bugs.python.org/file35218/hg-default-ctypes-fix-pep3118-format-strings-for-arrays-update.patch

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



[issue10744] ctypes arrays have incorrect buffer information (PEP-3118)

2014-05-11 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge
versions: +Python 3.5 -Python 2.7, Python 3.3

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



[issue10744] ctypes arrays have incorrect buffer information (PEP-3118)

2014-05-11 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
versions: +Python 2.7

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



[issue7776] http.client.HTTPConnection tunneling is broken

2014-05-11 Thread Ned Deily

Ned Deily added the comment:

Should this be a release blocker regression for 3.4.1?

--
nosy: +larry, ned.deily
priority: normal - release blocker

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



[issue7776] http.client.HTTPConnection tunneling is broken

2014-05-11 Thread Larry Hastings

Larry Hastings added the comment:

dstufft, what do you think?

--
nosy: +dstufft

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



[issue21470] Better seeding for the random module

2014-05-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Looking back over this tracker item, I realize that I didn't elaborate 
sufficiently on the problem being addressed:

MT is equidistributed.  This a major point in its favor but also implies that 
there are long stretches of uninteresting sequences.  When we seed with only 
a subset the state space, there is a risk of systematically landing in those 
stretches.

That is why the cited best practices paper recommends filling the seed space 
and likely is why the cited reference implementation uses /urandom to fill the 
state space.

We've previously had this problem with MT (since resolved, where it is was 
landed in a very non-random zone).   We can't avoid the *possibility* of 
landing in one of these zones, but we can make sure that it isn't a 
*systematic* recurring problem.  By using a sufficiently large seed, we avoid 
biasing the selection of which sequences are visitable out of the huge MT 
period.

Though the current 32 bytes is pretty good (I hope so, I'm the one that chose 
that constant), there is no question that there is some benefit from the larger 
seed and that we are following in the footsteps of published reference 
implementations.

The real question is whether there is a actual downside to calling 
urandom(2500).  AFAICT, the impact is insignificant (increasing the cost of 
initialization by mirco-seconds, a percentage increase so small that I can't 
measure it).

--

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



[issue7776] http.client.HTTPConnection tunneling is broken

2014-05-11 Thread Donald Stufft

Donald Stufft added the comment:

Let me raise the issue with urllib3 and see if maybe we can get a quick turn 
around and just fix it for real.

--

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



[issue10744] ctypes arrays have incorrect buffer information (PEP-3118)

2014-05-11 Thread eryksun

eryksun added the comment:

The shape for the StructWithArrays test should be () in 3.x; it's None in 2.x.

--
nosy: +eryksun
versions: +Python 3.3 -Python 3.5

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



[issue7776] http.client.HTTPConnection tunneling is broken

2014-05-11 Thread Donald Stufft

Donald Stufft added the comment:

This is going to break existing versions of urllib3 (and thus requests and thus 
pip) when using verified TLS + a proxy, however future versions can work around 
it and a fix is being looked at right now. Once it's fixed there it can 
propagate to requests and then to pip.

Urllib3 issue is here https://github.com/shazow/urllib3/issues/385

As far as what CPython should do. I personally don't think 3.4.1 should go out 
with this broken. That'll mean either getting a new pip out with the fix and 
bump the bundled version in CPython or revert this patch and wait till 3.5 (or 
3.4.2 if you don't want to hold up 3.4.1).

--

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



[issue21424] Simplify and speed-up heaqp.nlargest()

2014-05-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 31950174f60f by Raymond Hettinger in branch 'default':
Issue 21424:  Apply the nlargest() optimizations to nsmallest() as well.
http://hg.python.org/cpython/rev/31950174f60f

--

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



[issue21424] Simplify and speed-up heaqp.nlargest()

2014-05-11 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
resolution:  - fixed
status: open - closed

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



[issue21470] Better seeding for the random module

2014-05-11 Thread Tim Peters

Tim Peters added the comment:

[neologix]
 some code spawns many processes per second (see recent
 discussion on python-dev).

But that doesn't imply they're seeding the random module many times per second, 
right? Seeding isn't part of Python initialization, it's part of importing the 
`random` module.

Note that hash randomization is a different thing, unrelated to random.py.

--

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



[issue21470] Better seeding for the random module

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 [neologix]
  some code spawns many processes per second (see recent
  discussion on python-dev).
 
 But that doesn't imply they're seeding the random module many times
 per second, right? Seeding isn't part of Python initialization, it's
 part of importing the `random` module.

It's easy to import the random module, even for a specific library
function which may never be called by the program being run.

--

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



[issue21469] False positive hazards in robotparser

2014-05-11 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
stage:  - test needed
title: Hazards in robots.txt parser - False positive hazards in robotparser

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



[issue21221] Minor struct_time documentation bug

2014-05-11 Thread Rose Ames

Rose Ames added the comment:

Thanks for the quick feedback!  Altered to A value of -1...

--
nosy: +superluser
Added file: http://bugs.python.org/file35219/tm_isdst2.patch

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



[issue21306] PEP 466: backport hmac.compare_digest

2014-05-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b40f1a00b134 by Benjamin Peterson in branch '2.7':
backport hmac.compare_digest to partially implement PEP 466 (closes #21306)
http://hg.python.org/cpython/rev/b40f1a00b134

--
nosy: +python-dev
resolution:  - fixed
stage: needs patch - resolved
status: open - closed

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



[issue21465] sqlite3 Row can return duplicate keys when using adapters

2014-05-11 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +ghaering

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



[issue20826] Faster implementation to collapse consecutive ip-networks

2014-05-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

From a quick look, the algorithm is indeed correct, and it should perform 
better on average than the previous one.

Note: both algorithms are O(n**2) worst case, not O(n).

--
nosy: +pitrou

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



[issue21473] Idle: test startup scripts.

2014-05-11 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Add test_idle/test_startup to test that Idle starts without obvious error with 
any of idlelib/idle.(bat, py, pyw). Test should presumably use subprocess. Look 
at test.support.interactive_python for either direct use or as a model. It in 
turn uses test.script_helper.spawn_python and .kill_python. Also look at 
test_cmd_line_script.py for models. A simple sanity check would be 
requires('gui') test as it should bring (and exit) an actually idle window.

Beyond testing startup with no options, there are multiple options and 
combinations of options. Some of this could be automated easier if option 
decoding were separated from acting on the options. If necessary, some things 
could be added as a non-automated human test.

--
messages: 218306
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Idle: test startup scripts.
type: enhancement
versions: Python 3.4, Python 3.5

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



[issue21474] Idle: updata fixwordbreaks() for unicode identifiers

2014-05-11 Thread Terry J. Reedy

New submission from Terry J. Reedy:

EditorWindow.py has this function, applied to editor and shell windows, which 
is obsolete for Python3 and unicode identifiers.

def fixwordbreaks(root):
# Make sure that Tk's double-click and next/previous word
# operations use our definition of a word (i.e. an identifier)
tk = root.tk
tk.call('tcl_wordBreakAfter', 'a b', 0) # make sure word.tcl is loaded
tk.call('set', 'tcl_wordchars', '[a-zA-Z0-9_]')
tk.call('set', 'tcl_nonwordchars', '[^a-zA-Z0-9_]')

Double clicking selects a contiguous sequence of 'word' or 
'nonword' characters.
Control-backspace deletes word left, Control-DEL deletes word right.
Control-left/right Arrow moves by words in a strange but useful way.

It might be more useful if the REs were expanded.

--
messages: 218307
nosy: serhiy.storchaka, terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: Idle: updata fixwordbreaks() for unicode identifiers
type: enhancement
versions: Python 3.4, Python 3.5

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



[issue21475] Support the Sitemap and Crawl-delay extensions in robotparser

2014-05-11 Thread Raymond Hettinger

New submission from Raymond Hettinger:

Resources:

* http://en.wikipedia.org/wiki/Robots_exclusion_standard#Nonstandard_extensions

* https://support.google.com/webmasters/answer/183669?hl=en

* https://github.com/seomoz/reppy

--
components: Library (Lib)
keywords: easy
messages: 218308
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Support the Sitemap and Crawl-delay extensions in robotparser
type: enhancement
versions: Python 3.5

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



[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-11 Thread Łukasz Kucharski

New submission from Łukasz Kucharski:

The behaviour of the method for both classes seem to be a little different. 
Executing `Parser.parse(fp)` does not close the file pointer passed while 
Executing `BytesParser.parse` does.

I think this caused by fact that `BytesParser.parse` implementation is using 
`with` statement. Writing this

fp = TextIOWrapper(file_pointer, encoding='ascii', errors='surrogateescape')
with fp:
  return self.parser.parse(fp, headersonly)
file_pointer.seek(0)

The original `file_pointer` gets closed and the call to `seek` fails. 

I am not sure whether such behaviour is intended, and whether, the `with` 
behaves badly, or the `TextIOWrapper`, or the `BytesParser`, thus I am unable 
to suggest or provide a patch. But I think the behaviour should be consistent 
and/or documented.

I attached a file that depicts the issue. The problem originated from SO:
http://stackoverflow.com/questions/23599457/how-to-parse-an-email-in-python-without-closing-the-file
I think it's a minor issue, but it did cause a code to fail with no apparent 
reason.

--
components: email
files: mail_test.py
messages: 218309
nosy: barry, r.david.murray, Łukasz.Kucharski
priority: normal
severity: normal
status: open
title: Inconsitent behaviour between BytesParser.parse and Parser.parse
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file35220/mail_test.py

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



[issue18104] Idle: make human-mediated GUI tests usable

2014-05-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 460203eaf731 by Terry Jan Reedy in branch '2.7':
Issue #18104: Add idlelib/idle_test/htest.py with a few sample tests to begin
http://hg.python.org/cpython/rev/460203eaf731

New changeset 617656f7b538 by Terry Jan Reedy in branch '3.4':
Issue #18104: Add idlelib/idle_test/htest.py with a few sample tests to begin
http://hg.python.org/cpython/rev/617656f7b538

--
nosy: +python-dev

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



[issue18104] Idle: make human-mediated GUI tests usable

2014-05-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset aea4f427902f by Terry Jan Reedy in branch '3.4':
Issue #18104: News for 3.4 (which will not merge forward).
http://hg.python.org/cpython/rev/aea4f427902f

New changeset b7bc43e96041 by Terry Jan Reedy in branch 'default':
#18104: null merge of 3.4 News entry
http://hg.python.org/cpython/rev/b7bc43e96041

New changeset 7cdb38fa191e by Terry Jan Reedy in branch 'default':
Issue #18104: News for 3.4, in proper place.
http://hg.python.org/cpython/rev/7cdb38fa191e

--

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



[issue21477] Idle: improve idle_test,htest

2014-05-11 Thread Terry J. Reedy

New submission from Terry J. Reedy:

#18104 created idle_test/htest.py. Besides adding more tests in other issues, 
some possible improvements to htest itself follow. Many depend on not reusing 
run, as it now it, in the runall loop. What is left in common to both might be 
factored out.

* For runall, reuse the same master box so the user does not have to click away 
each master box to see another (which also appears in a different position). 
Instead, rewrite the message and if still used, the button.

* Make sure tested widgets do not cover the master box. For 
configSectionNameDialog, an htest parameter was added to the class to change 
the usual positioning (which was intentionally centered over the parent).

* For most tests, eliminate the button and simply display the widget. The 
button is needed for testing message boxes when one wants to test different 
entries (the section name dialog). 'button=True' could be added to the spec 
where needed.

* If there is no button to restart a test, then closing the widget should, if 
possible, close the master. The editor window does this, but that would have to 
be changed if runall ran in one root.

* The pre-existing editor window test hides (withdraws) the master (root) 
window. This is not necessary and should be changed.

--
messages: 218312
nosy: sahutd, terry.reedy
priority: normal
severity: normal
status: open
title: Idle: improve idle_test,htest

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



[issue21477] Idle: improve idle_test,htest

2014-05-11 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
assignee:  - terry.reedy
stage:  - needs patch
type:  - enhancement
versions: +Python 2.7, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file35221/21477-htest.txt

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



[issue18104] Idle: make human-mediated GUI tests usable

2014-05-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The revised patch, as pushed, will serve as a base for this portion of 
Saimadhav's GSOC project. #21477 proposes changes to htest itself. Adding tests 
from other modules will be dependencies of that issue.

--
resolution:  - fixed
stage: patch review - resolved
status: open - closed
Added file: http://bugs.python.org/file35222/htest5.diff

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



[issue21383] make touch fails when the build directory is not the source directory

2014-05-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bc160f985b7b by Ned Deily in branch '3.4':
Issue #21383: Allow make touch to work when building outside of the
http://hg.python.org/cpython/rev/bc160f985b7b

New changeset 9493fdad2a75 by Ned Deily in branch 'default':
Issue 21383: merge from 3.4
http://hg.python.org/cpython/rev/9493fdad2a75

--
nosy: +python-dev

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



[issue21383] make touch fails when the build directory is not the source directory

2014-05-11 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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