[issue26672] regrtest missing in the module name

2016-04-26 Thread Berker Peksag

Berker Peksag added the comment:

Good catch, thanks for the report!

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type: enhancement -> behavior

___
Python tracker 

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



[issue26672] regrtest missing in the module name

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2ef61a4747eb by Berker Peksag in branch '2.7':
Issue #26672: Fix regrtest example in test.rst
https://hg.python.org/cpython/rev/2ef61a4747eb

--
nosy: +python-dev

___
Python tracker 

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



[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2016-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, I forget. Needed updates of the documentation (including the 
"versionchanged" directive). And would be nice if you add corresponding 
entities in Doc/whatsnew/3.6.rst, Misc/NEWS and Misc/ACKS. The rest of the 
patch LGTM.

--

___
Python tracker 

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



[issue26868] Incorrect check for return value of PyModule_AddObject in _csv.c

2016-04-26 Thread Berker Peksag

New submission from Berker Peksag:

This is probably harmless, but Modules/_csv.c has the following code:

Py_INCREF(_Type);
if (PyModule_AddObject(module, "Dialect", (PyObject *)_Type))
return NULL;

However, PyModule_AddObject returns only -1 and 0. It also doesn't decref 
Dialect_Type if it returns -1 so I guess more correct code should be:

Py_INCREF(_Type);
if (PyModule_AddObject(module, "Dialect", (PyObject *)_Type) == -1) 
{
Py_DECREF(_Type);
return NULL;
}

The same pattern can be found in a few more modules.

--
components: Extension Modules
files: csv.diff
keywords: patch
messages: 264350
nosy: berker.peksag
priority: low
severity: normal
stage: patch review
status: open
title: Incorrect check for return value of PyModule_AddObject in _csv.c
type: behavior
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file42623/csv.diff

___
Python tracker 

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



[issue19317] ctypes.util.find_library should examine binary's RPATH on Solaris

2016-04-26 Thread Richard PALO

Richard PALO added the comment:

There *is* a feature with linking called $ORIGIN.

--

___
Python tracker 

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



[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Xiang Zhang

Xiang Zhang added the comment:

Yes, you are right. I don't notice that. I will try to fix it.

--

___
Python tracker 

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-26 Thread Luiz Poleto

Luiz Poleto added the comment:

As for urlparse_empty_bad_arg_disallow.patch, I didn't go too deep into testing 
it but I found that calling urlparse with different non-str args are producing 
different results:

urlparse({})
TypeError: unhashable type: 'slice'

urlparse([])
AttributeError: 'list' object has no attribute 'decode'

urlparse(())
AttributeError: 'tuple' object has no attribute 'decode'

I thought they should all raise a TypeError but again, I am not sure it is 
working as expected by the patch's author.

--

___
Python tracker 

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-26 Thread Martin Panter

Martin Panter added the comment:

Regarding urlparse(b'', ''). Currently the second parameter is “scheme”, which 
is documented as being an empty text string by default. If we deprecate this, 
we should update the documentation.

--

___
Python tracker 

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



[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Martin Panter

Martin Panter added the comment:

I think this patch looks okay. It fixes the case insensitivity problem, but 
there is also the string suffix problem (see the myexample.com demo). I think 
it is reasonable for example.com to match my.example.com, but not myexample.com.

--
stage:  -> patch review
versions:  -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-26 Thread Luiz Poleto

Luiz Poleto added the comment:

I am seeing some results when running urlparse with patch 
urlparse_empty_bad_arg_deprecation2.patch applied:

>>> urllib.parse.urlparse({})
__main__:1: DeprecationWarning: Use of {} is deprecated
__main__:1: DeprecationWarning: Use of '' is deprecated
ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', 
fragment=b'')

>>> urllib.parse.urlparse('', b'')
__main__:1: DeprecationWarning: Use of b'' is deprecated
/home/poleto/SCMws/python/latest/cpython/Lib/urllib/parse.py:378: 
DeprecationWarning: Use of b'' is deprecated
  splitresult = urlsplit(url, scheme, allow_fragments)
ParseResult(scheme=b'', netloc='', path='', params='', query='', fragment='')
Will bytes be deprecated if used as a default_schema?

>>> urllib.parse.urlparse(b'', '')
ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', 
fragment=b'')
Shouldn't it complain that the types are different? In fact it does, if you 
don't provide empty strings:

>>> urllib.parse.urlparse(b'www.python.org', 'http')
Traceback (most recent call last):
  File "", line 1, in 
  File "(...)/cpython/Lib/urllib/parse.py", line 377, in urlparse
url, scheme, _coerce_result = _coerce_args(url, scheme)
  File "(...)/cpython/Lib/urllib/parse.py", line 120, in _coerce_args
raise TypeError("Cannot mix str and non-str arguments")
TypeError: Cannot mix str and non-str arguments

>>> urllib.parse.urlparse({'a' : 1})
__main__:1: DeprecationWarning: Use of '' is deprecated
Traceback (most recent call last):
  File "", line 1, in 
  File "(...)/cpython/Lib/urllib/parse.py", line 377, in urlparse
url, scheme, _coerce_result = _coerce_args(url, scheme)
  File "(...)/cpython/Lib/urllib/parse.py", line 128, in _coerce_args
return _decode_args(args) + (_encode_result,)
  File "(...)/cpython/Lib/urllib/parse.py", line 98, in _decode_args
return tuple(x.decode(encoding, errors) if x else '' for x in args)
  File "(...)/cpython/Lib/urllib/parse.py", line 98, in 
return tuple(x.decode(encoding, errors) if x else '' for x in args)
AttributeError: 'dict' object has no attribute 'decode'

>>> urllib.parse.urlparse(['a', 'b', 'c'])
__main__:1: DeprecationWarning: Use of [] is deprecated
Traceback (most recent call last):
  File "", line 1, in 
  File "(...)/cpython/Lib/urllib/parse.py", line 377, in urlparse
url, scheme, _coerce_result = _coerce_args(url, scheme)
  File "(...)/cpython/Lib/urllib/parse.py", line 128, in _coerce_args
return _decode_args(args) + (_encode_result,)
  File "(...)/cpython/Lib/urllib/parse.py", line 98, in _decode_args
return tuple(x.decode(encoding, errors) if x else '' for x in args)
  File "(...)/cpython/Lib/urllib/parse.py", line 98, in 
return tuple(x.decode(encoding, errors) if x else '' for x in args)
AttributeError: 'list' object has no attribute 'decode'

I thought about writing test cases but I wasn't a 100% sure if the above is 
working as expected so I thought I should ask first.

--

___
Python tracker 

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



[issue24933] socket.recv(size, MSG_TRUNC) returns more than size bytes

2016-04-26 Thread Martin Panter

Martin Panter added the comment:

As far as I know, passing MSG_TRUNC into recv() is Linux-specific. I guess the 
“right” portable way to get a message size is to know it in advance, or guess 
and expand the buffer if MSG_PEEK cannot return the whole message.

Andrey: I don’t think we are accessing _unallocated_ memory (which could crash 
Python). If you look at _PyBytes_Resize(), I think it correctly allocates the 
memory, and just leaves it uninitialized.

Some options:

* Document that arbitrary flags like Linux’s MSG_TRUNC not supported
* Limit the returned buffer to the original buffer size
* Raise an exception or warning if recv() returns more than the original buffer 
size
* Reject unsupported flags like MSG_TRUNC
* Initialize the expanded buffer with zeros

--
components: +Extension Modules -Library (Lib)
nosy: +martin.panter

___
Python tracker 

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



[issue26867] test_ssl test_options fails on ubuntu 16.04

2016-04-26 Thread Xiang Zhang

New submission from Xiang Zhang:

test_options in test_ssl fails on Ubuntu 16.04. I don't know this is due to the 
newest ubuntu or a recent code change. But I checkout revision 9 and then 
rebuild and test, test_option still fails.

The traceback is:

FAIL: test_options (test.test_ssl.ContextTests)
--
Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/test/test_ssl.py", line 847, in test_options
self.assertEqual(0, ctx.options)
AssertionError: 0 != 33554432

--
components: +Library (Lib)
nosy: +alex, christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou
type:  -> behavior

___
Python tracker 

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



[issue26867] test_ssl test_options fails on ubuntu 16.04

2016-04-26 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: test_ssl test_options fails on ubuntu 16.04

___
Python tracker 

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



[issue26866] Inconsistent environment in Windows using "Open With"

2016-04-26 Thread Tom Middleton

Tom Middleton added the comment:

That is interesting, in my use #3 seems to work. I am not certain if it matters 
whether the default application is already selected as python.exe or not.
FWIW I'm on Windows 7 64 bit using 2.7.11 release install.

**Full Disclosure** I did muck in the registry to get command line arguments to 
work correctly.(adding the %* to python.exe commands ala #7936) though that 
shouldn't have any affect on this issue.

--

___
Python tracker 

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



[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Xiang Zhang

Xiang Zhang added the comment:

The code has changed recently. I update the patch to reveal the change.

--
Added file: http://bugs.python.org/file42622/issue26864_v2.patch

___
Python tracker 

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



[issue24147] Dialect class defaults are not documented.

2016-04-26 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Xiang Zhang

Xiang Zhang added the comment:

I write a patch to fix this.

It seems on Windows and MacOS the behaviour is right. On MacOS it leaves the 
matching to fnmatch. On Windows it uses case insensitive regular matching.

--
keywords: +patch
Added file: http://bugs.python.org/file42621/issue26864.patch

___
Python tracker 

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



[issue26859] unittest fails with "Start directory is not importable"

2016-04-26 Thread Martin Panter

Martin Panter added the comment:

Is this the same bug as Issue 26481? I.e. is it the unittest dicovery mode that 
is affected? Maybe close the other bug as a duplicate, since Xavier has 
provided a patch here.

--
components: +Tests
nosy: +martin.panter
stage:  -> patch review

___
Python tracker 

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



[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-04-26 Thread Berker Peksag

Berker Peksag added the comment:

The idea sounds good to me.

--
nosy: +berker.peksag
stage:  -> needs patch
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-26 Thread Martin Panter

Martin Panter added the comment:

Yes, the RST documentation has to be done by hand. It usually has more detail 
than the doc strings.

I didn’t see any changes to the configure script in your patches. Did you make 
that change to define HAVE_COPY_FILE_RANGE yet?

In /Modules/posixmodule.c (all three of your patches have an indented diff 
header, so the review doesn’t pick it up):

+#ifdef HAVE_COPY_FILE_RANGE
+/* The name says posix but currently it's Linux only */

What name are you referring to? The file posixmodule? I think the file name is 
a bit misleading; according to the comment at the top, it is also used on 
Windows.

+return (!async_err) ? posix_error() : NULL;

This would make more sense with the logic swapped around: async_err? NULL : 
posix_error()

Regarding copyfileobj(), I think we should continue to support file objects 
that do not directly wrap FileIO (includes your Unicode transcoding case). See 
the points given in Issue 25063. Perhaps we could keep the new version as a 
high-level copy_file_range() wrapper, but retain brute_force_copy() under the 
original copyfileobj() name. A bit like the socket.sendfile() method vs 
os.sendfile().

--

___
Python tracker 

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



[issue24933] socket.recv(size, MSG_TRUNC) returns more than size bytes

2016-04-26 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
stage:  -> needs patch
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue26536] Add the SIO_LOOPBACK_FAST_PATH option to socket.ioctl

2016-04-26 Thread Berker Peksag

Changes by Berker Peksag :


--
components: +Windows

___
Python tracker 

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



[issue26536] Add the SIO_LOOPBACK_FAST_PATH option to socket.ioctl

2016-04-26 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for pinging, Daniel. I'm not a Windows user so I can't test the patch, 
but I left some review comments on Rietveld: 
http://bugs.python.org/review/26536/

--
components: +Extension Modules -IO, Windows
nosy: +berker.peksag

___
Python tracker 

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



[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2016-04-26 Thread Joseph Hackman

Joseph Hackman added the comment:

Uploading a new patch to address the issues in previous patch.

--
Added file: http://bugs.python.org/file42620/issue25788-2.patch

___
Python tracker 

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



[issue26866] Inconsistent environment in Windows using "Open With"

2016-04-26 Thread Steve Dower

Steve Dower added the comment:

I don't think there's actually a way to fix this - the current working 
directory is inherited from the current process in the "Open with" case (FWIW, 
#3 also produces the same result as #1).

I suspect it would need a fix in Windows, which is highly unlikely, or 
potentially a fix in the launcher to change the current working directory? The 
latter sounds like a bad idea, but I could be wrong.

In any case, won't be fixed for 2.7, only 3.6 and potentially 3.5.

--
versions: +Python 3.5, Python 3.6 -Python 2.7

___
Python tracker 

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



[issue16255] subrocess.Popen needs /bin/sh but Android only has /system/bin/sh

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

It seems that Android is the only known platform that deviates from
/bin/sh. So perhaps we should simply set a variable to either
/bin/sh or /system/bin/sh rather than waiting for #16353 to settle.

--
nosy: +skrah
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue26862] SYS_getdents64 does not need to be defined on android API 21

2016-04-26 Thread Gregory P. Smith

Gregory P. Smith added the comment:

I have no problem just removing the #ifdef as Android API 21 is now old enough 
(Lollipop / 5.0) that anyone building Python 3.6 for use on Android is probably 
fine with it.

If there is a #define that can be used to test the android api level at compile 
time, adding that to the #if is another approach and would keep people who are 
trying to run something on an older version happy.

--

___
Python tracker 

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



[issue26664] find a bug in activate.fish of venv of cpython3.6

2016-04-26 Thread Tin Tvrtković

Tin Tvrtković added the comment:

Also I will add I've been using fish for a long time and have never been 
affected by #26348.

--

___
Python tracker 

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



[issue26853] missing symbols in curses and readline modules on android

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

IOW, on Linux tinfo should work fine in combination with ncursesw.

--

___
Python tracker 

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



[issue26664] find a bug in activate.fish of venv of cpython3.6

2016-04-26 Thread Tin Tvrtković

Changes by Tin Tvrtković :


--
versions: +Python 3.5

___
Python tracker 

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



[issue26664] find a bug in activate.fish of venv of cpython3.6

2016-04-26 Thread Tin Tvrtković

Tin Tvrtković added the comment:

I'm getting this exact issue on Python 3.5 (xenial system installation).

All my existing venvs (from before my upgrade to xenial) work. Here's the diff:


> diff .venv/bin/activate.fish ../wrapt/.venv/bin/activate.fish 
35c35
< set -gx VIRTUAL_ENV "/home/tin/pg/hypothesis/.venv"
---
> set -gx VIRTUAL_ENV "/home/tin/pg/wrapt/.venv"
58,59c58,59
< if test -n "$(.venv) "
< printf "%s%s%s" "$(.venv) " (set_color normal) (_old_fish_prompt)
---
> if test -n "(.venv) "
> printf "%s%s%s" "(.venv) " (set_color normal) (_old_fish_prompt)

The added dollar signs are the issue. Removing them fixes the problem.

For the record:

> fish --version
fish, version 2.2.0

And here's the actual error message, the same as in the png:

> . .venv/bin/activate.fish 
$(...) is not supported. In fish, please use '(.venv)'.
.venv/bin/activate.fish (line 58): if test -n "$(.venv) "
   ^
from sourcing file .venv/bin/activate.fish
called on line 151 of file /usr/share/fish/config.fish

in function “.”
called on standard input

source: Error while reading file “.venv/bin/activate.fish”

--
nosy: +tinchester

___
Python tracker 

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



[issue26853] missing symbols in curses and readline modules on android

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

Do you need libtinfow? It seems that it's not supported in setup.py,
and getting even libtinfo support into some Linux distributions took
quite a while.

--
nosy: +skrah

___
Python tracker 

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



[issue26536] Add the SIO_LOOPBACK_FAST_PATH option to socket.ioctl

2016-04-26 Thread Daniel Stokes

Daniel Stokes added the comment:

The "Lifecycle of a Patch" document recommends pinging an issue after a month 
of no review. I do not see any special ping option, so I am assuming that means 
to post a comment.

To help with code review I tried to keep this change very similar to a previous 
similar change: http://bugs.python.org/issue6971

--

___
Python tracker 

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



[issue19251] bitwise ops for bytes of equal length

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

>> If yes, maybe we should start with a module on PyPI. Is there a volunteer to 
>> try this option?
>
> bitsets – ordered subsets over a predefined domain

This is an array of *bits*, not an array of bytes (or integers).

> bitarray – efficient boolean array implemented as C extension

This one is also an array of *bits*, but I see .frombytes() and
.tobytes() methods.

> bitstring – pure-Python bit string based on bytearray

Array of *bits*. I don't see how to use an array of integers (or a
byte string) with it.

> BitVector – pure-Python bit array based on unsigned short array
> Bitsets – Cython interface to fast bitsets in Sage
> bitfield – Cython positive integer sets
> intbitset – integer bit sets as C extension

I'm too lazy to check these ones.

I didn't check these modules support operations like x^y.

> Is it enough? Ah, and NumPy.

I'm quite sure that NumPy supports operations like x^y ;-) And NumPy
supports a wide choices of arrays.

Victor

--

___
Python tracker 

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



[issue19251] bitwise ops for bytes of equal length

2016-04-26 Thread cowlicks

cowlicks added the comment:

I'll look through the list @serhiy.storchaka posted and make sure this still 
seems sane to me.

--

___
Python tracker 

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



[issue19251] bitwise ops for bytes of equal length

2016-04-26 Thread cowlicks

cowlicks added the comment:

@gvanrossum in this previous comment 
https://bugs.python.org/issue19251?@ok_message=msg%20264184%20created%0Aissue%2019251%20message_count%2C%20messages%20edited%20ok&@template=item#msg257964

I pointed out code from the wild which would be more readable, and posted 
preliminary benchmarks. But there is a typo, I should have written:

def __mix_single_column(self, a):
t = len(a) * bytes([reduce(xor, a)])
a ^= t ^ xtime(a ^ (a[1:] + a[0:1]))


As @gregory.p.smith points out, my claim about security isn't very clear. This 
would be "more secure" for two reasons. Code would be easier to read and 
therefore verify, but this is the same as readability. The other reason, doing 
some binary bitwise op on two bytes objects enforces that the objects be the 
same length, so unexpected bugs in these code samples would be avoided.

bytes(x ^ y for x, y in zip(a, b))

(int.from_bytes(a, 'big') ^ int.from_bytes(b, 'big')).to_bytes(len(a), 'big')

# XOR each byte of the roundKey with the state table
def addRoundKey(state, roundKey):
for i in range(len(state)):
state[i] = state[i] ^ roundKey[i]

--

___
Python tracker 

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



[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-26 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-26 Thread Marcos Dione

Changes by Marcos Dione :


Removed file: http://bugs.python.org/file42617/copy_file_range.diff

___
Python tracker 

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



[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-26 Thread Marcos Dione

Marcos Dione added the comment:

New version. Factoring the old method in a nested function also paves the way 
to implement https://bugs.python.org/issue25156 .

--
Added file: http://bugs.python.org/file42619/copy_file_range.diff

___
Python tracker 

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



[issue26854] missing header on android for the ossaudiodev module

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

Since Android is the only known system with an odd include path, I
prefer the short patch. In general, let's try to keep patches as
short as possible (which Xavier is already doing).

--

___
Python tracker 

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



[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-26 Thread Marcos Dione

Marcos Dione added the comment:

Hmm, I just noticed that it doesn't fallback to normal copy if the arguments 
are not valid (EBADF, EXDEV). Back to the drawing board...

--

___
Python tracker 

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



[issue26853] missing symbols in curses and readline modules on android

2016-04-26 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Things may be different if ncurses is built with --without-termlib or 
--enable-widec is not specified. I wasn't hit by this bug as my ncurses is 
built with --without-termlib.

--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Xiang Zhang

Xiang Zhang added the comment:

Ohh, it's my fault to misunderstand. I think your thinking is reasonable. Curl 
handles the suffix check insensitively.

--
components: +Library (Lib) -Documentation
nosy:  -docs@python
type: enhancement -> behavior

___
Python tracker 

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



[issue26865] Meta-issue: support of the android platform

2016-04-26 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue26855] add platform.android_ver() for android

2016-04-26 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

> Also how can we be sure that the '/system/build.prop' file may be guaranteed 
> to exist on all android devices ?

This path is hard-coded in BioniC [1]. Though I can't find a document/relevant 
source codes to guarantee 'ro.build.version.release' and 'ro.build.version.sdk' 
is always in /system/build.prop

And the format of build.prop is not exactly INI. It supports 'import' clauses. 
See [2] and load_properties() function in [3]

Other options include calling `getprop` via subprocess or using C level 
function __system_property_get(). The first approach should always work. It's 
just somewhat tricky on Android 4.1 [4]. For the second option, a bad news is 
that it's a private API and was just removed from the latest NDK. Chromium has 
a workaround for that [5] and CPython may use similar approaches.

[1] 
https://android.googlesource.com/platform/bionic/+/master/libc/include/sys/_system_properties.h
[2] 
http://forum.xda-developers.com/android/general/explanation-build-prop-values-t3069341
[3] 
https://android.googlesource.com/platform/system/core/+/master/init/property_service.cpp
[4] 
https://github.com/rave-engine/python3-android/pull/10#issuecomment-159151445
[5] 
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-reviews/keQP6L9aVyU

--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue26854] missing header on android for the ossaudiodev module

2016-04-26 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Maybe checking sys/soundcard.h and linux/soundcard.h in configure.ac is better?

[1] 
https://github.com/yan12125/python3-android/blob/cpython-hg/mk/python/soundcard-h-path.patch

--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue26855] add platform.android_ver() for android

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

___
Python tracker 

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



[issue26853] missing symbols in curses and readline modules on android

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

___
Python tracker 

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



[issue26865] Meta-issue: support of the android platform

2016-04-26 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue26849] android does not support versioning in SONAME

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

___
Python tracker 

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



[issue26862] SYS_getdents64 does not need to be defined on android API 21

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

___
Python tracker 

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



[issue26856] android does not have pwd.getpwall()

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

___
Python tracker 

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



[issue26858] setting SO_REUSEPORT fails on android

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

___
Python tracker 

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



[issue26865] toward the support of the android platform

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

___
Python tracker 

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



[issue26865] Meta-issue: support of the android platform

2016-04-26 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue26865] Meta-issue: support of the android platform

2016-04-26 Thread Zachary Ware

Changes by Zachary Ware :


--
dependencies: +SYS_getdents64 does not need to be defined on android API 21, 
add a COMPILEALL_FLAGS Makefile variable, add function to os module for getting 
path to default shell, add platform.android_ver() for android, android 
compilation and link flags, android does not have pwd.getpwall(), android does 
not support versioning in SONAME, android lacks some declarations for the posix 
module, gethostbyname_r() is broken on android, missing header on android for 
the ossaudiodev module, missing symbols in curses and readline modules on 
android, setting SO_REUSEPORT fails on android, unittest fails with "Start 
directory is not importable"
title: toward the support of the android platform -> Meta-issue: support of the 
android platform

___
Python tracker 

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



[issue26020] set_display evaluation order doesn't match documented behaviour

2016-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Please don't forget to fix BUILD_SET_UNPACK to match.

Isn't it already correct?

> Also, please add the following test: "{*{True, 1}}"

Did you meant "{*{True}, *{1}}"?

--

___
Python tracker 

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



[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Daniel Morrison

Daniel Morrison added the comment:

I believe there was a misunderstanding.

While the environment variable name is handled in a case
insensitive way, the contents of the environment variable is not.

Please see some examples below:

>>> os.environ['no_proxy'] = 'example.com'
>>> urllib.request.proxy_bypass('EXAMPLE.com')
0
>>> urllib.request.proxy_bypass('example.com')
1

Also to clarify the meaning of suffix check:

>>> os.environ['no_proxy'] = 'example.com'
>>> urllib.request.proxy_bypass('myexample.com')
1

My apologies for my lack of clarity.

--

___
Python tracker 

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



[issue26020] set_display evaluation order doesn't match documented behaviour

2016-04-26 Thread Neil Girdhar

Neil Girdhar added the comment:

Ah, sorry, I somehow went cross-eyed.  Not sure offhand which test would test 
the BUILD_TUPLE_UNPACK, but I think you're right Serhiy.  Could just add both?

--

___
Python tracker 

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



[issue26866] Inconsistent environment in Windows using "Open With"

2016-04-26 Thread Tom Middleton

New submission from Tom Middleton:

I have found that the execution of python scripts is inconsistent from the 
following methods:
>From Explorer:

1) Right-Click->Open with->python.exe
2) Right-Click->Open (assuming python.exe being the "default" application)
3) Right-Click->Open with->"Choose default program..."->python.exe
4) Double-Click the script
from the command prompt:
4) python 
5) 

