[issue22559] [backport] ssl.MemoryBIO

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

> Since this is such a new feature (not even released in 3.x), I don't think we 
> should put it in 2.7.9.

While ssl.MemoryBIO would be very useful on Windows for Trollius (to support 
SSL with the IOCP event loop), I also consider it as a new feature. It's a 
little bit borderline between feature and security fix.

Maybe it should be discussed on python-dev?

Note: MemoryBIO was added by issue #21965 (first commit: a79003f25a41).

--
nosy: +haypo

___
Python tracker 

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



[issue23450] Possible loss of data warnings building 3.5 Visual Studio Windows 8.1 64 bit

2015-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch which fixes many warnings reported by MS compiler on 64-bit 
platform [1]. Some of these warnings indicated real bugs.

[1] 
http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/411/steps/compile/logs/warnings%20(396)

--
components: +Extension Modules, Interpreter Core -Build, Windows
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file38106/int_overflows.patch

___
Python tracker 

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



[issue20699] Behavior of ZipFile with file-like object and BufferedWriter.

2015-02-12 Thread Martin Panter

Martin Panter added the comment:

Posting patch v2:

* Changed readinto() argument descriptions to “a pre-allocated, writable 
bytes-like buffer”, for both RawIOBase and BufferedIOBase
* Integrated the single-use test_memoryio.BytesIOMixin test class, which 
tricked me when I did the first patch
* Added tests for BufferedRWPair, BytesIO.readinto() etc methods with 
non-bytearray() buffers
* Fix _pyio.BufferedReader.readinto/1() for non-bytearray

--
Added file: http://bugs.python.org/file38107/bytes-like-param.v2.patch

___
Python tracker 

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



[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

scandir-3.patch: New implementation based on scandir-2.patch on Ben's github 
repository.

Main changes with scandir-2.patch:

* new DirEntry.inode() method

* os.scandir() doesn't support bytes on Windows anymore: it's deprecated since 
python 3.3 and using bytes gives unexpected results on Windows


As discussed with Ben Hoyt, I added a inode() method to solve the use case 
described here:
https://www.reddit.com/r/Python/comments/2synry/so_8_peps_are_currently_being_proposed_for_python/cnvnz1w

I will update the PEP 471 to add the inode() method.


Notes:

* os.scandir() doesn't accept a file descriptor, as decided in the PEP 471.

* It may be nice to modify Scandir.close() to close the handle/directory; 
Scandir is the iterator returned by os._scandir()

* My patch doesn't modify os.walk(): it prefer to do that in a new issue

* DirEntry methods have no docstring


Changes with scandir-2.patch:

* C code is added to posixmodule.c, not into a new _scandir.c file, to avoid 
code duplication (all Windows code to handle attributes)
* C code is restricted to the minimum: it's now only a wrapper to 
opendir+readdir and FindFirstFileW/FindNextFileW
* os._scandir() directly calls opendir(), it's no more delayed to the first 
call to next(), to report errors earlier. In practice, I don't think that 
anymore will notify :-p
* don't allocate a buffer to store a HANDLE: use directly a HANDLE
* C code: use #ifdef inside functions, not outside
* On Windows, os._scandir() appends "*.*" instead of "*" to the path, to mimic 
os.listdir()
* put information about cache and syscall directly in the doc of DirEntry 
methods
* remove promise of performances from scandir doc: be more factual, explain 
when syscalls are required or not
* expose DT_UNKOWN, DT_DIR, DT_REG, DT_LNK constants in the posix module; but I 
prefer to not document them: use directly scandir!
* rewrite completly unit test:

  - reuse test.support
  - compare DirEntry attributes with the result of functions (ex: os.stat() or 
os.path.islink())

* add tests on removed directory, removed file and broken symbolic link
* remove ":" from repr(DirEntry) result, it's now ""; drop 
__str__ method (by default, __str__ calls __repr__)
* use new OSError subclasses (FileNotFoundError)
* DirEntry methods: use stat.S_ISxxx() methods instead of "st.st_mode & 
0o17 == S_IFxxx"

--
Added file: http://bugs.python.org/file38108/scandir-3.patch

___
Python tracker 

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



[issue23446] Use PyMem_New instead of PyMem_Malloc

2015-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> In _testbuffer.c:  ndim <= 64, so the changes aren't really necessary.

Indeed, I'll remove these changes.

> The reason is of course that even an array with only 2 elements per
dimension gets quite large with ndim=64. :)

But an array can be with 1 element per dimension. In any case it is good that 
there is strict limitation on ndim values.

--

___
Python tracker 

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



[issue23453] Opening a stream with tarfile.open() triggers a TypeError: can't concat bytes to str error

2015-02-12 Thread Carl Chenet

New submission from Carl Chenet:

I'm trying to use a tar stream to a Python tarfile object but each time I do 
have a  TypeError: can't concat bytes to str error

Here is my test:
-8<-
#!/usr/bin/python3.4

import tarfile
import sys

tarobj = tarfile.open(mode='r|', fileobj=sys.stdin)
print(tarobj)
tarobj.close()
-8<-


$ tar cvf test.tar.gz tests/
tests/
tests/foo1
tests/foo/
tests/foo/bar
$ tar -O -xvf test.tar | ./tarstream.py
tests/
tests/foo1
tests/foo/
tests/foo/bar
Traceback (most recent call last):
  File "./tarstream.py", line 6, in 
tarobj = tarfile.open(mode='r|', fileobj=sys.stdin)
  File "/usr/lib/python3.4/tarfile.py", line 1578, in open
t = cls(name, filemode, stream, **kwargs)
  File "/usr/lib/python3.4/tarfile.py", line 1470, in __init__
self.firstmember = self.next()
  File "/usr/lib/python3.4/tarfile.py", line 2249, in next
tarinfo = self.tarinfo.fromtarfile(self)
  File "/usr/lib/python3.4/tarfile.py", line 1082, in fromtarfile
buf = tarfile.fileobj.read(BLOCKSIZE)
  File "/usr/lib/python3.4/tarfile.py", line 535, in read
buf = self._read(size)
  File "/usr/lib/python3.4/tarfile.py", line 543, in _read
return self.__read(size)
  File "/usr/lib/python3.4/tarfile.py", line 569, in __read
self.buf += buf
TypeError: can't concat bytes to str

Regards,
Carl Chenet

--
components: Library (Lib)
messages: 235808
nosy: chaica_
priority: normal
severity: normal
status: open
title: Opening a stream with tarfile.open() triggers a TypeError: can't concat 
bytes to str error
type: crash
versions: Python 3.4

___
Python tracker 

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



[issue20486] msilib: can't close opened database

2015-02-12 Thread Mark Lawrence

Mark Lawrence added the comment:

Sorry folks I can't try this myself as I'm not running 2.7 and I don't know how 
to create the test.msi file.

--
nosy: +BreamoreBoy, 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



[issue23453] Opening a stream with tarfile.open() triggers a TypeError: can't concat bytes to str error

2015-02-12 Thread Martin Panter

Martin Panter added the comment:

Using fileobj=sys.stdin.buffer instead should do the trick. The “tarfile” 
module would expect a binary stream, not a text stream.

Given the documentation currently says, “Use this variant in combination with 
e.g. sys.stdin, . . .”, I presume that is why you were using plain stdin. The 
documentation should be clarified.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python, vadmium

