[issue25581] Python -U raises error during site import

2015-11-08 Thread SilentGhost

SilentGhost added the comment:

> Interesting, I didn't even know (remember?) about the -U flag, and it isn't 
> documented.
https://docs.python.org/2/using/cmdline.html#cmdoption-U

It isn't clear when this broken or why, but I think existing documentation 
could be adjusted to have a bigger warning around this option.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue25570] urllib.request > Request.add_header("abcd", "efgh") fails with character ":" in first parameter string

2015-11-08 Thread Christian Rickert

Christian Rickert added the comment:

>>Ah, I think I see where you are coming from. I guess you aren’t intimately 
>>familiar with the HTTP protocol.

Exactly. :)


>>If you can given a specific comment line to add to a specific example, that 
>>might be useful. Even if you aren’t 100% sure of the details :)

[OpenerDirector example]
import urllib.request
opener = urllib.request.build_opener()
# adding custom header value to the 'User-agent' key
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
opener.open('http://www.example.com/')

"This is often used to “spoof” the User-Agent header VALUE, which is used by a 
browser to identify itself ..."

--

___
Python tracker 

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



[issue25583] os.makedirs with exist_ok=True raises PermissionError on Windows 7^

2015-11-08 Thread Daniel Plachotich

New submission from Daniel Plachotich:

Since Windows 7 (or even Vista), Windows gives permission error(5, 
ERROR_ACCESS_DENIED
if you try to create a directory in a drive root with the same name as a drive 
itself,
even if you have administrative permissions. This behavior is not mentioned in 
Microsoft docs.

Here is an example session (Windows 7, admin):
d:\>IF EXIST . echo True
True
d:\>mkdir .
Access is denied.
d:\>mkdir dir
d:\>cd dir
d:\dir>mkdir .
A subdirectory or file . already exists.
d:\dir>cd ..
d:\>
d:\>py -3
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (In
tel)] on win32
>>> import os
>>> os.path.isdir('.')
True
>>> os.makedirs('.', exist_ok=True)
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python34\lib\os.py", line 237, in makedirs
mkdir(name, mode)
PermissionError: [WinError 5] ...
>>> try:
...   os.mkdir('.')
... except OSError as e:
...   print(e.errno)
...
13

This means that if you want to write portable code, you still need to write 
like in Python 2:
if not os.path.isdir(path):
os.makedirs(path)
Which makes exist_ok useless.

