[issue27260] Missing equality check for super objects

2016-06-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't think this should be done. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue24567] random.choice IndexError due to double-rounding

2016-06-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: Will get to it shortly. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27242] Make the docs for NotImplemented & NotImplementedError unambiguous

2016-06-08 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- title: Make the docs for NotImplemented & NotImplementedError unambigous -> Make the docs for NotImplemented & NotImplementedError unambiguous ___ Python tracker _

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread STINNER Victor
STINNER Victor added the comment: I spent almost my whole day to read this issue, some related issues, and some more related links. WOW! Amazing discussing. Sorry that Christian decided to quit the discussion (twice) :-( Here is my summary: http://haypo-notes.readthedocs.io/pep_random.html tl

[issue26446] Mention in the devguide that core dev stuff falls under the PSF CoC

2016-06-08 Thread Brett Cannon
Brett Cannon added the comment: Thanks for the patch, Evelyn! The latest one LGTM and I will commit it when I have time. I do still plan to add a subsection at the bottom of the index page mentioning the CoC so it's in a very visible location. -- _

[issue27136] sock_connect fails for bluetooth (and probably others)

2016-06-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 149fbdbe4729 by Yury Selivanov in branch '3.5': Issue #27136: Update asyncio docs https://hg.python.org/cpython/rev/149fbdbe4729 New changeset 44767f603535 by Yury Selivanov in branch 'default': Merge 3.5 (asyncio, issue #27136) https://hg.python.or

[issue27136] sock_connect fails for bluetooth (and probably others)

2016-06-08 Thread Yury Selivanov
Yury Selivanov added the comment: Will be fixed in CPython 3.5.2. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ _

[issue27136] sock_connect fails for bluetooth (and probably others)

2016-06-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3f49e89be8a9 by Yury Selivanov in branch '3.5': Issue #27136: Fix DNS static resolution; don't use it in getaddrinfo https://hg.python.org/cpython/rev/3f49e89be8a9 New changeset e46b23b6a068 by Yury Selivanov in branch 'default': Merge 3.5 (issue #2

[issue27266] Always use getrandom() in os.random() on Linux and add block=False parameter to os.urandom()

2016-06-08 Thread STINNER Victor
Changes by STINNER Victor : -- title: Always use getrandom() in os.random() and add block=False parameter to os.urandom() -> Always use getrandom() in os.random() on Linux and add block=False parameter to os.urandom() ___ Python tracker

[issue27266] Always use getrandom() in os.random() and add block=False parameter to os.urandom()

2016-06-08 Thread STINNER Victor
STINNER Victor added the comment: I changed the title to make my intent more explicit: the goal is to make os.urandom() more secure on Linux by always using getrandom(). But always using getrandom() in os.urandom() requires a non-blocking os.urandom() to start Python: see #25420 (import random

[issue27266] Add block keyword-only optional parameter to os.urandom()

2016-06-08 Thread STINNER Victor
STINNER Victor added the comment: Ah, there is maybe a solution for BSD? msg267810: "it looks like we can use sysctl to fetch the seed state from kern.random.sys.seeded" -- ___ Python tracker

[issue27127] Never have GET_ITER not followed by FOR_ITER

2016-06-08 Thread Demur Rumed
Changes by Demur Rumed : -- resolution: -> rejected status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue27050] Demote run() below the high level APIs in subprocess docs

2016-06-08 Thread Akira Li
Akira Li added the comment: > setting "universal_newlines=True" switches to UTF-8 encoded text pipes It uses locale.getpreferredencoding(False) encoding -- something like cp1252,cp1251,etc on Windows, and UTF-8 on *nix with proper locale settings. It is ASCII (C/POSIX locale default) if the lo

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-08 Thread Yury Selivanov
Yury Selivanov added the comment: Nick, Please see the updated patch. Do you think it's ready to be merged? I want buildbots to have some time with it before RC. -- Added file: http://bugs.python.org/file43307/fix_aiter3.patch ___ Python tracker

[issue27268] Incorrect error message on float('')