___
Python tracker 

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



[issue20391] windows python launcher should support explicit 64-bit version

2015-02-12 Thread Mark Lawrence

Mark Lawrence added the comment:

Having read 
https://docs.python.org/3/using/windows.html#customizing-default-python-versions
 I'm not convinced that this is needed, as the first sentence of the fifth 
paragraph states "On 64-bit Windows with both 32-bit and 64-bit implementations 
of the same (major.minor) Python version installed, the 64-bit version will 
always be preferred."

--
components: +Windows
nosy: +BreamoreBoy, steve.dower, tim.golden, zach.ware
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



[issue23450] Possible loss of data warnings building 3.5 Visual Studio Windows 8.1 64 bit

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

The 64-bit support of Windows is still incomplete :-/ We tried to fix most of 
them, but there are still remaining issues.

The main issue is #9566. I opened for example the issue #18295: "Possible 
integer overflow in PyCode_New()".

--

___
Python tracker 

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



[issue23450] Possible loss of data warnings building 3.5 Visual Studio Windows 8.1 64 bit

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

signal_cast_socket_t.patch: Fix warning in signal.set_wakeup_fd(). I introduced 
recently the warning when I added support for sockets in this function on 
Windows.

--
Added file: http://bugs.python.org/file38109/signal_cast_socket_t.patch

___
Python tracker 

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



[issue23314] Disabling CRT asserts in debug build

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

"When we completely switch Windows builds over to VC14, we're going to 
encounter some new assert dialogs from the CRT. (...) A number of tests attempt 
operations on bad file descriptors, which will assert and terminate in MSVCRT 
(I have a fix for the termination coming, but the assertions will still 
appear)."

Can you give some examples of tests which fail with an assertion error?

_PyVerify_fd() doesn't protect use against the assertion error?

I would prefer to keep CRT error checks, to protect us against bugs.

--

Instead of patching faulthandler, you should patch 
test.support.SuppressCrashReport.__enter__. This function already calls 
SetErrorMode(). Instead of ctypes, the function may be exposed in the _winapi 
module for example. I'm talking about SetErrorMode() *and* _CrtSetReportMode().

+#if defined MS_WINDOWS && defined _DEBUG
+if ((p = Py_GETENV("PYTHONNOCRTASSERT")) && *p != '\0') {
+_CrtSetReportMode(_CRT_ASSERT, 0);
+}
+#endif

The function is not available if _DEBUG is not defined? Why not calling the 
function if _DEBUG is not defined?

--

___
Python tracker 

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



[issue20523] global .pdbrc on windows 7 not reachable out of the box

2015-02-12 Thread Mark Lawrence

Mark Lawrence added the comment:

We have a patch to review or we need a doc patch, unless someone has a 
different idea to the approaches suggested by the originator.  I prefer the 
idea of changing the code, manually changing environment variables just seems 
wrong to me, but I won't lose any sleep over it.

--
components: +Library (Lib), Windows
nosy: +BreamoreBoy, steve.dower, tim.golden, zach.ware
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



[issue20521] [PATCH] Cleanup for "dis" module documentation

2015-02-12 Thread Mark Lawrence

Mark Lawrence added the comment:

Could someone review the patch please, it doesn't appear to contain anything 
that's contentious.

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue20947] -Wstrict-overflow findings

2015-02-12 Thread Mark Lawrence

Mark Lawrence added the comment:

@Serhiy/Victor I believe that you're both interested in this type of problem.

--
nosy: +BreamoreBoy, haypo, serhiy.storchaka

___
Python tracker 

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



[issue23446] Use PyMem_New instead of PyMem_Malloc

2015-02-12 Thread Stefan Krah

Stefan Krah added the comment:

Yes, but these (degenerate) arrays tend to arise only as a result of slicing.
Last time I looked NumPy had MAX_NDIM=32, so we should be fine.

--

___
Python tracker 

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



[issue21107] Add pgen.vcxproj to allow regenerating grammar files on Windows

2015-02-12 Thread Mark Lawrence

Mark Lawrence added the comment:

Would you guys please review the patch as it's Double Dutch to me.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue17306] Improve the way abstract base classes are shown in help()

2015-02-12 Thread Mark Lawrence

Changes by Mark Lawrence :


--
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue20699] Document that binary IO classes work with bytes-likes objects

2015-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch LGTM. But native speaker should check documentation part.

--
title: Behavior of ZipFile with file-like object and BufferedWriter. -> 
Document that binary IO classes work with bytes-likes objects

___
Python tracker 

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



[issue23383] Clean up bytes formatting

2015-02-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue23450] Possible loss of data warnings building 3.5 Visual Studio Windows 8.1 64 bit

2015-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

signal_cast_socket_t.patch LGTM.

--

___
Python tracker 

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



[issue20391] windows python launcher should support explicit 64-bit version

2015-02-12 Thread Steve Dower

Steve Dower added the comment:

It may be useful if you want an error rather than the 32-bit version, though 
there are other ways to check that if it's critical and it probably is better 
in the script.

Patches welcome :)

--

___
Python tracker 

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



[issue20088] locale.getlocale() fails if locale name doesn't include encoding

2015-02-12 Thread Mark Lawrence

Mark Lawrence added the comment:

With #20079 closed but #20087 still open where do we stand with this issue?

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue23450] Possible loss of data warnings building 3.5 Visual Studio Windows 8.1 64 bit

2015-02-12 Thread Steve Dower

Steve Dower added the comment:

Wow, I didn't expect that so quickly :)

I'll check these out as soon as I can, but they look okay from a quick glance 
on my phone.

--

___
Python tracker 

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



[issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong)

2015-02-12 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy: +rhettinger
title: super behavioru and abstract base classes (either implementation or 
documentation/error message is wrong) -> super behaviour and abstract base 
classes (either implementation or documentation/error message is wrong)
versions: +Python 3.4, Python 3.5 -Python 3.3

___
Python tracker 

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



[issue23314] Disabling CRT asserts in debug build

2015-02-12 Thread Steve Dower

Steve Dower added the comment:

_Py_verifyfd has to go away, unfortunately. It requires inside knowledge of the 
exact CRT version, and with VC14 the CRT will automatically upgrade so that 
we're always using the latest.

I've gotten a function added to the CRT to make it unnecessary for release 
builds (which terminate on invalid fds). However, debug builds will display a 
message box still, which affects the buildbots. test already suppresses the 
dialogs for its own process, but when it creates subprocesses they don't 
inherit that setting.

An environment variable is an easy way to make sure that all subprocesses also 
have assert dialogs disabled. In release builds they are always disabled, hence 
the _DEBUG check.

--

___
Python tracker 

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



[issue23146] Incosistency in pathlib between / and \

2015-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--

___
Python tracker 

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



[issue21107] Add pgen.vcxproj to allow regenerating grammar files on Windows

2015-02-12 Thread Zachary Ware

Zachary Ware added the comment:

The patch is way out of date, pgen.vcxproj needs to be updated to match the 
rest of our projects.

If nobody else takes this over (and it is low priority for a reason!), I'll get 
back to it eventually.

--
nosy: +steve.dower

___
Python tracker 

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



[issue23454] plistlib and xml.parsers.expat python3 problems with strings and bytes

2015-02-12 Thread Ulrich Dorsch