The actual problem is in this line (Lib/os.py#l243):
if not exist_ok or e.errno != errno.EEXIST or not path.isdir(name):

Due the reasons described above, makedirs shouldn't rely on e.errno, so the 
right code will be:
if not (exist_ok and path.isdir(name)):

I think the issue is pretty serious to be backported.

--
components: Library (Lib)
messages: 254339
nosy: Daniel Plachotich
priority: normal
severity: normal
status: open
title: os.makedirs with exist_ok=True raises PermissionError on Windows 7^
type: behavior
versions: 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



[issue22499] [SSL: BAD_WRITE_RETRY] bad write retry in _ssl.c:1636

2015-11-08 Thread Nikolaus Rath

Nikolaus Rath added the comment:

This just happened again to someone else, also using Python 3.4: 
https://bitbucket.org/nikratio/s3ql/issues/87

Is there anything the affected people can do to help debugging this?

--

___
Python tracker 

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



[issue24802] int and float constructing from non NUL-terminated buffer

2015-11-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a13d9656f954 by Martin Panter in branch '3.5':
Issue #24802: Update test case for ValueError in 3.5
https://hg.python.org/cpython/rev/a13d9656f954

New changeset 96cdd2532034 by Martin Panter in branch 'default':
Issue #24802: Merge ValueError test case from 3.5
https://hg.python.org/cpython/rev/96cdd2532034

--

___
Python tracker 

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



[issue25582] Fixed memory leaks in test_ctypes

2015-11-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, sorry. Here is a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file40979/ctypes_test_leak.patch

___
Python tracker 

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



[issue25580] async and await missing from token list

2015-11-08 Thread Martin Panter

Martin Panter added the comment:

I wonder if the new tokens need a “versionadded” notice. They were added in 
revision eeeb666a5365 for 3.5.

--
nosy: +martin.panter, yselivanov

___
Python tracker 

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



[issue25583] os.makedirs with exist_ok=True raises PermissionError on Windows 7^

2015-11-08 Thread Daniel Plachotich

Daniel Plachotich added the comment:

Probably better solution:

if not (exist_ok and path.isdir(name) and
e.errno in (errno.EEXIST, errno.EACCES)):

--

___
Python tracker 

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



[issue19915] int.bit_at(n) - Accessing a single bit in O(1)

2015-11-08 Thread anon

anon added the comment:

Any update on this?

--

___
Python tracker 

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



[issue24203] Depreciate threading.Thread.isDaemon etc

2015-11-08 Thread anon

anon added the comment:

Any consensus?

--

___
Python tracker 

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



[issue25581] Python -U raises error during site import

2015-11-08 Thread STINNER Victor

STINNER Victor added the comment:

Reminder: use Python 3 to get an excellent Unicode support everywhere.

--

___
Python tracker 

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



[issue24802] int and float constructing from non NUL-terminated buffer

2015-11-08 Thread Martin Panter

Martin Panter added the comment:

Thanks for picking that up Serhiy

--
resolution:  -> fixed
stage: commit review -> 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



[issue24999] Segfault in test_re.test_sre_character_class_literals() when Python is compiled by ICC

2015-11-08 Thread Stefan Krah

Stefan Krah added the comment:

> It looks to me that all issues are related to floating points.

You need to compile with "-fp-model strict" or the Windows
equivalent (I think "-fp-model precise").

--

___
Python tracker 

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



[issue24999] Segfault in test_re.test_sre_character_class_literals() when Python is compiled by ICC

2015-11-08 Thread Stefan Krah

Stefan Krah added the comment:

If anyone worries that "-fp-model strict" will slow
things down:  In the Python context these settings have
no measurable impact:  A while ago I tested setting/restoring
the control word *for every operation*, and even that did
not have any impact.

--

___
Python tracker 

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



[issue19883] Integer overflow in zipimport.c

2015-11-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file40981/zipimport_int_overflow_2.patch

___
Python tracker 

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



[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I already don't remember if it was a deliberate design, or just implementation 
detail. In any case it is not documented.

> I believe this behavior matches the documentation:

No, it is not related. It is that './**/' will list only directories, not 
regular files.

> I wonder if '***.pacnew' would work.

No, only ** as a whole path component works.

--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue25586] socket.sendall broken when a socket has a timeout

2015-11-08 Thread Jakub Stasiak

New submission from Jakub Stasiak:

It is my understanding that socket.sendall effectively calls the underlying 
socket.send's implementation in a retry loop, possibly multiple times.

It is also my understanding that each one of those low level send calls can 
timeout on its own if a socket timeout is set.

Considering the above I believe it's undesired to ever call socket.sendall with 
a socket that has a timeout set because if:

1. At least one send call succeeds
2. A send call after that times out

then a socket timeout error will be raised and the information about the sent 
data will be lost.

Granted, the documentation says that "On error, an exception is raised, and 
there is no way to determine how much data, if any, was successfully sent". I 
believe, however, that such API is very easy to misuse (I've seen it used with 
sockets with timeout set, because of small payload sizes and other 
circumstances it would appear to work fine most of the time and only fail every 
N hours or days).

Possible improvements I see:

1. Explicitly mention interaction between socket's timeout and sendall's 
behavior in the documentation
2. Make sendall raise an error when the socket it's called with has a timeout 
set (I can see the backwards compatibility being a concern here but I can't 
think of any reason to remain compatible with behavior I believe to be broken 
anyway)
3. Both of the above

I'm happy to procure an appropriate patch for any of the above. Please correct 
me if my understanding of this is off.

--
assignee: docs@python
components: Documentation, IO, Library (Lib)
messages: 254357
nosy: docs@python, jstasiak
priority: normal
severity: normal
status: open
title: socket.sendall broken when a socket has a timeout
type: behavior
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



[issue25583] os.makedirs with exist_ok=True raises PermissionError on Windows 7^

2015-11-08 Thread Daniel Plachotich

Daniel Plachotich added the comment:

Of course in examples I create '.' by hand, but in real code such things are
mostly automatic. Assume, for example, that you have a function for downloading
files:

def download_file(url, save_as):
  ...
  # Before saving, you must ensure that path exists:
  os.makedirs(os.path.dirname(save_as), exist_ok=True)
  ...

os.path.abspath is not a solution, because, as it was mentioned, mkdir with
adrive name gives the same result:
d:\>mkdir d:\\
Access is denied.

Anyway, skipping the calls must be a job of exist_ok=True, otherwise it has
any sense.

By the way, do not pay attention to my second message(msg254341): as I said
at first, mkdirs shouldn't use e.errno at all. Because, as said in docstring,
makedirs must first check whether a folder exists, and only then call mkdir.
But currently it works in reverse order, which, in essence, is the source
of the problem.

I don't know why it was done that way, because if you try "timeit"
"try->mkdir->except" vs "if not isdir->mkdir", you will see that the second
is much faster (x3 (!) times on Windows, x0.7 times on Linux (on ext4 partition)
on my machine).

So the best solution is the most straightforward - to replace try-except block 
with:
  if not path.isdir(name):
  mkdir(name, mode)

--

___
Python tracker 

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



[issue19883] Integer overflow in zipimport.c

2015-11-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is revised patch. It addresses Gregory's comments, uses properly integer 
types and converters for all values, and adds additional checks for integer 
overflows and ZIP file validity. As a side effect the performance can be 
increased due to less memory allocations and IO operations.

--
Added file: http://bugs.python.org/file40980/zipimport_int_overflow_2.patch

___
Python tracker 

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



[issue25585] Bad path leads to: ImportError: DLL load failed: %1 is not a valid Win32 application.

2015-11-08 Thread Laura Creighton

New submission from Laura Creighton:

Somebody reported this today:

File "C:/Python27/kivyhello.py", line 4, in 
 from kivy.app import App
   File "C:/Python27\kivy\app.py", line 316, in 
 from kivy.base import runTouchApp, stopTouchApp
   File "C:/Python27\kivy\base.py", line 30, in 
 from kivy.event import EventDispatcher
   File "C:/Python27\kivy\event.py", line 8, in 
 import kivy._event
 ImportError: DLL load failed: %1 is not a valid Win32 application.



The problem was that they needed to set their PATH properly so kivy could be 
found.

Couldn't we generate a more informative error message here?
Is the %1 even correct?

--
messages: 254349
nosy: lac
priority: normal
severity: normal
status: open
title: Bad path leads to: ImportError: DLL load failed: %1 is not a valid Win32 
application.
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



[issue25585] Bad path leads to: ImportError: DLL load failed: %1 is not a valid Win32 application.

2015-11-08 Thread R. David Murray

R. David Murray added the comment:

I'm guessing that's the error we got from the OS.  Maybe there's additional 
info we could add, though, I don't know.  It would be interesting to know if it 
does the same thing in python3...and unfortunately it isn't as easy to change 
things in the python2 import system as it is in python3.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue25583] os.makedirs with exist_ok=True raises PermissionError on Windows 7^

