[issue27277] Fatal Python error: Segmentation fault in test_exceptions

2016-06-09 Thread Rohit Mediratta
New submission from Rohit Mediratta: Fresh clone and running test_exceptions testcase caught a Seg fault. This was being run on a Centos VM. [/loc/rom/pyd/cpython] $ ./python Python 3.6.0a1+ (default:12d939477b4f, Jun 7 2016, 17:32:31) [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux Type "hel

[issue27272] random.Random should not read 2500 bytes from urandom

2016-06-09 Thread Christian Heimes
Christian Heimes added the comment: Tim, you are saying that some methods (e.g. randint) of the MT don't fail security properties as bad as other. I'm sorry, that argument is not good enough for me. The seed() method of the MT is causing real-world problems, e.g. #25420 where 'import random'

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

2016-06-09 Thread Martin Panter
Martin Panter added the comment: I dislike the “block” term for a different reason: it suggests raising EAGAIN (= BlockingIOError). But the proposal here is actually to generate data with low entropy. In the long term, it sounds like two separate functions is the way to go. I would prefer os.

[issue27278] py_getrandom() uses an int for syscall() result

2016-06-09 Thread STINNER Victor
New submission from STINNER Victor: syscall() result type is long. Moreover, long type might can smaller than the size type, so we may need to add: n = Py_MIN(size, LONG_MAX); -- messages: 267969 nosy: haypo priority: normal severity: normal status: open title: py_getrandom() uses an i

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

2016-06-09 Thread Christian Heimes
Christian Heimes added the comment: Can we please stop using the term "low entropy" here. It is wrong and makes my head hurt. "Running out of entropy" is an urban myth. It's about the initialization state of Kernel's internal RNG. The Kernel blocks the syscall as long as it is not confident en

[issue27279] Add random.cryptorandom() and random.pseudorandom, deprecate os.urandom()

2016-06-09 Thread Marc-Andre Lemburg
New submission from Marc-Andre Lemburg: I propose to deprecate os.urandom() altogether due to all the issues we've discussed on all those recent tickets, see e.g. #26839, #27250, #25420. Unlike what we've told people for many years, it's clear that in the age of VMs/containers getting booted/st

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

2016-06-09 Thread Larry Hastings
Larry Hastings added the comment: > I wonder what we should do on Linux if /dev/urandom is unavailable and > getrandom() would block. I don't think that happens. getrandom() actually supports two flags. The flag GRND_RANDOM tells it "behave like /dev/random". If you don't pass in GRND_RANDO

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

2016-06-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I propose to deprecate os.urandom() altogether due to all the issues we've discussed on all those recent tickets. See #27279 for details. On 09.06.2016 02:04, Nick Coghlan wrote: > I'd also *STRONGLY* request that we avoid adding any new APIs in relation to

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

2016-06-09 Thread STINNER Victor
STINNER Victor added the comment: I played with select() on Linux on a VM: * /dev/random: it works as expected * /dev/urandom: the device is already seen as readable even before the urandom entropy pool is initialized. It is not really surprising since, yes, read() does not block in practice

[issue27250] Add os.urandom_block()

2016-06-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Please also see #27279 for an alternative plan. -- ___ Python tracker ___ ___ Python-bugs-list m

[issue27279] Add random.cryptorandom() and random.pseudorandom, deprecate os.urandom()

2016-06-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Fleshing out the API signatures and implementation details will have to be done in a PEP. The topic is (as all the related ticket show) too complex for discussions on a bug tracker. I just opened this ticket for reference to the idea. -- __

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

2016-06-09 Thread STINNER Victor
STINNER Victor added the comment: > I dislike the “block” term for a different reason: it suggests raising EAGAIN > (= BlockingIOError). But the proposal here is actually to generate data with > low entropy. Since os.urandom() is part of the os module, yes, I'm suggesting to raise BlockingIOE

[issue27279] Add random.cryptorandom() and random.pseudorandom, deprecate os.urandom()

2016-06-09 Thread Christian Heimes
Christian Heimes added the comment: -1 os.urandom() is just fine. Let's not confuse users and make it even harder to write secure software. -- nosy: +christian.heimes ___ Python tracker __

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

2016-06-09 Thread Cory Benfield
Changes by Cory Benfield : -- nosy: +Lukasa ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue27279] Add random.cryptorandom() and random.pseudorandom, deprecate os.urandom()