New submission from Ulrich Dorsch:

TypeError: startswith first arg must be str or a tuple of str, not bytes

In line 558 of plistlib.py at the beginnging of "def _is_fmt_xml(header)" is 
the problem, caused by the use of the byte arguments defined in line 555 
(prefixes = (b'

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



[issue21568] Win32 pip doesn't use relative path to found site-packages.

2015-02-12 Thread Mark Lawrence

Mark Lawrence added the comment:

I'm not certain exactly what is being asked for here so could the originator 
please clarify their needs?  I also don't really know who "owns" this hence the 
changes to the nosy list.

--
components: +Windows
nosy: +BreamoreBoy, dstufft, 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



[issue21874] test_strptime fails on rhel/centos/fedora systems

2015-02-12 Thread Mark Lawrence

Mark Lawrence added the comment:

Have there been any recent reports of this test failing on these platforms?

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.2

___
Python tracker 

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



[issue23297] ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string

2015-02-12 Thread Pod

Pod added the comment:

Not the OP, but I find this message a bug because it's confusing from the 
perspective of a user of the tokenize() function. If you give tokenize a 
readlines() that returns a str, you get this error message that confusingly 
states that something inside tokenize must be a string and NOT a bytes, even 
though the user gave readlines a string, not a bytes. It looks like an internal 
bug.

Turns out it's because the contact changed from python2 to 3.

Personally, I'd been accidentally reading the python2 page for the tokenize 
library instead of python3, and had been using tokenize.generate_tokens in my 
python 3 code which accepts a io.StringIO just fine. When I realising my 
mistake and switched to the python3 version of the page I noticed 
generate_tokens is no longer supported, even though the code I had was working, 
and I noticed that the definition of tokenize had changed to match the old 
generate_tokens (along with a subtle change in the definition of the acceptable 
readlines function). 

So when I switched from tokenize.generate_tokens to tokenize.tokenize to try 
and use the library as intended, I get the same error as OP. Perhaps OP made a 
similar mistake?



To actually hit the error in question:

$ cat -n temp.py
 1  import tokenize
 2  import io
 3
 4
 5  byte_reader = io.BytesIO(b"test bytes generate_tokens")
 6  tokens = tokenize.generate_tokens(byte_reader.readline)
 7
 8  byte_reader = io.BytesIO(b"test bytes tokenize")
 9  tokens = tokenize.tokenize(byte_reader.readline)
10
11  byte_reader = io.StringIO("test string generate")
12  tokens = tokenize.generate_tokens(byte_reader.readline)
13
14  str_reader = io.StringIO("test string tokenize")
15  tokens = tokenize.tokenize(str_reader.readline)
16
17

$ python3 temp.py
Traceback (most recent call last):
  File "temp.py", line 15, in 
tokens = tokenize.tokenize(str_reader.readline)
  File "C:\work\env\python\Python34_64\Lib\tokenize.py", line 467, in 
tokenize
encoding, consumed = detect_encoding(readline)
  File "C:\work\env\python\Python34_64\Lib\tokenize.py", line 409, in 
detect_encoding
if first.startswith(BOM_UTF8):
TypeError: startswith first arg must be str or a tuple of str, not bytes

--
nosy: +Pod

___
Python tracker 

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



[issue21568] Win32 pip doesn't use relative path to found site-packages.

2015-02-12 Thread Steve Dower

Steve Dower added the comment:

Do you mean pip.exe? Does running 'python.exe -m pip install ...' work for you?

--

___
Python tracker 

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



[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

Updated patch. Thanks for the review Serhiy.

--
Added file: http://bugs.python.org/file38110/scandir-4.patch

___
Python tracker 

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



[issue15914] multiprocessing.SyncManager connection hang

2015-02-12 Thread Brett Cannon

Brett Cannon added the comment:

I'm adding Nick to see if he has anything to add since he was the one that 
worked on the change that Richard said caused the problem. But in my opinion 
this is in the same realm as importing as a side-effect of spawning a thread; 
don't do it.

--
nosy: +ncoghlan
status: open -> pending

___
Python tracker 

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



[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-02-12 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file38110/scandir-4.patch

___
Python tracker 

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



[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

(I regenerated scandir-4.patch, I had a local private changeset. I removed it.)

--
Added file: http://bugs.python.org/file38111/scandir-4.patch

___
Python tracker 

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



[issue23447] Relative imports with __all__ attribute

2015-02-12 Thread Brett Cannon

Brett Cannon added the comment:

If you put a print call after your `from . import *` call you will notice it 
never gets executed. Basically import is still in the middle of finishing 
imports when that import * is reached, including setting the module attributes 
on the package. Basically you have a circular import.

--
nosy: +brett.cannon
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue23454] plistlib and xml.parsers.expat python3 problems with strings and bytes

2015-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

All correct. plistlib.load() requires binary file object as documented [1].

[1] https://docs.python.org/3/library/plistlib.html#plistlib.load

--
nosy: +ronaldoussoren, serhiy.storchaka
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue23314] Disabling CRT asserts in debug build

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

"An environment variable is an easy way to make sure that all
subprocesses also have assert dialogs disabled. In release builds they
are always disabled, hence the _DEBUG check."

If _PyVerify_fd() must go, I would prefer to always disable CRT check.
Otherwise, os.dup() would open the CRT assertion popup,
instead of raising OSError(EBADF). I prefer to have the same behaviour
with any version of the CRT and any version of the Visual Studio.

You may add an environment variable to explicitly *enable* the check,
if you want.

Programming with Python is different than programming with C. Python
always raise an OSError(EBADF) exception. It's not like the C
language, where you have to explicitly check the result of each
function call. It's difficult to ignore OSError without notifying it.

I don't know other CRT checks. Many other checks make sense for Python too?

--

___
Python tracker 

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



[issue23450] Possible loss of data warnings building 3.5 Visual Studio Windows 8.1 64 bit

2015-02-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9e10c4255277 by Victor Stinner in branch 'default':
Issue #23450: Fix signal.set_wakeup_fd() on Windows
https://hg.python.org/cpython/rev/9e10c4255277

--
nosy: +python-dev

___
Python tracker 

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



[issue20088] locale.getlocale() fails if locale name doesn't include encoding

2015-02-12 Thread eryksun

eryksun added the comment:

For 3.5 this affects Windows as well, since the new CRT supports RFC1766 
language codes, but only without a codepage spec:

Python 3.5.0a1 (v3.5.0a1:5d4b6a57d5fd, Feb  7 2015, 18:15:14) 
[MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'en-GB')
'en-GB'

>>> locale.getlocale()
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Program Files\Python35\lib\locale.py", line 578, in getlocale
return _parse_localename(localename)
  File "C:\Program Files\Python35\lib\locale.py", line 487, in 
_parse_localename
raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: en-GB

On Vista+ (since 3.5 drops XP support) the codepage can be queried easily via 
GetLocaleInfoEx:

>>> from ctypes import *
>>> LOCALE_IDEFAULTANSICODEPAGE = 0x1004
>>> GetLocaleInfoEx = WinDLL('kernel32').GetLocaleInfoEx
>>> info = (c_wchar * 100)()
>>> GetLocaleInfoEx("en-GB", LOCALE_IDEFAULTANSICODEPAGE, info, len(info)) 
5
>>> info.value
'1252'
>>> GetLocaleInfoEx("zh-CN", LOCALE_IDEFAULTANSICODEPAGE, info, len(info))
4
>>> info.value
'936'

Note that Windows follows the RFC spec here (not POSIX), using a hyphen instead 
of an underscore. 

This is a bit of tangent, but for the Windows full language_country.codepage 
form, the X-11 based locale_alias dict is generally useless. So, contrary to 
the docs, on Windows getlocale doesn't return the language code in RFC 1766 
form. In some cases it does, but only by chance.

--
components: +Windows
nosy: +eryksun, 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



[issue21568] Win32 pip doesn't use relative path to found site-packages.

2015-02-12 Thread 勇刚 罗

勇刚 罗 added the comment:

yes python -m pip works for me
but pip.exe doesn't work
2015年2月12日 下午10:55于 "Steve Dower" 写道:

>
> Steve Dower added the comment:
>
> Do you mean pip.exe? Does running 'python.exe -m pip install ...' work for
> you?
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue23314] Disabling CRT asserts in debug build

2015-02-12 Thread Steve Dower

Steve Dower added the comment:

EBADF will still be returned; _PyVerify_fd is only there to prevent the 
assertion dialogs in debug builds. Release builds will not need _PyVerify_fd at 
all (though it's public, so it will remain, but it won't be necessary to 
protect calls into the CRT). As I said, there is a change coming in a CRT 
update that will make file calls behave more like POSIX, ie. returning EBADF 
instead of crashing.

See #4804 and #3545 for the discussions (and complaints) about turning off all 
assertion dialogs. Note that this issue only affects the dialogs in debug 
builds, and that for Python 3.5 we'll be making debug builds more widely 
available so that people can debug their extensions/hosts (see e.g. #22411).

--

___
Python tracker 

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



[issue21568] Win32 pip doesn't use relative path to found site-packages.

2015-02-12 Thread Steve Dower

Steve Dower added the comment:

In that case, this should be reported to the setuptools project, since they are 
responsible for creating the pip.exe launcher when pip is installed.

--

___
Python tracker 

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



[issue23314] Disabling CRT asserts in debug build

2015-02-12 Thread Steve Dower

Steve Dower added the comment:

To be clearer (while still respecting the confidentiality agreement I'm under), 
previously this code would (if _DEBUG) display an assertion dialog and 
(regardless of _DEBUG) terminate the process:

close(fd); // succeeds, assuming a good fd
close(fd); // crashes here

This code would not display the dialog, but would still terminate:

_CrtSetReportMode(_CRT_ASSERT, 0);
close(fd);
close(fd);

This code would not display the dialog or terminate, but depends on knowing 
implementation details of the CRT:

if (!_PyVerify_fd(fd)) return posix_error()
res = close(fd);
if (res < 0) return posix_error()
if (!_PyVerify_fd(fd)) return posix_error()
res = close(fd);
if (res < 0) return posix_error()

Soon we'll have a safe way (including in the presence of threads) to do this:

_DONT_TERMINATE_ON_INVALID_PARAMETER_ON_THIS_THREAD
res = close(fd);
if (res < 0) return posix_error()
res = close(fd); // would have terminated, but now returns EBADF
if (res < 0) return posix_error()
_ALLOW_TERMINATE_ON_INVALID_PARAMETER_ON_THIS_THREAD

In the last case, we prevent termination but can't safely suppress the _DEBUG 
dialog in the same way.

SuppressCrashHandler works for its purpose, since the OS error mode is 
inherited by child processes. The _CrtSetReportMode setting is *not* inherited, 
and so it needs to be called in every child process created by tests. Maybe 
it's possible to add the call into every test, but I'm skeptical (especially 
considering the multiprocessing tests).

--

___
Python tracker 

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



[issue10486] http.server doesn't set all CGI environment variables

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy: +demian.brecht

___
Python tracker 

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



[issue23442] http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5

2015-02-12 Thread Demian Brecht

Demian Brecht added the comment:

The attached patch fixes the name

--
keywords: +patch
Added file: http://bugs.python.org/file38112/issue23442.patch

___
Python tracker 

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



[issue9698] When reusing an handler, urllib(2)'s digest authentication fails after multiple regative replies

2015-02-12 Thread Erick Jones

Erick Jones added the comment:

This ended up biting me also.  I had a list of URLs to fetch with 
authentication.  One of the URLs was bad (returning 401 even with 
authentication), and that was causing all of the subsequent URLs to fail as 
well since the reset count wasn't getting reset.

I also don't like that the retry count is stored in the handler -- that's 
mutable global state, which wreaks havoc if I use this with Eventlet coroutines 
for concurrent page fetches.  (If I just add the authentication headers myself, 
then urllib2 works just fine under Eventlet.)

Couldn't the retry count be stored in the request object itself?

And why do we even need a retry "count"?  If it fails without authentication, 
then try it with authentication.  If it fails again, just return to the 
application.  It makes no sense to retry four more times.

--
nosy: +Erick.Jones

___
Python tracker 

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



[issue23447] Relative imports with __all__ attribute

2015-02-12 Thread Antonio Cota

Antonio Cota added the comment:

I tried the following on python 3.5.0a1:

#init.py
__all__ = ['second', 'first']
print('i\'m starting the directory')

#first.py
print('hi, i\'m the first')
from . import second

#second.py
print('hi, i\'m the second')
from . import first

>>> import a.first
i'm starting the directory
hi, i'm the first
hi, i'm the second


it just worked out perfectly, no errors.
But the case I show before still continues to get the AttributeError error.
You told me that basically it doesn't work because it is a circular import, but 
isn't python already able to manage circular import?
What I expected when running the "from . import *" statament was Python looking 
up in the __all__ attribute and import everything within it. When it had to 
import 'first' I expected Python to check in the sys.modules to see if it was 
already imported so, in this case, it could see that first.py was already 
imported and no error was raised.

--

___
Python tracker 

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



[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

Patch version 5:

- Use None value for the d_type instead of DT_UNKNOW to *prepare* support for 
platforms where the dirent structure has no d_type field. Serhiy guess that 
such platform have no DT_xxx constant neither. DirEntry doesn't DT_xxx 
constants if d_type is None

- Fix test_removed_file() and test_removed_dir() tests if d_type is unknown (I 
tested manually by forcing d_type to None)

- Use os.lstat() instead of os.stat(follow_symlinks=False) in DirEntry.inode(), 
it's a little bit faster even if it's the same syscall. The cost probably comes 
from the code parsing Python parameters, especially the keyword

--
Added file: http://bugs.python.org/file38113/scandir-5.patch

___
Python tracker 

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



[issue23447] Relative imports with __all__ attribute

2015-02-12 Thread Antonio Cota

Changes by Antonio Cota :


--
versions:  -Python 3.4

___
Python tracker 

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



[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

bench_scandir.py: dummy benchmark to compare listdir+stat vs scandir+is_dir.

os.scandir() is always slower than os.listdir() on tmpfs and ext4 partitions of 
a local hard driver.

I will try with NFS.


Results with scandir-5.patch on Fedora 21 (Linux).

--- Using /home/haypo (ext4, hard drive) ---

Test listdir+stat vs scandir+is_dir
Temporary directory: /home/haypo/tmpji8uviyl
Create 10 files+symlinks...
Create 1 directories...
# entries: 21
Benchmark...
listdir: 2187.3 ms
scandir: 1047.2 ms
listdir: 494.4 ms
scandir: 1048.1 ms
listdir: 493.0 ms
scandir: 1042.6 ms

Result:
listdir: min=493.0 ms (2.3 us per file), max=2187.3 ms (10.4 us per file)
scandir: min=1042.6 ms (5.0 us per file), max=1048.1 ms (5.0 us per file)
scandir is between 0.5x and 2.1x faster


--- Using /tmp (tmpfs, full in memory) ---

Test listdir+stat vs scandir+is_dir
Temporary directory: /tmp/tmp6_zk3mqo
Create 10 files+symlinks...
Create 1 directories...
# entries: 21
Benchmark...
listdir: 405.4 ms
scandir: 1001.3 ms
listdir: 403.3 ms
scandir: 1024.2 ms
listdir: 408.1 ms
scandir: 1013.5 ms

Remove the temporary directory...

Result:
listdir: min=403.3 ms (1.9 us per file), max=408.1 ms (1.9 us per file)
scandir: min=1001.3 ms (4.8 us per file), max=1024.2 ms (4.9 us per file)
scandir is between 0.4x and 0.4x faster

--
Added file: http://bugs.python.org/file38114/bench_scandir.py

___
Python tracker 

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



[issue9698] When reusing an handler, urllib(2)'s digest authentication fails after multiple regative replies

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy: +demian.brecht

___
Python tracker 

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



[issue23455] file iterator "deemed broken"; can resume after StopIteration

2015-02-12 Thread Andrew Dalke

New submission from Andrew Dalke:

The file iterator is "deemed broken". As I don't think it should be made 
non-broken, I suggest the documentation should be changed to point out when 
file iteration is broken. I also think the term 'broken' is a label with 
needlessly harsh connotations and should be softened.

The iterator documentation uses the term 'broken' like this (quoting here from 
https://docs.python.org/3.4/library/stdtypes.html):

  Once an iterator’s __next__() method raises StopIteration,
  it must continue to do so on subsequent calls. Implementations
  that do not obey this property are deemed broken.

(Older versions comment "This constraint was added in Python 2.3; in Python 
2.2, various iterators are broken according to this rule.")

An IOBase is supposed to support the iterator protocol (says 
https://docs.python.org/3.4/library/io.html#io.IOBase ). However, it does not, 
nor does the documentation say that it's broken in the face of a changing file 
(eg, when another process appends to a log file).

  % ./python.exe 
  Python 3.5.0a1+ (default:4883f9046b10, Feb 11 2015, 04:30:46) 
  [GCC 4.8.4] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  >>> f = open("empty")
  >>> next(f)
  Traceback (most recent call last):
File "", line 1, in 
  StopIteration
  >>>
  >>> ^Z
  Suspended
  % echo "Hello!" >> empty
  % fg
  ./python.exe

  >>> next(f)
  'Hello!\n'

This is apparently well-known behavior, as I've come across several references 
to it on various Python-related lists, including this one from Miles in 2008: 
https://mail.python.org/pipermail/python-list/2008-September/491920.html .

  Strictly speaking, file objects are broken iterators:

Fredrik Lundh in the same thread ( 
https://mail.python.org/pipermail/python-list/2008-September/521090.html ) says:

  it's a design guideline, not an absolute rule

The 7+ years of 'broken' behavior in Python suggests that /F is correct. But 
while 'broken' could be considered a meaningless label, it carries with it some 
rather negative connotations. It sounds like developers are supposed to make 
every effort to avoid broken code, when that's not something Python itself 
does. It also means that my code can be called "broken" solely because it 
assumed Python file iterators are non-broken. I am not happy when people say my 
code is broken.

It is entirely reasonable that a seek(0) would reset the state and cause 
next(it) to not continue to raise a StopIteration exception. However, errors 
can arise when using Python file objects, as an iterator, to parse a log file 
or any other files which are appended to by another process.

Here's an example of code that can break. It extracts the first and last 
elements of an iterator; more specifically, the first and last lines of a file. 
If there are no lines it returns None for both values; and if there's only one 
line then it returns the same line as both values.

  def get_first_and_last_elements(it):
first = last = next(it, None)
for last in it:
pass
return first, last

This code expects a non-broken iterator. If passed a file, and the file were 1) 
initially empty when the next() was called, and 2) appended to by the time 
Python reaches the for loop, then it's possible for first value to be None 
while last is a string.

This is unexpected, undocumented, and may lead to subtle errors.

There are work-arounds, like ensuring that the StopIteration only occurs once:

  def get_first_and_last_elements(it):
first = last = next(it, None)
if last is not None:
for last in it:
pass
return first, last

but much existing code expects non-broken iterators, such as the Python example 
implementation at 
https://docs.python.org/2/library/itertools.html#itertools.dropwhile . (I have 
a reproducible failure using it, a fork(), and a file iterator with a sleep() 
if that would prove useful.)

Another option is to have a wrapper around file object iterators to keep 
raising StopIteration, like:

   def safe_iter(it):
   yield from it

   # -or-  (line for line in file_iter)

but people need to know to do this with file iterators or other potentially 
broken iterators. The current documentation does not say when file iterators 
are broken, and I don't know which other iterators are also broken.

I realize this is a tricky issue.

I don't think it's possible now to change the file's StopIteration behavior. I 
expect that there is code which depends on the current brokenness, the ability 
to seek() and re-iterate is useful, and the idea that next() returns text if 
and only if readline() is not empty is useful and well-entrenched. Pypy has the 
same behavior as CPython so any change will take some time to propagate to the 
other implementations.

Instead, I'm fine with a documentation change in io.html . It currently says:

  IOBase (and its subclasses) support the iterator protocol,
  meaning that an IOBase object can b

[issue23455] file iterator "deemed broken"; can resume after StopIteration

2015-02-12 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



[issue23146] Incosistency in pathlib between / and \

2015-02-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Yes, this is a bug indeed. A patch would be welcome ;-)

--

___
Python tracker 

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



[issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong)

2015-02-12 Thread eryksun

eryksun added the comment:

Given super(cls, obj), cls needs to be somewhere in type(obj).__mro__. Thus the 
implementation checks PyType_IsSubtype instead of the more generic 
PyObject_IsSubclass. 

In this case int's MRO is unrelated to numbers.Number:

>>> print(*int.__mro__, sep='\n')



It gets registered as a subclass via numbers.Integral.register(int).

>>> print(*numbers.Integral._abc_registry)


issubclass calls PyObject_IsSubclass, which uses the __subclasscheck__ API. In 
this case ABCMeta.__subclasscheck__ recursively checks the registry and caches 
the result to speed up future checks.

>>> numbers.Number.__subclasscheck__(int)
True
>>> print(*numbers.Number._abc_cache)


--
nosy: +eryksun

___
Python tracker 

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



[issue21717] Exclusive mode for ZipFile and TarFile

2015-02-12 Thread Berker Peksag

Changes by Berker Peksag :


Added file: http://bugs.python.org/file38115/issue21717_tarfile_v5.diff

___
Python tracker 

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



[issue18295] Possible integer overflow in PyCode_New()

2015-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Many of these overflows can be provoked by specially constructed function, code 
object or bytecode.

Also I think following examples crash or return wrong result on 64 bit platform:

def f(*args, **kwargs): return len(args), len(kwargs)

f(*([0]*(2**32+1)))
f(**dict.fromkeys(map(hex, range(2**31+1

Here is updated patch which handles overflows in non-debug build. It prevent 
creating Python function with more than 255 default values (in any case 
compiler and interpreter don't support more than 255 arguments) and raise 
exception when function is called with too many arguments or too large *args or 
**kwargs.

--
stage:  -> patch review
type:  -> crash
Added file: http://bugs.python.org/file38116/code_ssize_t_2.patch.patch

___
Python tracker 

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



[issue23450] Possible loss of data warnings building 3.5 Visual Studio Windows 8.1 64 bit

2015-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Please ignore changes to Objects/codeobject.c, Objects/funcobject.c and 
Python/ceval.c. The patch in issue18295 is more advanced.

--

___
Python tracker 

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



[issue23146] Incosistency in pathlib between / and \

2015-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch. It also fixes tests which didn't test altsep.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file38117/pathlib_parse_parts_altsep.patch

___
Python tracker 

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



[issue23442] http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5

2015-02-12 Thread Martin Panter

Martin Panter added the comment:

Thanks. Confirming the patch fixes the problem for me, so should be comitted. I 
wonder if a test case would be good too though.

--

___
Python tracker 

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



[issue23456] asyncio: add missing @coroutine decorators

2015-02-12 Thread STINNER Victor

New submission from STINNER Victor:

coroutine_decorator.patch adds missing @coroutine decorator to coroutine 
functions and methods in the asyncio module.

I'm not sure that it's ok to add @coroutine to __iter__() methods. At least, 
test_asyncio pass.

--
components: asyncio
files: coroutine_decorator.patch
keywords: patch
messages: 235857
nosy: gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio: add missing @coroutine decorators
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file38118/coroutine_decorator.patch

___
Python tracker 

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



[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

Similar benchmark result on my laptop which has a SSD (ext4 filesystem tool, 
but I guess that the directory is small and fits into the memory).

Note: I'm not sure that the "between ...x and ...x faster" are revelant, I'm 
not sure that my computation is correct.

Test listdir+stat vs scandir+is_dir
Temporary directory: /home/haypo/prog/python/default/tmpbrn4r2tv
Create 10 files+symlinks...
Create 1 directories...
# entries: 21
Benchmark...
listdir: 1730.7 ms
scandir: 1029.4 ms
listdir: 476.8 ms
scandir: 1058.3 ms
listdir: 485.4 ms
scandir: 1041.1 ms

Remove the temporary directory...

Result:
listdir: min=476.8 ms (2.3 us per file), max=1730.7 ms (8.2 us per file)
scandir: min=1029.4 ms (4.9 us per file), max=1058.3 ms (5.0 us per file)
scandir is between 0.5x and 1.7x faster

--

___
Python tracker 

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



[issue23439] Fixed http.client.__all__ and added a test

2015-02-12 Thread Martin Panter

Martin Panter added the comment:

I don’t have a strong opinion about changing __all__ in these cases. I only 
noticed the potential problem when I went to add a new class to the module, and 
thought this was common practice. If we leave it as it is, it would be good to 
add comment in the source code explaining this decision. Also the test case 
could still be useful to catch future bugs.

The currently situation means the status constants are be missing from pydoc 
help output, and are not available when you do “from http.client import *” in 
the interactive interpreter.

HTTPMessage is a strange class indeed; see Issue 5053. But it is referenced a 
few times by the documentation, so I originally assumed it should be in __all__.

--

___
Python tracker 

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



[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

Benchmark on NFS. Client: my laptop, connected to the LAN by wifi. Server: 
desktop, connected to the LAN by PLC. For an unknown reason, the creation of 
files, symlinks and directories is very slow (more than 30 seconds while I 
reduced the number of files & directories).

Test listdir+stat vs scandir+is_dir
Temporary directory: /home/haypo/mnt/tmp5aee0eic
Create 1000 files+symlinks...
Create 1000 directories...
# entries: 3000
Benchmark...
listdir: 14478.0 ms
scandir: 732.1 ms
listdir: 9.9 ms
scandir: 14.9 ms
listdir: 7.5 ms
scandir: 12.9 ms

Remove the temporary directory...

Result:
listdir: min=7.5 ms (2.5 us per file), max=14478.0 ms (4826.0 us per file)
scandir: min=12.9 ms (4.3 us per file), max=732.1 ms (244.0 us per file)
scandir is between 0.0x and 1119.6x faster

--

___
Python tracker 

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



[issue23442] http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5

2015-02-12 Thread Berker Peksag

Berker Peksag added the comment:

I found another regression: In Python 3.4, 416 is 
REQUESTED_RANGE_NOT_SATISFIABLE, but REQUEST_RANGE_NOT_SATISFIABLE in 3.5.

--
nosy: +berker.peksag
stage:  -> patch review

___
Python tracker 

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



[issue23442] http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5

2015-02-12 Thread Berker Peksag

Berker Peksag added the comment:

Here is a test case.

==
FAIL: test_client_constants (test.test_httplib.OfflineTest) 
(constant='REQUESTED_RANGE_NOT_SATISFIABLE')
--
Traceback (most recent call last):
  File "/home/berker/projects/cpython/default/Lib/test/test_httplib.py", line 
985, in test_client_constants
self.assertTrue(hasattr(client, const))
AssertionError: False is not true

==
FAIL: test_client_constants (test.test_httplib.OfflineTest) 
(constant='REQUEST_HEADER_FIELDS_TOO_LARGE')
--
Traceback (most recent call last):
  File "/home/berker/projects/cpython/default/Lib/test/test_httplib.py", line 
985, in test_client_constants
self.assertTrue(hasattr(client, const))
AssertionError: False is not true

--
Added file: http://bugs.python.org/file38119/httpstatus_tests.diff

___
Python tracker 

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



[issue23442] http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5

2015-02-12 Thread Demian Brecht

Demian Brecht added the comment:

Thanks for the test Berker, I'll put a patch together with the changes
later this afternoon.

On 2015-02-12 2:27 PM, Berker Peksag wrote:
> 
> Berker Peksag added the comment:
> 
> Here is a test case.
> 
> ==
> FAIL: test_client_constants (test.test_httplib.OfflineTest) 
> (constant='REQUESTED_RANGE_NOT_SATISFIABLE')
> --
> Traceback (most recent call last):
>   File "/home/berker/projects/cpython/default/Lib/test/test_httplib.py", line 
> 985, in test_client_constants
> self.assertTrue(hasattr(client, const))
> AssertionError: False is not true
> 
> ==
> FAIL: test_client_constants (test.test_httplib.OfflineTest) 
> (constant='REQUEST_HEADER_FIELDS_TOO_LARGE')
> --
> Traceback (most recent call last):
>   File "/home/berker/projects/cpython/default/Lib/test/test_httplib.py", line 
> 985, in test_client_constants
> self.assertTrue(hasattr(client, const))
> AssertionError: False is not true
> 
> --
> Added file: http://bugs.python.org/file38119/httpstatus_tests.diff
> 
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue19433] Define PY_UINT64_T on Windows 32bit

2015-02-12 Thread Mark Lawrence

Mark Lawrence added the comment:

Is there any more work needed on this or can it be closed?  Please note the 
reference to #17884 in msg201654.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-02-12 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file38120/bench_scandir2.py

___
Python tracker 

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



[issue19433] Define PY_UINT64_T on Windows 32bit

2015-02-12 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy:  -brian.curtin

___
Python tracker 

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



[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

I enhanced bench_scandir2.py to have one command to create a directory or a 
different command to run the benchmark.

All commands:
- create: create the directory for tests (you don't need this command, you can 
also use an existing directory)
- bench: compare scandir+is_dir to listdir+stat, cached
- bench_nocache: compare scandir+is_dir to listdir+stat, flush disk caches
- bench_nostat: compare scandir to listdir, cached
- bench_nostat_nocache: compare scandir to listdir, flush disk caches

--

New patch version 6 written for performances, changes:

- On POSIX, decode the filename in C
- _scandir() iterator now yields list of items, instead of an single item

With my benchmarks, I see that yielding 10 items reduces the overhead of 
scandir on Linux (creating DirEntry objects). On Windows, the number of items 
has no effect. I prefer to also fetch entries 10 per 10 to mimic POSIX. Later, 
on POSIX, we may use directly getdents() and yield the full getdents() result 
at once. according to strace, it's currently around 800 entries per getdents() 
syscall.


Results of bench_scandir2.py on my laptop using SSD and ext4 filesystem:

- 110,100 entries (100,000 files, 100 symlinks, 10,000 directories)
- bench: 1.3x faster (scandir: 164.9 ms, listdir: 216.3 ms)
- bench_nostat: 0.4x faster (scandir: 104.0 ms, listdir: 38.5 ms)
- bench_nocache: 2.1x faster (scandir: 460.2 ms, listdir: 983.2 ms)
- bench_nostat_nocache: 2.2x faster (scandir: 480.4 ms, listdir: 1055.6 ms)

Results of bench_scandir2.py on my laptop using NFS share (server: ext4 
filesystem) and slow wifi:

- 11,100 entries (1, files, 100 symlinks, 1000 directories)
- bench: 1.3x faster (scandir: 22.5 ms, listdir: 28.9 ms)
- bench_nostat: 0.2x faster (scandir: 14.3 ms, listdir: 3.2 ms)

*** Timings with NFS are not reliable. Sometimes, a directory listing takes 
more than 30 seconds, but then it takes less than 100 ms. ***

Results of bench_scandir2.py on a Windows 7 VM using NTFS:

- 11,100 entries (10,000 files, 1,000 directories, 100 symlinks)
- bench: 9.9x faster (scandir: 58.3 ms, listdir: 578.5 ms)
- bench_nostat: 0.3x faster (scandir: 28.5 ms, listdir: 7.6 ms)

Results of bench_scandir2.py on my desktop PC using tmpfs (/tmp):

- 110,100 entries (100,000 files, 100 symlinks, 10,000 directories)
- bench: 1.3x faster (scandir: 149.2 ms, listdir: 189.2 ms)
- bench_nostat: 0.3x faster (scandir: 91.9 ms, listdir: 27.1 ms)

Results of bench_scandir2.py on my desktop PC using HDD and ext4:

- 110,100 entries (10 files, 100 symlinks, 1 directories)
- bench: 1.4x faster (scandir: 168.5 ms, listdir: 238.9 ms)
- bench_nostat: 0.4x faster (scandir: 107.5 ms, listdir: 41.9 ms)

--
Added file: http://bugs.python.org/file38121/scandir-6.patch

___
Python tracker 

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



[issue23442] http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5

2015-02-12 Thread Demian Brecht

Demian Brecht added the comment:

I've attached a patch with fixes for both cases and the tests added by
Berker. Thanks guys.

--
Added file: http://bugs.python.org/file38122/issue23442_1.patch

___
Python tracker 

___diff -r e548ab4ce71d Lib/http/__init__.py
--- a/Lib/http/__init__.py  Mon Feb 09 19:49:00 2015 +
+++ b/Lib/http/__init__.py  Thu Feb 12 16:48:03 2015 -0800
@@ -93,7 +93,7 @@
 'URI is too long')
 UNSUPPORTED_MEDIA_TYPE = (415, 'Unsupported Media Type',
 'Entity body in unsupported format')
-REQUEST_RANGE_NOT_SATISFIABLE = (416,
+REQUESTED_RANGE_NOT_SATISFIABLE = (416,
 'Request Range Not Satisfiable',
 'Cannot satisfy request range')
 EXPECTATION_FAILED = (417, 'Expectation Failed',
@@ -107,7 +107,7 @@
 TOO_MANY_REQUESTS = (429, 'Too Many Requests',
 'The user has sent too many requests in '
 'a given amount of time ("rate limiting")')
-REQUEST_HEADER_FIELD_TOO_LARGE = (431,
+REQUEST_HEADER_FIELDS_TOO_LARGE = (431,
 'Request Header Field Too Large',
 'The server is unwilling to process the request because its header '
 'fields are too large')
diff -r e548ab4ce71d Lib/test/test_httplib.py
--- a/Lib/test/test_httplib.py  Mon Feb 09 19:49:00 2015 +
+++ b/Lib/test/test_httplib.py  Thu Feb 12 16:48:03 2015 -0800
@@ -924,6 +924,66 @@
 def test_responses(self):
 self.assertEqual(client.responses[client.NOT_FOUND], "Not Found")
 
+def test_client_constants(self):
+expected = [
+'CONTINUE',
+'SWITCHING_PROTOCOLS',
+'PROCESSING',
+'OK',
+'CREATED',
+'ACCEPTED',
+'NON_AUTHORITATIVE_INFORMATION',
+'NO_CONTENT',
+'RESET_CONTENT',
+'PARTIAL_CONTENT',
+'MULTI_STATUS',
+'IM_USED',
+'MULTIPLE_CHOICES',
+'MOVED_PERMANENTLY',
+'FOUND',
+'SEE_OTHER',
+'NOT_MODIFIED',
+'USE_PROXY',
+'TEMPORARY_REDIRECT',
+'BAD_REQUEST',
+'UNAUTHORIZED',
+'PAYMENT_REQUIRED',
+'FORBIDDEN',
+'NOT_FOUND',
+'METHOD_NOT_ALLOWED',
+'NOT_ACCEPTABLE',
+'PROXY_AUTHENTICATION_REQUIRED',
+'REQUEST_TIMEOUT',
+'CONFLICT',
+'GONE',
+'LENGTH_REQUIRED',
+'PRECONDITION_FAILED',
+'REQUEST_ENTITY_TOO_LARGE',
+'REQUEST_URI_TOO_LONG',
+'UNSUPPORTED_MEDIA_TYPE',
+'REQUESTED_RANGE_NOT_SATISFIABLE',
+'EXPECTATION_FAILED',
+'UNPROCESSABLE_ENTITY',
+'LOCKED',
+'FAILED_DEPENDENCY',
+'UPGRADE_REQUIRED',
+'PRECONDITION_REQUIRED',
+'TOO_MANY_REQUESTS',
+'REQUEST_HEADER_FIELDS_TOO_LARGE',
+'INTERNAL_SERVER_ERROR',
+'NOT_IMPLEMENTED',
+'BAD_GATEWAY',
+'SERVICE_UNAVAILABLE',
+'GATEWAY_TIMEOUT',
+'HTTP_VERSION_NOT_SUPPORTED',
+'INSUFFICIENT_STORAGE',
+'NOT_EXTENDED',
+'NETWORK_AUTHENTICATION_REQUIRED',
+]
+for const in expected:
+with self.subTest(constant=const):
+self.assertTrue(hasattr(client, const))
+
 
 class SourceAddressTest(TestCase):
 def setUp(self):
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23447] Relative imports with __all__ attribute

2015-02-12 Thread Steven Barker

Steven Barker added the comment:

This issue is a special case of the problem discussed in issue 992389, that 
modules within packages are not added to the package dictionary until they are 
fully loaded, which breaks circular imports in the form "from package import 
module".

The consensus on that issue is that it doesn't need to be fixed completely, 
given the partial fix from issue 17636. I think the current issue is a corner 
case that was not covered by the fix, but which probably should be fixed as 
well, for consistency. The fix so far has made imports that name the module 
work, even though the module objects are still not placed into the package's 
namespace yet (this is why Antonio's last example works in the newly released 
3.5a1, though not in previous versions). Wildcard imports however still fail.

Can the fix be expanded to cover wildcard imports as well? I know, we're 
heaping up two kinds of usually-bad code (wildcard imports and circular 
imports) on top of one another, but still, the failure is very unexpected to 
anyone who's not read the bug reports.

I don't know my way around the import system at all yet, so I'm not going to be 
capable of writing up a patch immediately, but if there's any interest at all, 
and nobody more knowledgeable gets to it first I might see what I can learn and 
try to put together something.

Here's a more concise example of the issue:


package/__init__.py:

__all__ = ["module"]


package/module.py:

from . import module # this works in 3.5a1, thanks to the fix from issue 
17636
from . import *  # this still fails

--
nosy: +Steven.Barker

___
Python tracker 

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



[issue23439] Fixed http.client.__all__ and added a test

2015-02-12 Thread Demian Brecht

Demian Brecht added the comment:

> If we leave it as it is, it would be good to add comment in the source code 
> explaining this decision.
I think that __all__ should be left as-is for the time being. Adding
some comments around that decision makes sense to me to avoid any future
confusion around that.

> Also the test case could still be useful to catch future bugs.
Agreed. I've added a couple minor comments to the review.

Thanks for the work on this!

--

___
Python tracker 

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



[issue17986] Alternative async subprocesses (pep 3145)

2015-02-12 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue22147] PosixPath() constructor should not accept strings with embedded NUL bytes

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue12455] urllib2 forces title() on header names, breaking some requests

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue17908] Unittest runner needs an option to call gc.collect() after each test

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue5053] http.client.HTTPMessage.getallmatchingheaders() always returns []

2015-02-12 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



[issue12849] Cannot override 'connection: close' in urllib2 headers

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue8843] urllib2 Digest Authorization uri must match request URI

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue14301] xmlrpc client transport and threading problem

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue22946] urllib gives incorrect url after open when using HTTPS

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue21557] os.popen & os.system lack shell-related security warnings

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue22197] Allow better verbosity / output control in test cases

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue14044] IncompleteRead error with urllib2 or urllib.request -- fine with urllib, wget, or curl

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue14414] xmlrpclib leaves connection in broken state if server returns error without content-length

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue23043] doctest ignores "from __future__ import print_function"

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue23004] mock_open() should allow reading binary data

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue17986] Alternative async subprocesses (pep 3145)

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