2015-11-08 Thread Daniel Plachotich

Daniel Plachotich added the comment:

I meant x1.3 times faster on Linux :)

--

___
Python tracker 

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



[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-08 Thread R. David Murray

R. David Murray added the comment:

I believe this behavior matches the documentation:

  "If the pattern is followed by an os.sep, only directories and subdirectories 
match."

('the pattern' being '**')

I wonder if '***.pacnew' would work.

--
nosy: +pitrou, r.david.murray

___
Python tracker 

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



[issue19883] Integer overflow in zipimport.c

2015-11-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Sorry, the patch contained parts of the advanced patch that will be submitted 
in separate issue.

--
Added file: http://bugs.python.org/file40982/zipimport_int_overflow_2.patch

___
Python tracker 

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



[issue25586] socket.sendall broken when a socket has a timeout

2015-11-08 Thread Martin Panter

Martin Panter added the comment:

I don’t like the sound of improvement 2. I think it would break existing use 
cases, e.g. HTTPConnection(timeout=...), urlopen(timeout=...). If you want a 
HTTP request to abort if it takes a long time, how is that behaviour broken?

Regarding improvement 1, I think Victor’s 3.5 documentation explains how the 
timeout works fairly well. Perhaps you meant for this bug to be about pre-3.5 
versions?

Also, see Issue 7322 for discussion of how to handle exceptions when reading 
from sockets and other streams. E.g. what should readline() do when it has read 
half a line and then gets an exception, and should you be allowed to read again 
after handling an exception? In my mind the readline() and sendall() cases are 
somewhat complementary.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25585] Bad path leads to: ImportError: DLL load failed: %1 is not a valid Win32 application.