2016-06-09 Thread Larry Hastings
Larry Hastings added the comment: I +1 on new functions that are designated the best-practice places to get your pseudo-random numbers. (IDK if the best place for both is in random; maybe the crypto one should be in secrets?) To be precise: on most OSes what you're calling "crypto random data

[issue27274] [ctypes] Allow from_pointer creation

2016-06-09 Thread SilentGhost
Changes by SilentGhost : -- nosy: +amaury.forgeotdarc, belopolsky, meador.inge versions: +Python 3.6 ___ Python tracker ___ ___ Python

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

2016-06-09 Thread STINNER Victor
STINNER Victor added the comment: Martin: > I wonder what we should do on Linux if /dev/urandom is unavailable and > getrandom() would block. os.urandom(block=False) should raise BlockingIOError if getrandom(GRND_NONBLOCK) fails with EAGAIN and /dev/urandom is not available. Larry: > I don't

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

2016-06-09 Thread Christian Heimes
Christian Heimes added the comment: I'm -1 on a block=True/False parameter. It makes the API more awkward and will make people move away from os.urandom() to a self-made RNG because they perceive os.urandom() as potential blocking. Victor, you can use sysctl on all BSD and Linux to check if th

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

2016-06-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 09.06.2016 09:57, STINNER Victor wrote: > > STINNER Victor added the comment: > > I played with select() on Linux on a VM: > > * /dev/random: it works as expected > * /dev/urandom: the device is already seen as readable even before the > urandom entrop

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

2016-06-09 Thread Larry Hastings
Larry Hastings added the comment: Fair enough. But Theodore Ts'o said on the tracker: if you call getrandom() and don't pass in GRND_RANDOM, it's equivalent to /dev/urandom. So, if getrandom is available, getrandom(flags=0) will always work and never block. -- __

[issue27279] Add random.cryptorandom() and random.pseudorandom, deprecate os.urandom()

2016-06-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Some resources: * getrandom() man page: http://man7.org/linux/man-pages/man2/getrandom.2.html * nice readup on how getrandom() was introduced: https://lwn.net/Articles/606141/ * random devices implementation on Linux: http://lxr.free-electrons.

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2016-06-09 Thread William Pitcock
William Pitcock added the comment: A frequent reproducer is to run the expiringdict tests on Python 3.5.1, unfortunately I cannot come up with a testcase. Replacing use of popitem() with "del self[next(OrderedDict.__iter__(self))]" removes the KeyErrors and the structure otherwise works fine.

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

2016-06-09 Thread Cory Benfield
Cory Benfield added the comment: > But Theodore Ts'o said on the tracker: if you call getrandom() and don't pass > in GRND_RANDOM, it's equivalent to /dev/urandom. So, if getrandom is > available, getrandom(flags=0) will always work and never block. Can we please try to be clear about what ki

[issue27278] py_getrandom() uses an int for syscall() result

2016-06-09 Thread Martin Panter
Martin Panter added the comment: According to , getrandom() returns no more than 32 MiB as an int on Linux. Doesn’t that mean you can rely on syscall()’s long return value fitting in an int? Maybe just cast n = (int)sycall(...) to be expli

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

2016-06-09 Thread STINNER Victor
STINNER Victor added the comment: Marc-Andre Lemburg: > I propose to deprecate os.urandom() altogether due to all the issues we've > discussed on all those recent tickets. I'm sorry, but I don't understand the purpose of this change. Usually, when we deprecate something, it is in favor of a ne

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

2016-06-09 Thread STINNER Victor
STINNER Victor added the comment: If you didn't read it yet, I suggest you to read my summary of the issue #26839 which contains a lot of information on RNG in the case of Python: http://haypo-notes.readthedocs.io/pep_random.html It can be used to write a real PEP. --

[issue27278] py_getrandom() uses an int for syscall() result

2016-06-09 Thread Martin Panter
Martin Panter added the comment: Make that INT_MAX. Or change n from an int to a Py_ssize_t. Both Linux and Solaris versions or getrandom() are documented as accepting size_t buflen. -- ___ Python tracker

[issue27181] Add geometric mean to `statistics` module