As Tulip and subprocdev, starting such project outside the Python stdlib may 
help to get feedback, find and fix bugs faster. What do you think?

--

___
Python tracker 

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



[issue23448] urllib2 needs to remove scope from IPv6 address when creating Host header

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue23166] urllib2 ignores opener configuration under certain circumstances

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue9698] When reusing an handler, urllib(2)'s digest authentication fails after multiple regative replies

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy:  -demian.brecht

___
Python tracker 

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



[issue17986] Alternative async subprocesses (pep 3145)

2015-02-12 Thread STINNER Victor

STINNER Victor added the comment:

Subprocess support of asyncio has nice features and is efficient:

- async read from stdout and stderr
- async write into stdin
- async wait for the process exit
- async communicate()
- timeout on any async operation
- support running multiple child processes in parallel
- epoll, kqueue, devpoll or IOCP selector
- On POSIX, fast child watcher waiting for SIGCHLD signal

If possible, I would prefer to not write a second "async subprocess".

It's possible to write a blocking API on top of asyncio using 
loop.run_until_complete().

sync_proc_asyncio.py: incomplete proof-of-concept (no working select() method).

--
Added file: http://bugs.python.org/file38123/sync_proc_asyncio.py

___
Python tracker 

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



[issue23457] make test failures