2015-11-08 Thread SilentGhost

Changes by SilentGhost :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue25586] socket.sendall broken when a socket has a timeout

2015-11-08 Thread STINNER Victor

STINNER Victor added the comment:

FYI the behaviour of socket.socket.sendall() regarding timeout has been 
modified in Python 3.5:
https://docs.python.org/dev/library/socket.html#socket.socket.sendall

"Changed in version 3.5: The socket timeout is no more reset each time data is 
sent successfuly. The socket timeout is now the maximum total duration to send 
all data."

--
nosy: +haypo

___
Python tracker 

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



[issue25583] os.makedirs with exist_ok=True raises PermissionError on Windows 7^

2015-11-08 Thread Daniel Plachotich

Daniel Plachotich added the comment:

Of course, exist_ok must be taken into account:
if not (exist_ok and path.isdir(name)):
mkdir(name, mode)

--

___
Python tracker 

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



[issue19883] Integer overflow in zipimport.c

2015-11-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file40981/zipimport_int_overflow_2.patch

___
Python tracker 

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



[issue19883] Integer overflow in zipimport.c

2015-11-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file40980/zipimport_int_overflow_2.patch

___
Python tracker 

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



[issue25576] Remove “Content-Type: application/x-www-form-urlencoded; charset” advice

2015-11-08 Thread R. David Murray

R. David Murray added the comment:

OK, I'll accept that as authoritative :)

One very minor comment in the review, otherwise looks good to me.

--

___
Python tracker 

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



[issue25583] os.makedirs with exist_ok=True raises PermissionError on Windows 7^

2015-11-08 Thread R. David Murray

R. David Murray added the comment:

If you are trying to create a directory named '.' your code will not do 
anything useful, you might as well skip the call.  What's the use case?

That said, the fix looks reasonable.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue25570] urllib.request > Request.add_header("abcd", "efgh") fails with character ":" in first parameter string

2015-11-08 Thread Martin Panter

Martin Panter added the comment:

Hmm, I wonder if that OpenerDirector example is a bit obscure. Normally you 
would use the default urlopen() to set User-Agent, without resorting to a 
custom OpenerDirector.

In my patch:

* Included “User-Agent header _value_” in the “headers” parameter description
* Linked to  from examples 
section
* Added add_header("User-Agent", ...) example with made-up custom value

Let me know what you think (if anything is unnecessary, other suggestions?)

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
keywords: +patch
nosy: +docs@python
stage: needs patch -> patch review
type: behavior -> enhancement
versions: +Python 2.7, Python 3.4, Python 3.6
Added file: http://bugs.python.org/file40984/add_header.patch

___
Python tracker 

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



[issue25586] socket.sendall broken when a socket has a timeout

2015-11-08 Thread Jakub Stasiak

Jakub Stasiak added the comment:

Martin: While I'd consider timeout in HTTPConnection(timeout=...) or 
urlopen(timeout=...) to be the timeout for the entire operation, just just for 
the data sending part and HTTPConnection/urlopen can achieve the timeout 
behavior using just send I concede there may be valid use cases for "either 
sendall succeeds or we don't care about what we've sent anyway" and in this 
light my second suggestion is problematic.