2016-06-09 Thread Mark Dickinson
Mark Dickinson added the comment: Choice of algorithm is a bit tricky here. There are a couple of obvious algorithms that work mathematically but result in significant accuracy loss in an IEEE 754 floating-point implementation: one is `exp(mean(map(log, my_numbers)))`, where the log calls can

[issue27279] Add random.cryptorandom() and random.pseudorandom, deprecate os.urandom()

2016-06-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 09.06.2016 10:07, Larry Hastings wrote: > > I +1 on new functions that are designated the best-practice places to get > your pseudo-random numbers. > > (IDK if the best place for both is in random; maybe the crypto one should be > in secrets?) All up

[issue27274] [ctypes] Allow from_pointer creation

2016-06-09 Thread Eryk Sun
Eryk Sun added the comment: Probably adding from_pointer is a good idea. That said, there's a simpler way to go about getting a bytes copy for a pointer. Say that you have a pointer p for the following array: >>> a = (c_float * 3)(1, 2, 3) >>> bytes(a) b'\x00\x00\x80?\x00\x00\x00@\

[issue16132] ctypes incorrectly encodes .format attribute of memory views

2016-06-09 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

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

2016-06-09 Thread Larry Hastings
Larry Hastings added the comment: > Can we please try to be clear about what kind of blocking we mean? > getrandom(flags=0) absolutely *can* block: that's what the original issue was > all about. To ensure it *never* blocks you need to call > getrandom(GRND_NONBLOCK): that's why the flag exist

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