2016-06-08 Thread Eryk Sun
Eryk Sun added the comment: > The message comes from Objects/floatobject.c:183 No, in this case the error is set in PyOS_string_to_double in Python/pystrtod.c, because `fail_pos == s`, and it doesn't get replaced in PyFloat_FromString because `end == last`. The format string in PyOS_string_to

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Colm Buckley
Colm Buckley added the comment: Just to re-state; I think we have three problems: 1) _Py_HashSecret initialization blocking. Affects all Python invocations; already a substantial issue on Debian testing track (90s startup delay). * there seems to be general agreement that this does not need a

[issue7063] Memory errors in array.array

2016-06-08 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag stage: needs patch -> patch review versions: +Python 3.6 -Python 3.3, Python 3.4 ___ Python tracker ___

[issue27269] ipaddress: Wrong behavior with ::ffff:1.2.3.4 style IPs

2016-06-08 Thread SilentGhost
Changes by SilentGhost : -- nosy: +pmoody versions: -Python 3.3, Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue27265] Hash of different, specific Decimals created from str is the same

2016-06-08 Thread Mark Dickinson
Changes by Mark Dickinson : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue27265] Hash of different, specific Decimals created from str is the same

2016-06-08 Thread Mark Dickinson
Mark Dickinson added the comment: For what it's worth, here are timings on my machine showing the overhead of the extra equality check when a hash collision occurs. Python 2.7.11 (default, Mar 1 2016, 18:08:21) Type "copyright", "credits" or "license" for more information. IPython 4.2.0 -- A

[issue27269] ipaddress: Wrong behavior with ::ffff:1.2.3.4 style IPs

2016-06-08 Thread ThiefMaster
New submission from ThiefMaster: I'd expect the IPv4 address to be considered part of that network (or actually parsed as an IPv4Address and not IPv6Address) even if it's written in IPv6 notation. It's an IPv4 after all. Python 3.5.1 (default, Jun 7 2016, 09:20:44) [GCC 4.9.3] on linux Type "

[issue27254] heap overflow in Tkinter module