Victor: The behavior change in 3.5 does't affect my concern from what I see.  
The concern is sendall timing out after some data has already been sent which 
can create some subtle issues. I've seen code like this:

def x(data, sock):
while True:
# some code here
try:
sock.sendall(data)
return
except timeout:
pass


Now I'll agree the code is at fault for ever attempting to retry sendall but I 
also think the API is easy to misuse like this. And it many cases it'll just 
work most of the time because sendall won't timeout.

Maybe explicitly mentioning sendall's behavior concerning sockets with timeouts 
could improve this? I'm honestly not sure anymore, technically "On error, an 
exception is raised, and there is no way to determine how much data, if any, 
was successfully sent." should be enough.

--

___
Python tracker 

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



[issue25586] socket.sendall broken when a socket has a timeout

2015-11-08 Thread Martin Panter

Martin Panter added the comment:

Maybe it would be reasonable to expand on that “On error” sentence. I imagine 
the main errors that would cause this situation are a timeout as you say, and 
also a blocking exception. Also, you could point out that if you have lost 
record of how much has already been sent, it may not make sense to send any 
more data with the same socket.

--
versions:  -Python 3.2, Python 3.3

___
Python tracker 

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



[issue25576] Remove “Content-Type: application/x-www-form-urlencoded; charset” advice

2015-11-08 Thread Martin Panter

Martin Panter added the comment:

The second version of the patch changes some more examples in the how-to to 
data.encode("ascii"). I’ll leave this open for a bit in case Senthil is around 
and wants to comment (seeing as he added the text I am removing).

--
Added file: http://bugs.python.org/file40983/urlencoded-charset.2.patch

___
Python tracker 

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



[issue25576] Remove “Content-Type: application/x-www-form-urlencoded; charset” advice

2015-11-08 Thread Martin Panter

Martin Panter added the comment:

I think the server bugs referenced by the Mozilla bug are mainly about servers 
that do not recognize the content type at all, due the the presence of any 
charset parameter. They probably do something like “if headers['Content-Type'] 
== 'application/x-www-form-urlencoded' ” without checking for parameters first. 
So it wouldn’t matter if it was charset=latin-1 or charset=utf-8.

A couple comments in the Mozilla bug say that including “charset” is specified 
by a HTTP standard, but I suspect this may be a mistake. Perhaps this is the 
best evidence for my argument, from 
:

'''
Parameters on the “application/x-www-form-urlencoded” MIME type are ignored. In 
particular, this MIME type does not support the “charset” parameter.
'''

--

___
Python tracker 

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



[issue25582] Fixed memory leaks in test_ctypes

2015-11-08 Thread Martin Panter

Martin Panter added the comment:

Seems to be missing your patch

--
nosy: +martin.panter

___
Python tracker 

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



[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-08 Thread Xavier de Gaye

New submission from Xavier de Gaye:

On archlinux during an upgrade, the package manager backups some files in /etc 
with a .pacnew extension. On my system there are 20 such files, 9 .pacnew files 
located in /etc and 11 .pacnew files in subdirectories of /etc. The following 
commands are run from /etc:

$ shopt -s globstar
$ ls **/*.pacnew | wc -w
20
$ ls *.pacnew | wc -w
9

With python:

$ python
Python 3.6.0a0 (default:72cca30f4707, Nov  2 2015, 14:17:31) 
[GCC 5.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import glob
>>> len(glob.glob('./**/*.pacnew', recursive=True))
20
>>> len(glob.glob('*.pacnew'))
9
>>> len(glob.glob('**/*.pacnew', recursive=True))
11

The '**/*.pacnew' pattern does not list the files in /etc, only those located 
in the subdirectories of /etc.

--
components: Library (Lib)
messages: 254344
nosy: serhiy.storchaka, xdegaye
priority: normal
severity: normal
status: open
title: a recursive glob pattern fails to list files in the current directory
type: behavior
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



[issue25583] os.makedirs with exist_ok=True raises PermissionError on Windows 7^

2015-11-08 Thread Martin Panter

Martin Panter added the comment:

Daniel: your latest suggestions look like they introduce a race condition. What 
happens if another thread or process, perhaps also calling makedirs(), creates 
the directory just after isdir() says it doesn’t exist? Similar to Issue 
1608579.

Perhaps the existing code comment needs to clarify that the exception handling 
is for a real race condition, not just an excuse to “be happy” :)

