[issue28494] is_zipfile false positives

2019-01-30 Thread Matthew Ryan


Change by Matthew Ryan :


--
nosy: +mryan1539

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



[issue26735] os.urandom(2500) fails on Solaris 11.3

2016-04-12 Thread Matthew Ryan

Matthew Ryan added the comment:

Yes, I've verified that:
* the issue existed in the default branch as of this morning.
* the patch applies cleanly against both 3.5 and default, and
addresses the issue in both branches.

--

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



[issue26735] os.urandom(2500) fails on Solaris 11.3

2016-04-12 Thread Matthew Ryan

Matthew Ryan added the comment:

The new patch looks fine; I used __sun__ rather than sun out of habit
(C standard requires
system specific macros be in the reserved namespace), but either will work.

I found the original problem through debugging with GDB, so I know
getrandom() was being
called, and the test case I provided (taken from Lib/Random.py) fails
without the patch,
and succeeds with it.

Oddly, the blog post you linked to describes getrandom as:
"Recent Linux kernels have a getrandom(2) system call that reads
between 1 and 1024 bytes of randomness"

But no such limit current exists in the Linux version that I can see;
however, the Solaris
version definitely does have that limit:
https://docs.oracle.com/cd/E53394_01/html/E54765/getrandom-2.html

On Tue, Apr 12, 2016 at 1:15 AM, STINNER Victor <rep...@bugs.python.org> wrote:
>
> STINNER Victor added the comment:
>
>> I've attached a possible patch for this issue, against the 3.5.1 source
> tree.
>
> I guess that you are already using Python 3.5.1 which uses getrandom(). You 
> should try to confirm using strace.
>
> I updated your patch. I replaced "#if defined(__sun__)" with "#ifdef sun", 
> since "#ifdef sun" looks more common in the Python code base, and I never saw 
> "#if defined(__sun__)" in the Python code base.
>
> I also avoided the new len variable, I reused the n variable.
>
> I don't have Solaris, so I cannot test. I didn't find getrandom() manual page 
> neither, I only found this blog post which doesn't mention the 1024 bytes 
> limitation on Solaris:
> https://blogs.oracle.com/darren/entry/solaris_new_system_calls_getentropy
>
> --
> Added file: http://bugs.python.org/file42443/urandom_solaris.patch
>
> ___
> Python tracker <rep...@bugs.python.org>
> <http://bugs.python.org/issue26735>
> ___

--

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



[issue26735] os.urandom(2500) fails on Solaris 11.3

2016-04-11 Thread Matthew Ryan

New submission from Matthew Ryan:

On Solaris 11.3 (intel tested, but I assume issue is on SPARC as well),
I found the following fails:
  import os
  os.urandom(2500)

The above throws OSError: [Errno 22] Invalid argument.

It turns out that the Solaris version of getrandom() is limited to returning
no more than 1024 bytes, per the manpage:
  The getrandom() and getentropy() functions fail if:

  EINVALThe flags are not set to GRND_RANDOM, GRND_NONBLOCK or  both,
or bufsz is <= 0 or > 1024.

I've attached a possible patch for this issue, against the 3.5.1 source
tree.

--
files: python3-getrandom.patch
keywords: patch
messages: 263191
nosy: mryan1539
priority: normal
severity: normal
status: open
title: os.urandom(2500) fails on Solaris 11.3
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file42433/python3-getrandom.patch

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