Of those listed, #1 opens the script with the CWD as c:\Windows\System32\
The remainder open the script with the CWD (as from os.getcwd()) as the current 
directory of the executed script.

The issue arose when attempting to open a file in the same directory as the 
script. The issue of how to access a file in the same directory as the script 
isn't the point of this issue however it is that it is inconsistent across 
methods that would seem to be identical to the user.

A use case for Open with->python.exe is if say you want your default behavior 
to be open with an IDE.

The following other issues I found may be relevant.

#22121
#25450

Some digging found this registry entry which may be relevant.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.py

--
components: Installation, Windows
messages: 264315
nosy: busfault, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Inconsistent environment in Windows using "Open With"
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue26859] unittest fails with "Start directory is not importable"

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

___
Python tracker 

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



[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Xiang Zhang

Xiang Zhang added the comment:

No, urllib.request does not handle the no_proxy environment in case-sensitive 
way. It first checks if any environment_variable.lower() ends with "_proxy", 
and then checks if there is any environment_variable ends with "_proxy". So it 
works as a case insensitive check, but the lowercase one will override others, 
e.g, no_proxy overrides no_PROXY. But the document is misleading, it should be 
clarified.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python, martin.panter, xiang.zhang

___
Python tracker 

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



[issue26865] toward the support of the android platform

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

This issue lists issues that may have to be fixed in the perspective of a 
future support of the android platform.

build
issue #26849: android does not support versioning in SONAME
issue #26851: android compilation and link flags
issue #26852: add a COMPILEALL_FLAGS Makefile variable

curses, readline
issue #26853: missing symbols in curses and readline modules on android

ossaudiodev
issue #26854: missing header on android for the ossaudiodev module

platform
issue #16353: add function to os module for getting path to default shell
issue #26855: add platform.android_ver() for android

pwd
issue #26856: android does not have pwd.getpwall()

socketmodule
issue #26857: gethostbyname_r() is broken on android

asyncio tests
issue #26858: setting SO_REUSEPORT fails on android

unittest
issue #26859: unittest fails with "Start directory is not importable"

posixmodule
issue #26862: SYS_getdents64 does not need to be defined on android API 21
issue #26863: android lacks some declaration for the posix module

--
components: Cross-Build
messages: 264310
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: toward the support of the android platform
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue26020] set_display evaluation order doesn't match documented behaviour