--
components: +Windows
nosy: +martin.panter, paul.moore, steve.dower, tim.golden, zach.ware
stage:  -> needs patch
versions:  -Python 3.2, Python 3.3

___
Python tracker 

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



[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Likely it was implementation artifact. Current implementation is simpler butter 
fitted existing glob design. The problem was that '**/a' should list 'a' and 
'd/a', but '**/' should list only 'd/', and not ''.

Here is a patch that makes '**' to match also zero directories. Old tests were 
passed, new tests are added to cover this case.

--
keywords: +patch
stage:  -> patch review
versions: +Python 3.5
Added file: http://bugs.python.org/file40986/rglob_zero_dirs.patch

___
Python tracker 

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



[issue2275] Make urllib.request.Request.has_header() etc case-insensitive

2015-11-08 Thread Martin Panter

Martin Panter added the comment:

Please review insensitive-lookup.patch:

* Adapt John’s patch to current code
* Apply similar changes to Request.remove_header()
* Expanded on case-insensitivity, previous capitalize() requirements, and 
header_items() casing in the documentation
* Dropped testing of unredirected_hdrs and of headers being case-sensitive. I 
think these are implementation details, and are not part of the implicit API 
from before the has_header() etc methods.
* Reverted unnecessary test removal in test case
* Added What’s New entry

--
stage: needs patch -> patch review
versions: +Python 3.6 -Python 3.3
Added file: http://bugs.python.org/file40985/insensitive-lookup.patch

___
Python tracker 

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



[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-08 Thread R. David Murray

R. David Murray added the comment:

Ah, I see, 'pattern' there means the whole pattern.  That certainly isn't clear.

--

___
Python tracker 

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



[issue25587] Useless addition in PyTuple_New

2015-11-08 Thread Jim Nasby

New submission from Jim Nasby:

In PyTuple_New, if the new tuple won't go on the free_list:

/* Check for overflow */
if (nbytes / sizeof(PyObject *) != (size_t)size ||
(nbytes > PY_SSIZE_T_MAX - sizeof(PyTupleObject) - 
sizeof(PyObject *)))
{
return PyErr_NoMemory();
}
nbytes += sizeof(PyTupleObject) - sizeof(PyObject *);

nbytes is never used after the overflow check, so the last addition is a waste.

--
messages: 254367
nosy: Jim Nasby
priority: normal
severity: normal
status: open
title: Useless addition in PyTuple_New
type: performance
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



[issue25585] Bad path leads to: ImportError: DLL load failed: %1 is not a valid Win32 application.

2015-11-08 Thread eryksun

eryksun added the comment:

The "DLL load failed" message is from Python, but the rest is the text for the 
Windows error code, ERROR_BAD_EXE_FORMAT (0x00c1) [1]. The "%1" in the string 
can be expanded as the first element of the Arguments array parameter of 
FormatMessage [2]. But currently the code in Python/dynload_win.c uses 
FORMAT_MESSAGE_IGNORE_INSERTS and does no post-processing to replace the "%1".

I don't know why the Windows loader reported ERROR_BAD_EXE_FORMAT instead of 
ERROR_MOD_NOT_FOUND. Possibly it found another version of a dependent DLL that 
was corrupt or for a different architecture. 

Note that the setup in this case is odd in that the package is installed in 
C:\Python27 instead of in the site-packages directory.

[1]: https://msdn.microsoft.com/en-us/library/ms681382#ERROR_BAD_EXE_FORMAT
[2]: https://msdn.microsoft.com/en-us/library/ms679351

--
nosy: +eryksun

___
Python tracker 

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