2016-06-08 Thread Emin Ghuliev
Emin Ghuliev added the comment: psuedocode <+16>: movsxd rdx,DWORD PTR [rbx+0x8] <+20>: leaeax,[rdx+rbp*1] newSize = length ($rdx) + dsPtr->length ($rbp) gdb > print /x $rbp $5 = 0xf gdb > print /x $rdx $6 = 0x10 newsize = 0xf+0x10 = 0x1f cmpeax,DWORD PTR [rbx+

[issue27187] Relax __all__ location requirement in PEP 8

2016-06-08 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Thanks Ian. I'm going to apply that, but rephrase it a bit. -- ___ Python tracker ___ ___ Python-b

[issue27268] Incorrect error message on float('')

2016-06-08 Thread Adam Bartoš
New submission from Adam Bartoš: >>> float('foo') ValueError: could not convert string to float: 'foo' >>> float('') ValueError: could not convert string to float: should be ValueError: could not convert string to float: '' The message comes from Objects/floatobject.c:183 but I don't understan

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread STINNER Victor
STINNER Victor added the comment: >> The current behavior is that Python *will not start at all* if getrandom() >> blocks (because the hash secret initialization fails). > It starts jsut fine, it just can possible takes awhile. In my experience, connecting to a VM using SSH with low entropy can

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Colm Buckley
Colm Buckley added the comment: Victor - Yes, it is possible for it to block forever - see the test I proposed for Ted upthread. The triggering case (systemd-crontab-generator) delays for 90 seconds, but is *killed* by systemd after that time; it doesn't itself time out. Colm -- ___

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Theodore Tso
Theodore Tso added the comment: Oh --- and about people wondering whether os.random is being used for cryptographic purposes or not "most of the time" or not --- again, welcome to my world. I get complaints all the time from people who try to do "dd if=/dev/urandom of=/dev/hdX bs=4k" and then

[issue27257] get_addresses results in traceback with a valid? header

2016-06-08 Thread Stephen J. Turnbull
Stephen J. Turnbull added the comment: OK, I can reproduce now. $ python3.5 Python 3.5.0 (v3.5.0:374f501f4567, Sep 17 2015, 17:04:56) [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import email >>> wi

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Theodore Tso
Theodore Tso added the comment: One of the reasons why trying to deal with randomness is hard is because a lot of it is about trust. Did Intel backdoor RDRAND to help out the NSA? You might have one answer if you work for the NSA, and perhaps if you are willing to assume the worst about the

[issue27242] Make the docs for NotImplemented & NotImplementedError unambigous

2016-06-08 Thread Martin Panter
Martin Panter added the comment: I think the box about NotImplementedError needs indenting too. See the box for for a better example. -- ___ Python tracker

[issue24617] os.makedirs()'s [mode] not correct

2016-06-08 Thread Tommy Beadle
Tommy Beadle added the comment: I think that the documentation should be updated to reflect issue19930's change when that is actually committed, not as a part of this change. -- ___ Python tracker

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread STINNER Victor
STINNER Victor added the comment: Cory Benfield (msg267637): "if the purpose of this patch was to prevent long startup delays, *it failed*. On all the systems above os.urandom may continue to block system startup." I don't pretend fixing the issue on all operating systems. As stated in the is

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread STINNER Victor
STINNER Victor added the comment: Donald: "Cory wasn't speaking about (non)blocking in general, but the case where (apparently) it's desired to not block even if that means you don't get cryptographically secure random in the CPython interpreter start up. (...)" Oh sorry, I misunderstood his m

[issue23275] Can assign [] = (), but not () = []

2016-06-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 39a72018dd76 by Martin Panter in branch '3.5': Issue #23275: Backport target list assignment documentation fixes https://hg.python.org/cpython/rev/39a72018dd76 New changeset 8700f4d09b28 by Martin Panter in branch '2.7': Issue #23275: Backport empty

[issue24617] os.makedirs()'s [mode] not correct

2016-06-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue19930. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailin

[issue27261] io.BytesIO.truncate does not work as advertised

2016-06-08 Thread Justus Winter
Justus Winter added the comment: FWIW, I consider the documented behavior a feature. My use case is to allocate a BytesIO object with a given size, obtain a view to its buffer, and write to it from a c library. -- ___ Python tracker

[issue8491] Need readline command and keybinding information

2016-06-08 Thread Evelyn Mitchell
Evelyn Mitchell added the comment: Revised patch following Martin Panter's review comments. -- nosy: +Evelyn Mitchell Added file: http://bugs.python.org/file43306/patch8491a ___ Python tracker __

[issue27257] get_addresses results in traceback with a valid? header

2016-06-08 Thread Stephen J. Turnbull
Stephen J. Turnbull added the comment: In Python 3.5, both entering the problematic header by hand with a trivial body and using email.message_from_string to parse it, and calling email.message_from_file on lkml-exception.mail, produce an email.message.Message with no defects and no traceback.

[issue24617] os.makedirs()'s [mode] not correct

2016-06-08 Thread Tommy Beadle
Changes by Tommy Beadle : Added file: http://bugs.python.org/file43305/0001-Issue-24617-Add-comment-for-os.makedirs-about-certai.patch ___ Python tracker ___ ___

[issue27242] Make the docs for NotImplemented & NotImplementedError unambigous

2016-06-08 Thread Emanuel Barry
Emanuel Barry added the comment: Martin: yes, I plan to install Sphinx soon enough, so that I can build the docs. As for the notes part, I indented it exactly like it was indented for other existing notes boxes in the same file. I'll change that if needed though. -- __

[issue27265] Hash of different, specific Decimals created from str is the same

2016-06-08 Thread Mark Dickinson
Changes by Mark Dickinson : -- resolution: -> wont fix status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-08 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue21313] Py_GetVersion() is broken when using mqueue and a long patch name

2016-06-08 Thread Martin Panter
Martin Panter added the comment: Closing now that platform._sys_version() can tolerate the truncated version info. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue26985] Information about CodeType in inspect documentation is outdated

2016-06-08 Thread Berker Peksag
Berker Peksag added the comment: I prefer to not duplicate the list in Lib/inspect.py. We did similar docstring cleanups in several modules (venv for example) recently. -- nosy: +berker.peksag stage: -> patch review type: -> behavior versions: +Python 3.5

[issue27265] Hash of different, specific Decimals created from str is the same

2016-06-08 Thread Mark Dickinson
Mark Dickinson added the comment: There's nothing wrong with two different Decimal objects having the same hash (indeed, it's inevitable, given that there are fewer than 2**64 hash values available, and many more possible Decimal objects). It only becomes a problem if you have a largish natura