2016-04-26 Thread Neil Girdhar

Neil Girdhar added the comment:

Please don't forget to fix BUILD_SET_UNPACK to match.

--

___
Python tracker 

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



[issue26020] set_display evaluation order doesn't match documented behaviour

2016-04-26 Thread Neil Girdhar

Neil Girdhar added the comment:

Also, please add the following test: "{*{True, 1}}"

Should be True.

--

___
Python tracker 

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



[issue26020] set_display evaluation order doesn't match documented behaviour

2016-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
components: +Interpreter Core -Documentation
nosy: +serhiy.storchaka
stage: patch review -> commit review
type:  -> behavior

___
Python tracker 

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



[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-26 Thread Marcos Dione

Marcos Dione added the comment:

Ok, I have a preliminary version of the patch. It has several parts:

* Adding the functionality to the os module, with docstring.
* Make shutil.copyfileobj() to use it if available.
* Modify the docs (this has to be done by hand, right?).
* Modify NEWS and ACKS.

Several points:

* For the time being, flags must be 0, so I was not sure whether put the 
argument or not. Just in case, I put it.

* I'm not sure how to test for availability, so configure defines 
HAVE_COPY_FILE_RANGE.

* No tests yet.

Talking about tests, I tried copying a 325MiB on an SSD, f2fs. Here are the 
times:

Old user space copy:

$ time ./python -m timeit -n 10 -s 'import shutil' 'a = open ("a.mp4", "rb"); b 
= open ("b.mp4", "wb+"); shutil.copyfileobj (a, b, 16*1024*1024)'
10 loops, best of 3: 259 msec per loop
real0m7.915s
user0m0.104s
sys 0m7.792s


New copy_file_range:

$ time ./python -m timeit -n 10 -s 'import shutil' 'a = open ("a.mp4", "rb"); b 
= open ("b.mp4", "wb+"); shutil.copyfileobj (a, b, 16*1024*1024)'
10 loops, best of 3: 193 msec per loop
real0m5.926s
user0m0.080s
sys 0m5.836s

Some 20% improvement, but notice that the buffer size is 1024 times Python's 
default size (16MiB vs. 16KiB).

One difference that I notice in semantics is that if the file is not open in 
binary form, but the file is binary, you get no UnicodeDecodeError (because the 
data never reaches userspace).

Let me know what you think.

--
keywords: +patch
Added file: http://bugs.python.org/file42616/copy_file_range.diff

___
Python tracker 

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



[issue26849] android does not support versioning in SONAME

2016-04-26 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Attached are the logcat traces of the abort.

This links helps in reading Android avc messages: 
http://www.all-things-android.com/content/debugging-se-android-avc-messages

--
Added file: http://bugs.python.org/file42618/logcat.txt

___
Python tracker 

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



[issue26862] SYS_getdents64 does not need to be defined on android API 21

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

@shiz: Can we settle on API level 21 or is there any reason to leave this in?

--
nosy: +skrah

___
Python tracker 

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



[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-26 Thread Marcos Dione

Marcos Dione added the comment:

Version without the NEWS and ACKS change.

--
Added file: http://bugs.python.org/file42617/copy_file_range.diff

___
Python tracker 

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



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

2016-04-26 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

As mentioned on the other issue #25420, this is a regression and a change in 
documented behavior of os.urandom(), which is expected to be non-blocking, 
regardless of whether entropy is available or not.

The fix should be easy (from reading the man page 
http://man7.org/linux/man-pages/man2/getrandom.2.html): set the GRND_NONBLOCK 
flag on getrandom(); then, if the function returns -1 and sets EAGAIN, fallback 
to reading from /dev/urandom directly.

--

___
Python tracker 

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



[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-26 Thread Marcos Dione

Changes by Marcos Dione :


Removed file: http://bugs.python.org/file42616/copy_file_range.diff

___
Python tracker 

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



[issue26863] android lacks some declarations for the posix module

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

Thanks again!

--
assignee:  -> skrah
nosy: +skrah
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue26863] android lacks some declarations for the posix module

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f4c6dab59cd8 by Stefan Krah in branch 'default':
Issue #26863: HAVE_FACCESSAT should (currently) not be defined on Android.
https://hg.python.org/cpython/rev/f4c6dab59cd8

--
nosy: +python-dev

___
Python tracker 

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



[issue26854] missing header on android for the ossaudiodev module

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

Thanks!

--
assignee:  -> skrah
nosy: +skrah
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue26854] missing header on android for the ossaudiodev module

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d943e6f7c9f3 by Stefan Krah in branch 'default':
Issue #26854: Android has a different include path for soundcard.h.
https://hg.python.org/cpython/rev/d943e6f7c9f3

--
nosy: +python-dev

___
Python tracker 

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



[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Daniel Morrison

New submission from Daniel Morrison:

The no_proxy environment variable works in python as a case
sensitive suffix check.

Curl handles this variable as a case insensitive hostname check.

Case sensitivity appears to be in conflict with the DNS Case
Insensitivity RFC (https://tools.ietf.org/html/rfc4343).

While the suffix check is documented
(https://docs.python.org/3/library/urllib.request.html), this
seems to be problematic and inconsistent with other tools on the
system.

I believe the ideal solution would be to have proxy_bypass be a
method of ProxyHandler so that it can be overridden without
dependence on undocumented methods. This would also allow
for the requested behavior to be added without breaking backwards
compatibility.

--
components: Library (Lib)
messages: 264297
nosy: Daniel Morrison
priority: normal
severity: normal
status: open
title: urllib.request no_proxy check differs from curl
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue26857] gethostbyname_r() is broken on android

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

Thanks, fixed.

--
assignee:  -> skrah
nosy: +skrah
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue26846] Workaround for non-standard stdlib.h on Android

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 287996ff241f by Stefan Krah in branch 'default':
Issue #26846: Post commit cleanup.
https://hg.python.org/cpython/rev/287996ff241f

--

___
Python tracker 

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



[issue26861] shutil.copyfile() doesn't close the opened files

2016-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you provide an example?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26863] android lacks some declarations for the posix module

2016-04-26 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Fixing a comment in previous patch.

--
Added file: http://bugs.python.org/file42615/posixmodule.patch

___
Python tracker 

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



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

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

I did not claim that it magically creates entropy. -- Many VMs are throwaway 
test beds. It would be annoying to setup some entropy
gathering mechanism just so that Python starts.

--

___
Python tracker 

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



[issue26857] gethostbyname_r() is broken on android

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset eb19ad1918cd by Stefan Krah in branch 'default':
Issue #26857: Workaround for missing symbol "gethostbyaddr_r" on Android.
https://hg.python.org/cpython/rev/eb19ad1918cd

--
nosy: +python-dev

___
Python tracker 

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



[issue26863] android lacks some declarations for the posix module

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

'AT_EACCESS' is not declared although HAVE_FACCESSAT is defined
'I_PUSH' is not declared

Patch attached.
The patch does not take into account the fact that this may be fixed in future 
versions of android.

--
components: Cross-Build
files: posixmodule.patch
keywords: patch
messages: 264291
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: android lacks some declarations for the posix module
type: compile error
versions: Python 3.6
Added file: http://bugs.python.org/file42614/posixmodule.patch

___
Python tracker 

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



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

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

Since many years, Linux systems store entropy on disk to quickly feed the
entropy pool at startup.

It doesn't create magically entropy on VM where you start with zero entropy
at the first boot.

--

___
Python tracker 

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



[issue26862] SYS_getdents64 does not need to be defined on android API 21

2016-04-26 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue20598] argparse docs: '7'.split() is confusing magic

2016-04-26 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: patch review -> resolved

___
Python tracker 

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



[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-26 Thread Ethan Furman

Ethan Furman added the comment:

Quick review of patch looks good.  I'll try to look it over more closely later.

--

___
Python tracker 

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



[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-26 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue26862] SYS_getdents64 does not need to be defined on android API 21

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

Revert the changeset commited at issue #20307 as the compilation does not fail 
anymore on android API level 21.

Patch attached.

--
components: Cross-Build
files: posixmodule.patch
keywords: patch
messages: 264287
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: SYS_getdents64 does not need to be defined on android API 21
type: compile error
versions: Python 3.6
Added file: http://bugs.python.org/file42613/posixmodule.patch

___
Python tracker 

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



[issue26861] shutil.copyfile() doesn't close the opened files

2016-04-26 Thread Vukasin Felbab

New submission from Vukasin Felbab:

shutil.copyfile() doesn't close the opened files, so it is vulnerable to IO 
Error 24: too many files open

actually, the src and dst files should be closed after copy

--
components: IO
messages: 264286
nosy: vocdetnojz
priority: normal
severity: normal
status: open
title: shutil.copyfile() doesn't close the opened files
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-26 Thread Aviv Palivoda

New submission from Aviv Palivoda:

I am suggesting that os.walk and os.fwalk will yield a namedtuple instead of 
the regular tuple they currently yield.
The use case for this change can be seen in the next example:

def walk_wrapper(walk_it):
for dir_entry in walk_it:
if dir_entry[0] == "aaa":
   yield dir_entry

Because walk_it can be either os.walk or os.fwalk I need to access dir_entry 
via index.

My change will allow me to change this function to:

def walk_wrapper(walk_it):
for dir_entry in walk_it:
if dir_entry.dirpath == "aaa":
   yield dir_entry

Witch is more clear and readable.

--
components: Library (Lib)
files: os-walk-result-namedtuple.patch
keywords: patch
messages: 264285
nosy: loewis, palaviv
priority: normal
severity: normal
status: open
title: os.walk and os.fwalk yield namedtuple instead of tuple
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42612/os-walk-result-namedtuple.patch

___
Python tracker 

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



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

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

It is clear how /dev/urandom works. I just think that securing enough
entropy on startup should be done by the init scripts (if systemd still
allows that :) and not by an application.

[Unless the application is gpg or similar.]

--

___
Python tracker 

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



[issue26859] unittest fails with "Start directory is not importable"

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

unittest fails to load tests when the tests are in a package that has an 
__init__.pyc file and no __init__.py file.

Patch attached.

--
components: Library (Lib)
files: unittest.patch
keywords: patch
messages: 264283
nosy: xdegaye
priority: normal
severity: normal
status: open
title: unittest fails with "Start directory is not importable"
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42611/unittest.patch

___
Python tracker 

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



[issue20598] argparse docs: '7'.split() is confusing magic

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

Thanks. The doc looks better like that.

--

___
Python tracker 

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



[issue26858] setting SO_REUSEPORT fails on android

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

Android defines SO_REUSEPORT on android API 21 but setting this option in the 
asyncio tests raises OSError: [Errno 92] Protocol not available.

The attached patch assumes there is a platform.android_ver() function to detect 
that this is the android platform.  The patch does not take into account the 
fact that this may be fixed in future versions of android.

--
components: Cross-Build
files: test.asyncio.patch
keywords: patch
messages: 264281
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: setting SO_REUSEPORT fails on android
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42610/test.asyncio.patch

___
Python tracker 

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



[issue26857] gethostbyname_r() is broken on android

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

HAVE_GETHOSTBYNAME_R is defined on android API 21, but importing the _socket 
module fails with:

ImportError: dlopen failed: cannot locate symbol "gethostbyaddr_r" 
referenced by "_socket.cpython-36m-i386-linux-gnu.so"

Patch attached.
The patch does not take into account the fact that this may be fixed in future 
versions of android.

--
components: Cross-Build
files: socketmodule.patch
keywords: patch
messages: 264280
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: gethostbyname_r() is broken on android
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42609/socketmodule.patch

___
Python tracker 

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



[issue26856] android does not have pwd.getpwall()

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

User ids on android are the ids of the applications and they are used to 
enforce the applications access rights.  See the 'User IDs and File Access' 
section at http://developer.android.com/guide/topics/security/permissions.html.

Most integers are existing user ids on android. This may explain why getpwall() 
is missing.
Patch attached.

--
components: Library (Lib)
files: pwd.patch
keywords: patch
messages: 264279
nosy: xdegaye
priority: normal
severity: normal
status: open
title: android does not have pwd.getpwall()
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42608/pwd.patch

___
Python tracker 

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch addresses Martin's comment.

--
Added file: 
http://bugs.python.org/file42607/urlparse_empty_bad_arg_deprecation2.patch

___
Python tracker 

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




[issue26855] add platform.android_ver() for android

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

The attached patch misses a test case.

Also how can we be sure that the '/system/build.prop' file may be guaranteed to 
exist on all android devices ?
It is difficult to get a reliable information on the android infrastructure 
when the information does not relate to the java libraries.

--
components: Cross-Build
files: platform.patch
keywords: patch
messages: 264277
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: add platform.android_ver() for android
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42606/platform.patch

___
Python tracker 

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



  1   2   >