2015-02-12 Thread Dwight

New submission from Dwight:

Hi,
  Looking for assistance in figuring out what caused the following
test failures and how to fix the problems.
  Built and run on an IBM pSeries system running AIX 7.1.
  Appreciate any help I can get.
  I am not a software developer.
  I am compiling this because I need this to build
things I need to build firefox.
  Would really appreciate some help!
  (Mozilla.org and IBM not interested in providing
   a working browser for my system.)
Bye,
Dwight

***Failed Test the were run in verbose mode
test_locale failed
test_io failed
test_ssl failed
test_faulthandler
test_httpservers
test_socket failed
test_fileio failed
test_distutils failed
test_asyncio failed
test_mmap failed
test_resource failed
test_posix failed

--
components: Tests
files: PYTHONFailedTest.log
messages: 235871
nosy: dcrs6...@gmail.com
priority: normal
severity: normal
status: open
title: make test failures
versions: Python 3.4
Added file: http://bugs.python.org/file38124/PYTHONFailedTest.log

___
Python tracker 

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



[issue17911] traceback: add a new thin class storing a traceback without storing local variables

2015-02-12 Thread Robert Collins

Robert Collins added the comment:

@Mahmoud thanks! I had a quick look and the structural approach we've taken is 
a bit different. What do you think of the current patch here 
(issue17911-4.patch) ?