[issue21593] Clarify re.search documentation first match

2016-06-08 Thread Berker Peksag
Berker Peksag added the comment: > This should also be applied to regex.search's docstring. Done. -- nosy: +berker.peksag resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue21593] Clarify re.search documentation first match

2016-06-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 48bb48e7499d by Berker Peksag in branch '3.5': Issue #21593: Clarify that re.search() returns the first match https://hg.python.org/cpython/rev/48bb48e7499d New changeset 243b95782059 by Berker Peksag in branch 'default': Issue #21593: Merge from 3.

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Christian Heimes
Changes by Christian Heimes : -- nosy: -christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Christian Heimes
Christian Heimes added the comment: I'm unsubscribing from this ticket for the second time. This form of discussion is becoming toxic for me because I strongly beliefe that it is not the correct way to handle a security-related problem. -- ___ Pytho

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Even though it may sound like a minor problem that os.urandom() blocks on startup, I think the problem is getting more and more something to consider given how systems are used nowadays. Today, we no longer have the case where you keep a system up and runnin

[issue27264] python 3.4 vs. 3.5 strftime same locale different output on Windows

2016-06-08 Thread Eryk Sun
Eryk Sun added the comment: The universal CRT that's used by 3.5+ implements locales using Windows locale names [1], which were introduced in Vista. Examples for Spanish include 'es', 'es-ES', and 'es-ES_tradnl' . The latter is the traditional sort for Spain, which has the 3-letter abbreviatio

[issue26437] asyncio create_server() not always accepts the 'port' parameter as str

2016-06-08 Thread Berker Peksag
Berker Peksag added the comment: After changeset 3ec208c01418 this is no longer an issue: >>> from asyncio import * >>> loop = get_event_loop() >>> coro = loop.create_server(Protocol(), '', '12345') >>> loop.run_until_complete(coro) >> coro = loop.create_server(Protocol(), '127.0.0.1', '12345')

[issue12962] TitledHelpFormatter and IndentedHelpFormatter are not documented

2016-06-08 Thread Berker Peksag
Berker Peksag added the comment: optparse has been deprecated for years and I don't see any reason to document them now. Closing as rejected. -- assignee: -> docs@python components: +Documentation -Library (Lib) nosy: +berker.peksag, docs@python resolution: -> rejected stage: -> reso

[issue20842] pkgutil docs should reference glossary terms not PEP 302

2016-06-08 Thread Berker Peksag
Changes by Berker Peksag : -- keywords: +easy versions: +Python 3.6 -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Donald Stufft
Donald Stufft added the comment: Larry, I would greatly prefer it if we would allow os.urandom to block on Linux, at least by default. This will make os.urandom behavior similarly on most modern platforms. The cases where this is going to matter are extreme edge cases, for most users they'll

[issue22942] Language Reference - optional comma

2016-06-08 Thread Martin Panter
Martin Panter added the comment: Bug 1 is still present in 3.5. In 3.6 it is no longer relevant because the documentation was changed for Issue 9232 (allowing trailing commas in function definitions). Bug 2 is present in 2.7, but is not relevant to 3.5+. Trailing commas are now allowed in fun

[issue27266] Add block keyword-only optional parameter to os.urandom()

2016-06-08 Thread Donald Stufft
Donald Stufft added the comment: I'm pretty sure that getentropy on OpenBSD will block until the pool is initialized. -- nosy: +dstufft ___ Python tracker ___ __

[issue27266] Add block keyword-only optional parameter to os.urandom()

2016-06-08 Thread STINNER Victor
STINNER Victor added the comment: > Is there a way to read from /dev/urandom without blocking? If not, > _PyOS_URandom() may use arc4random() on FreeBSD if block is false. I suggest > to enhance _PyOS_URandom() after the Python 3.5.2 release. See the issue #22542 "Use arc4random under OpenBSD

[issue27267] memory leak in _ssl.c, function load_cert_chain

2016-06-08 Thread SilentGhost
Changes by SilentGhost : -- nosy: +alex, christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou ___ Python tracker ___ ___ Pytho

[issue21313] Py_GetVersion() is broken when using mqueue and a long patch name