2016-06-09 Thread STINNER Victor
STINNER Victor added the comment: I also tested to call os.urandom() "early" in the Windows boot process in a Windows VM. Using a startup entry in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run registry key, os.urandom() works immediatly (it is able to produce 16 bytes of

[issue27279] Add random.cryptorandom() and random.pseudorandom, deprecate os.urandom()

2016-06-09 Thread Christian Heimes
Christian Heimes added the comment: On 2016-06-09 10:30, Marc-Andre Lemburg wrote: > > Marc-Andre Lemburg added the comment: > > On 09.06.2016 10:07, Larry Hastings wrote: >> >> I +1 on new functions that are designated the best-practice places to get >> your pseudo-random numbers. >> >> (IDK

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

2016-06-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 09.06.2016 10:16, STINNER Victor wrote: > > STINNER Victor added the comment: > > Marc-Andre Lemburg: >> I propose to deprecate os.urandom() altogether due to all the issues we've >> discussed on all those recent tickets. > > I'm sorry, but I don't und

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

2016-06-09 Thread Christian Heimes
Christian Heimes added the comment: On 2016-06-09 10:49, Marc-Andre Lemburg wrote: > It is a corner case, but one we'll see hit us more often going > forward, since booting up VMs/containers no longer is a rather > rare incident. It's being used as part of the architecture of > system nowadays.

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

2016-06-09 Thread STINNER Victor
STINNER Victor added the comment: > "early" is not correct: it's late in fact, only when the desktop is opened. I > should use GPEDIT.MSC to start a task before the desktop, but this command > doesn't seem to be available on my Windows 8? Oh, I found how to start a task before the user login,

[issue27280] Paste fail in ipaddress documentation

2016-06-09 Thread Arthur Carcano
New submission from Arthur Carcano: There is a type in the `IPv6Network' constructor doc, fixed in attached patch. -- assignee: docs@python components: Documentation files: patch_doc_ipaddress.patch keywords: patch messages: 267999 nosy: NougatRillettes, docs@python priority: normal seve

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

2016-06-09 Thread Larry Hastings
Larry Hastings added the comment: > Oh, I found how to start a task before the user login, and os.urandom() still > works: it produces 16 bytes immediatly (in 0.0 second). Just to confirm: that's a fresh Windows VM, never been booted before ever? If it had ever been booted before, it might be

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

2016-06-09 Thread STINNER Victor
STINNER Victor added the comment: Christian Heimes added the comment: > I'm -1 on a block=True/False parameter. It makes the API more awkward and > will make people move away from os.urandom() to a self-made RNG because they > perceive os.urandom() as potential blocking. Are you against the fe

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

2016-06-09 Thread Larry Hastings
Larry Hastings added the comment: > In my tests, reading from /dev/urandom never blocks even before urandom is > initialized. That's correct, and is the big difference between getrandom(0) and reading from /dev/urandom. If "the entropy pool has not been initialized" (terminology from the man

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

2016-06-09 Thread Cory Benfield
Cory Benfield added the comment: > Those say that if you call getrandom(GRND_NONBLOCK) before the entropy > pool has been initialized, it will return EAGAIN, but any time you read > from /dev/urandom you will always get random data. Yeah, so this is why the crypto folks were all up in arms abou

[issue27279] Add random.cryptorandom() and random.pseudorandom, deprecate os.urandom()

2016-06-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Some more resources for FreeBSD: * /dev/random and /dev/urandom (symlink to /dev/random) ma page: https://www.freebsd.org/cgi/man.cgi?query=random&sektion=4 * Developer discussion about /dev/random and its future from 2013: https://wiki.freebsd.org/

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

2016-06-09 Thread STINNER Victor
STINNER Victor added the comment: Christian Heimes: > For os.urandom() let's define it as non-blocking and raise an exception > when it would blocks. There is a lot of discussion around random in the bug tracker, it's really hard to follow :-( Please use specific issues for each idea. Making os.

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

2016-06-09 Thread STINNER Victor
STINNER Victor added the comment: > Not that it needs saying again, but I'm still in favour of doing something > like what Christian is suggesting, or like I suggested earlier (have > os.urandom remain good, have Python internally fall back to weaker seeds for > random and SipHash if it's run

[issue27181] Add geometric mean to `statistics` module

2016-06-09 Thread Mark Dickinson
Mark Dickinson added the comment: On the other hand, apparently `exp(mean(log(...)))` is good enough for SciPy: its current implementation looks like this: def gmean(a, axis=0): a, axis = _chk_asarray(a, axis) log_a = ma.log(a) return ma.exp(log_a.mean(axis=axis)) -- _

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

2016-06-09 Thread Cory Benfield
Cory Benfield added the comment: > It looks like people don't read what I'm writing :-( I'm reading you, Victor, but you and I aren't disagreeing, so I'm not trying to convince you. =) I'm trying to convince Larry. -- ___ Python tracker

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

2016-06-09 Thread STINNER Victor
STINNER Victor added the comment: Larry Hastings: > Just to confirm: that's a fresh Windows VM, never been booted before ever? > If it had ever been booted before, it might be saving its entropy pools to > the hard disk at shutdown. The VM was booted before. I don't see how I could schedule a

[issue27279] Add random.cryptorandom() and random.pseudorandom, deprecate os.urandom()

2016-06-09 Thread Larry Hastings
Larry Hastings added the comment: > * FreeBSD will likely switch to the new Fortuna successor of Yarrow in an > upcoming release: A little more information about that. FreeBSD did a major refactoring of their /dev/urandom (etc) support, which landed in October 2014: https://svnweb.freebsd.o

[issue26826] Expose new copy_file_range() syscall in os module.

2016-06-09 Thread Marcos Dione
Marcos Dione added the comment: Fixed the last comments, including comparing what was written to the original data, but only to the length of what was actually written. I'm just not sure if the way to handle the syscall not existing is ok. -- Added file: http://bugs.python.org/file4331

[issue27272] random.Random should not read 2500 bytes from urandom

2016-06-09 Thread Christian Heimes
Christian Heimes added the comment: New plan: * Add a new uint64 _Py_HashSecret.random_seed * On 'import random' seed random.Random() from _Py_HashSecret.random_seed + gettimeofday().tv_sec + gettimeofday().tv_usec + id(self). That way subinterpreters get a different init state. On systems wi

[issue27280] Paste fail in ipaddress documentation

2016-06-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +pmoody ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue27277] Fatal Python error: Segmentation fault in test_exceptions

2016-06-09 Thread SilentGhost
Changes by SilentGhost : -- components: +Tests ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue27272] random.Random should not read 2500 bytes from urandom

2016-06-09 Thread STINNER Victor
STINNER Victor added the comment: > On 'import random' seed random.Random() from _Py_HashSecret.random_seed + > gettimeofday().tv_sec + gettimeofday().tv_usec + id(self). That way > subinterpreters get a different init state. Can we use os.urandom() was random.Random is instanciated manually,

[issue27279] Add random.cryptorandom() and random.pseudorandom, deprecate os.urandom()

2016-06-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Resources for entropy gathering sources: * Kernel based devices such as /dev/random: https://en.wikipedia.org/wiki//dev/random * EGD - old entropy gathering daemon; blocks when out of entropy http://egd.sourceforge.net/ (not maintained anymore

[issue26826] Expose new copy_file_range() syscall in os module.

2016-06-09 Thread Martin Panter
Martin Panter added the comment: It’s a bit ugly, but I would write the test so that it is recorded as skipped: try: os.copy_file_range(...) except OSError as err: if err.errno != ENOSYS: raise # We get to see the full exception details self.skipTest(err) # Test is recorded

[issue27272] random.Random should not read 2500 bytes from urandom

2016-06-09 Thread Donald Stufft
Donald Stufft added the comment: If seeding from urandom was causing no problems, then I would not care if random.Random() wanted to seed from urandom, even though it doesn't need to. However it is causing problems, and thus it shouldn't. Here's another script, this one runs on Python 3.5.1 th

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

2016-06-09 Thread Donald Stufft
Donald Stufft added the comment: Having os.urandom raise an error instead of blocking is OK with me. It turns an implicit error into an explicit one. However, I prefer to have it block until it has initialized it's entropy pool because that makes Linux behave similarly to all of the other majo

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

2016-06-09 Thread Larry Hastings
Larry Hastings added the comment: I just posted to python-dev and asked Guido to make a BDFL ruling. I only represented my side, both because I worried I'd do a bad job of representing *cough* literally everybody else *cough*, and because it already took me so long to write the email. All of

[issue26826] Expose new copy_file_range() syscall in os module.

2016-06-09 Thread Marcos Dione
Marcos Dione added the comment: ENOSYS catching fixed. -- Added file: http://bugs.python.org/file43319/copy_file_range.diff ___ Python tracker ___ ___

[issue27181] Add geometric mean to `statistics` module

2016-06-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, Jun 09, 2016 at 09:24:04AM +, Mark Dickinson wrote: > On the other hand, apparently `exp(mean(log(...)))` is good enough for SciPy: Hmm, well, I don't have SciPy installed, but I've found that despite their (well-deserved) reputation, numpy (and p

[issue27140] Opcode for creating dict with constant keys

2016-06-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could anyone please make a review? -- keywords: +needs review ___ Python tracker ___ ___ Python-bu

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2016-06-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: patch review -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue23867] Argument Clinic: inline parsing code for 1-argument functions

2016-06-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: patch review -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue26305] Make Argument Clinic to generate PEP 7 conforming code

2016-06-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27181] Add geometric mean to `statistics` module

2016-06-09 Thread Mark Dickinson
Mark Dickinson added the comment: > Hmm, well, I don't have SciPy installed, but I've found that despite > their (well-deserved) reputation, numpy (and presumably scipy) often > have rather naive algorithms that can lose accuracy rather > spectacularly. Agreed. And as Ram Rachum hinted, there

[issue26305] Make Argument Clinic to generate PEP 7 conforming code

2016-06-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset eeb742d8bf9c by Serhiy Storchaka in branch '3.5': Issue #26305: Argument Clinic now escapes braces. No need to double them. https://hg.python.org/cpython/rev/eeb742d8bf9c New changeset d983c313b8f1 by Serhiy Storchaka in branch 'default': Issue #263

[issue26305] Make Argument Clinic to generate PEP 7 conforming code

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

[issue23026] Winreg module doesn't support REG_QWORD, small DWORD doc update

2016-06-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5306f27c53aa by Serhiy Storchaka in branch 'default': Regenerate Argument Clinic code for issue #23026. https://hg.python.org/cpython/rev/5306f27c53aa -- ___ Python tracker

[issue26243] zlib.compress level as keyword argument

2016-06-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The original request was for supporting level as keyword argument. Making the first argument a keyword argument was unintentional side effect (due a to the limitation of argument parsing functions). Now it is possible to support positional-only and keyword a

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

2016-06-09 Thread Eryk Sun
Changes by Eryk Sun : -- resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs

[issue18027] distutils should access stat_result timestamps via .st_*time attributes

2016-06-09 Thread Berker Peksag
Berker Peksag added the comment: This is a duplicate of issue 13420. -- nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> newer() function in dep_util.py discard changes in the same second ___ P

[issue13420] newer() function in dep_util.py discard changes in the same second

2016-06-09 Thread Jakub Wilk
Changes by Jakub Wilk : -- nosy: +jwilk ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org

[issue27270] 'parentheses-equality' warnings when building with clang and ccache

2016-06-09 Thread STINNER Victor
STINNER Victor added the comment: clang_ccache.patch LGTM. -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue27281] unpickling an xmlrpc.client.Fault raises TypeError

2016-06-09 Thread Uri Okrent
New submission from Uri Okrent: Attempting to unpickle an xmlrpc.client.Fault will raise a TypeError: >>> import xmlrpc.client as xmlrpclib >>> f = xmlrpclib.Fault(42, 'Test Fault') >>> import pickle >>> s = pickle.dumps(f) >>> pickle.loads(s) Traceback (most recent call last): File "", line 1

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

2016-06-09 Thread Radosław Szalski
Radosław Szalski added the comment: Thanks for the reply and analysis, Mark. My motivation was that as a "clueless user", I shouldn't worry about how Decimals are created. Given two equal numbers, I would expect their behavior (e.g., result of a hash) to be the same as well. In this example, t

[issue26985] Information about CodeType in inspect documentation is outdated

2016-06-09 Thread Xiang Zhang
Xiang Zhang added the comment: So maybe remove the docstring entirely? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue27271] asyncio lost udp packets

2016-06-09 Thread valdemar pavesi
valdemar pavesi added the comment: thanks Guido and Yury I am new on python world. I was working with automation tests, sw implemented in Delphi in 199x. this year I got a python certification from University Texas Arlington University by EDX. and I already wrote 4 projects in python3 ,handl

[issue27274] [ctypes] Allow from_pointer creation

2016-06-09 Thread Memeplex
Memeplex added the comment: Thank you for the great tips, Eryk, somehow I overlooked string_at while reading the docs. Now, given that the address parameter of string_at is pretty overloaded, wouldn't it be reasonable to overload from_address the same instead of introducing from_pointer? That

[issue26985] Information about CodeType in inspect documentation is outdated

2016-06-09 Thread Berker Peksag
Berker Peksag added the comment: "Return true if the object is a code object." should stay. We can add a short sentence to refer people to the inspect documentation for the list of co_* attributes. -- ___ Python tracker

[issue27274] [ctypes] Allow from_pointer creation

2016-06-09 Thread Memeplex
Memeplex added the comment: > The first argument can be any type accepted by c_void_p.from_param, such as a > ctypes pointer/array, str, bytes, or an integer address. Now I see why you suggested ptr.as_void in 26565. Both issues are very related. Some functions are overloaded in the sense they

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-09 Thread Nick Coghlan
Nick Coghlan added the comment: +1 from me - my only comments were on the docs updates and one of the explanatory comments in the code. -- ___ Python tracker ___ ___

[issue27281] unpickling an xmlrpc.client.Fault raises TypeError

2016-06-09 Thread SilentGhost
Changes by SilentGhost : -- nosy: +loewis stage: -> patch review versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker ___ __

[issue27272] random.Random should not read 2500 bytes from urandom

2016-06-09 Thread Tim Peters
Tim Peters added the comment: Donald, your script appears to recreate the state from some hundreds of consecutive outputs of getrandbits(64). Well, sure - but what of it? That just requires inverting the MT's tempering permutation. You may as well note that the state can be recreated from t

[issue27271] asyncio lost udp packets

2016-06-09 Thread Guido van Rossum
Guido van Rossum added the comment: You're welcome Valdemar. It's a wonderful world, there's so much to learn! Sounds like you're on the right path. Good luck! -- ___ Python tracker

[issue27279] Add random.cryptorandom() and random.pseudorandom, deprecate os.urandom()

2016-06-09 Thread Nick Coghlan
Nick Coghlan added the comment: As with other proposals to add new APIs, I think this is an overreaction to a Linux specific problem. Linux system boot could deadlock with 3.5.0 and 3.5.1 due to: - CPython startup using os.urandom() when it wasn't necessary - systemd invoking a Python script b

[issue27281] unpickling an xmlrpc.client.Fault raises TypeError

2016-06-09 Thread Berker Peksag
Berker Peksag added the comment: Looks good to me, thanks. -- nosy: +berker.peksag ___ Python tracker ___ ___ Python-bugs-list mailing

[issue27272] random.Random should not read 2500 bytes from urandom

2016-06-09 Thread Donald Stufft
Donald Stufft added the comment: > But that's not what real-life programs expose. Are you sure? Searching github pulls up a number of results of people calling it, but I haven't looked through them to see how/why they're calling it. > What do you believe? For example, do you believe it would

[issue27282] Raise BlockingIOError in os.urandom if kernel is not ready

2016-06-09 Thread Nick Coghlan
New submission from Nick Coghlan: This proposal competes directly with #27250, #27266, and #27279 as possible long term solutions to the Linux/systemd os.urandom deadlock bug described in #26839 Rather than adding new APIs, or making os.urandom potentially blocking on Linux (as it was in 3.5.

[issue27282] Raise BlockingIOError in os.urandom if kernel is not ready

2016-06-09 Thread Donald Stufft
Donald Stufft added the comment: This proposal is reasonable to me and solves any problems I have with the default behavior of os.urandom. -- nosy: +dstufft ___ Python tracker _

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

2016-06-09 Thread Nick Coghlan
Nick Coghlan added the comment: Since Victor requested it, I filed #27282 to track the "raise BlockingIOError if the kernel would block" design option. The key advantage that particular model offers is that it's trivial to build a blocking version as a busy loop around the non-blocking version

[issue27282] Raise BlockingIOError in os.urandom if kernel is not ready

2016-06-09 Thread Nick Coghlan
Nick Coghlan added the comment: Quoting http://bugs.python.org/issue27266#msg268043: The key advantage the BlockingIOError model offers is that it's trivial to build a blocking version as a busy loop around the non-blocking version: def urandom_wait_for_entropy(num_bytes): while Tr

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

2016-06-09 Thread Mark Dickinson
Mark Dickinson added the comment: > the behavior differs simply based on whether the Decimal was created from a > string vs a float That's not quite right: a Decimal object keeps no knowledge of how it was created. The behaviour differs depending on whether the value of the Decimal happens to

[issue27281] unpickling an xmlrpc.client.Fault raises TypeError

2016-06-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue27272] random.Random should not read 2500 bytes from urandom

2016-06-09 Thread Tim Peters
Tim Peters added the comment: > Searching github pulls up a number of results of people > calling it, but I haven't looked through them to see > how/why they're calling it. Sorry, I don't know what "it" refers to. Surely not to a program exposing the output of .getstate()?! Regardless, there

[issue27272] random.Random should not read 2500 bytes from urandom

2016-06-09 Thread Donald Stufft
Donald Stufft added the comment: > Sorry, I don't know what "it" refers to. Surely not to a program exposing > the output of .getstate()?! random.getrandbits() -- ___ Python tracker _

[issue27281] unpickling an xmlrpc.client.Fault raises TypeError

2016-06-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why you need to pickle Fault? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue27281] unpickling an xmlrpc.client.Fault raises TypeError

2016-06-09 Thread Uri Okrent
Uri Okrent added the comment: I'm not pickling/unpickling it directly, I'm using multiprocessing to handle queries to my server in worker processes which is using pickle to propagate exceptions raised in the worker to the parent. I could instead raise a different exception and wrap it in a Fau

[issue27272] random.Random should not read 2500 bytes from urandom

2016-06-09 Thread Tim Peters
Tim Peters added the comment: Ah! Yes, .getrandbits(N) outputs remain vulnerable to equation-solving in Python 3, for any value of N. I haven't seen any code where that matters (may be "a security hole"), but would bet some _could_ be found. There's no claim of absolute security here. To th

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

2016-06-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that Decimal(0.05) != Decimal('0.05'). >>> Decimal(0.05) Decimal('0.05000277555756156289135105907917022705078125') >>> hash(Decimal(0.05)) 966367654 >>> hash(Decimal('0.05000277555756156289135105907917022705078125')) 966367654 >>>

  1   2   >