--

___
Python tracker 

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



[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-02-12 Thread Ben Hoyt

Ben Hoyt added the comment:

Hi Victor, I thank you for your efforts here, especially your addition of 
DirEntry.inode() and your work on the tests.

However, I'm a bit frustrated that you just re-implemented the whole thing 
without discussion: I've been behind scandir and written the first couple of 
implementations, and I asked if you could review my code, but instead of 
reviewing it or interacting with my fairly clear desire for the all-C version, 
you simply turn up and say "I've rewritten it, can you please review?"

You did express concern off list about an all-C vs part-Python implementation, 
but you said "it's still unclear to me which implementation should be added to 
Python" and "I don't feel able today to take the right decision. We may use 
python-dev to discuss that". But I didn't see that discussion at all, and I had 
expressed fairly clearly (both here and off list), with benchmarks, why I 
thought it should be the all-C version.

So it was a bit of a let down for a first-time Python contributor. Even a 
simple question would have been helpful here: "Ben, I really think this much C 
code for a first version is bug-prone; what do you think about me 
re-implementing it and comparing?"

TLDR: I'd like to see os.scandir() in Python even if it means the slower 
implementation, but some discussion would have been nice. :-)

So if it's not too late, I'll continue that discussion in my next message.

--

___
Python tracker 

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



  1   2   >