2016-06-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset b86e259271b3 by Martin Panter in branch '2.7': Issue #21313: Tolerate truncated buildinfo in sys.version https://hg.python.org/cpython/rev/b86e259271b3 New changeset 4deec876db0d by Martin Panter in branch '3.5': Issue #21313: Tolerate truncated bui

[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1dc495007b8f by Martin Panter in branch '3.5': Issue #25738: Don’t send message body for 205 Reset Content https://hg.python.org/cpython/rev/1dc495007b8f New changeset b1041ddb1391 by Martin Panter in branch '2.7': Issue #25738: Don’t send message b

[issue24136] document PEP 448: unpacking generalization

2016-06-08 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: -pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Christian Heimes
Christian Heimes added the comment: On 2016-06-08 11:39, STINNER Victor wrote: > > STINNER Victor added the comment: > > no-urandom-by-default.diff uses a very weak source of entropy for > random.Random :-( I'm fighting against weak sources of entropy since many > years... It is totally fine

[issue24136] document PEP 448: unpacking generalization

2016-06-08 Thread Martin Panter
Martin Panter added the comment: Thanks for helping with this Jelle. The documentation of unpacking sequences vs iterables was adjusted in 3.6 as part of Issue 23275. I guess part of revision 8a0754fed986 should be extracted to 3.5 as well. Looking at the function call syntax, positional and

[issue27266] Add block keyword-only optional parameter to os.urandom()

2016-06-08 Thread STINNER Victor
STINNER Victor added the comment: This issue is the opposite of the issue #27250 "Add os.urandom_block()". -- ___ Python tracker ___ _

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread STINNER Victor
STINNER Victor added the comment: Larry Hastings: > > Hi. I created the issue #27266 "Add block keyword-only optional parameter > > to os.urandom()" (...) > > Happy? > Probably not. (...) I replied on the issue #27266. Sorry I'm unable to follow this issue, there are too many messages now :-

[issue27266] Add block keyword-only optional parameter to os.urandom()

2016-06-08 Thread STINNER Victor
STINNER Victor added the comment: Larry Hastings (msg267818, on the issue #26839): > What is the default value of the "block" parameter? False > If called with block=False on FreeBSD, where /dev/urandom may block > sometimes, what does the function do? The function blocks. In which case Free

[issue27266] Add block keyword-only optional parameter to os.urandom()

2016-06-08 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +larry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue27267] memory leak in _ssl.c, function load_cert_chain

2016-06-08 Thread Ralph Haist
New submission from Ralph Haist: Test program: $ cat sslTest.py import ssl ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ctx.load_cert_chain("mycert.pem") $ valgrind reports a memory leak if this test program is executed by python2.7 as follows: ==7266== 24 bytes in 1 blocks are definitely lost i

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread STINNER Victor
STINNER Victor added the comment: no-urandom-by-default.diff uses a very weak source of entropy for random.Random :-( I'm fighting against weak sources of entropy since many years... This change introduces the bug similar to OpenSSL RAND_bytes() bug (two processes with the same pid can produce

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Larry Hastings
Larry Hastings added the comment: > Hi. I created the issue #27266 "Add block keyword-only optional parameter > to os.urandom()" which is compromise between all proposed solutions and > should fix *all* urandom issues ;-) > > * os.urandom() remains secure by default, as asked by our security exp

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Cory Benfield
Cory Benfield added the comment: > You're right, it's remotely possible that on platforms where /dev/urandom > could block, Python startup could therefore also block. And I'm not > proposing we fix that, as so far nobody has reported it as a problem. > > This suggests to me that yes I'm talking

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Larry Hastings
Larry Hastings added the comment: You're right, it's remotely possible that on platforms where /dev/urandom could block, Python startup could therefore also block. And I'm not proposing we fix that, as so far nobody has reported it as a problem. This suggests to me that yes I'm talking specif

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread STINNER Victor
STINNER Victor added the comment: Hi. I created the issue #27266 "Add block keyword-only optional parameter to os.urandom()" which is compromise between all proposed solutions and should fix *all* urandom issues ;-) * os.urandom() remains secure by default, as asked by our security experts * P

[issue27266] Add block keyword-only optional parameter to os.urandom()

2016-06-08 Thread STINNER Victor
New submission from STINNER Victor: Follow-up of the issue #26839: I propose to add a "block" keyword-only optional parameter to os.urandom(). I chose to make the parameter a keyword-only to avoid suprises and backward incompatible change and because I want to make this change in Python 3.5.2.

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Cory Benfield
Cory Benfield added the comment: > What I'm trying to avoid here is the surprising situation where someone is > using Python on a system where /dev/urandom will never block, and > os.urandom() blocks. At this point I literally do not understand what issue we're trying to solve then. If the p

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Larry Hastings
Larry Hastings added the comment: I don't know if anyone literally still uses BSD. But on FreeBSD, /dev/urandom can block. So let me revise my statement slightly. Developers on platform X know how *their* /dev/urandom behaves. They should rightly expect that os.urandom() is a thin wrapper

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Colm Buckley
Colm Buckley added the comment: [[ Larry - thanks for the Mercurial pointers. I was starting from the Debian sources because I initially assumed this was a Debian problem. Will switch to hg in future. ]] -- ___ Python tracker

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Christian Heimes
Christian Heimes added the comment: Larry, /dev/urandom blocks on BSD when it hasn't been seeded yet. But it looks like we can use sysctl to fetch the seed state from kern.random.sys.seeded. https://www.freebsd.org/cgi/man.cgi?query=random&sektion=4 The software generator will start in a

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread STINNER Victor
STINNER Victor added the comment: To see how long it takes to initialize urandom pool, you can grep your kernel logs. On my physical PC with real hardware, interruptions etc. it's quite fast: 5 seconds. -- Logs begin at mar. 2016-01-26 07:54:37 CET, ... ... juin 06 18:34:47 smithers kernel: ra

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Christian Heimes
Christian Heimes added the comment: Cory, thanks for summing it up for us. I totally agree with you. In my opinion it is troublesome to have different behavior on platforms. We can implement a workaround for Linux, but not for BSD. Or would O_NONBLOCK cause read() to fail with EWOULDBLOCK on /

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Larry Hastings
Larry Hastings added the comment: So, in short, you don't know. #25003 is about Solaris, and the reporter clearly had the expectation that /dev/urandom would never block. The documentation on Linux is clear: /dev/urandom will never block. That's two. This "StackExchange" discussion: http

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Cory Benfield
Cory Benfield added the comment: I have never seen it block in person, but I also wouldn't expect to. OS X's blocking guarantees are the same as FreeBSD's: that is, both /dev/random and /dev/urandom block until sufficient entropy has been gathered at startup and then never block again. This m

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Larry Hastings
Larry Hastings added the comment: Are you certain that /dev/urandom will block on Mac OS X if sufficient entropy is not available? The dismissive tone ("this choice and distinction is not necessary") suggests that *their* implementation is superior, and it could hardly be seen as superior if

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Cory Benfield
Cory Benfield added the comment: > If you read #25003, it's clear that /dev/urandom is a well-known UNIX > facility with well-known, predictable behavior. One behavior that I'll draw > particular attention to now: it will never block. If the system is low on > entropy, /dev/urandom will prod

[issue27265] Hash of different, specific Decimals created from str is the same

2016-06-08 Thread Radosław Szalski
New submission from Radosław Szalski: Python 2.7.11 (default, May 9 2016, 19:53:39) [GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from decimal import Decimal >>> hash(Decimal('0.05')) == hash(Decimal(

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-08 Thread Larry Hastings
Larry Hastings added the comment: I've revised my thinking on the subject. First, my previous statements stand: Python startup must not block. "import random" must not block. Now I'm thinking that "os.urandom()" must not block, too. Here's my reasoning. -- If you read #25003, it's clear th

[issue27262] IDLE: move Aqua context menu code to maxosx

2016-06-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think you can just use bindtags(). button = Button(...) bindtags = button.bindtags() button.bindtags(bindtags[:1] + ['MyButton'] + bindtags[1:]) root.bind_class('MyButton', ...) -- ___ Python tracker

[issue27254] heap overflow in Tkinter module

2016-06-08 Thread Emin Ghuliev
Emin Ghuliev added the comment: the appropriate size should be chosen I) -- ___ Python tracker ___ ___ Python-bugs-list mailing list U

<    1   2