[issue25925] Coverage support for CPython 2

2015-12-22 Thread Zachary Ware

Zachary Ware added the comment:

Left a couple of review comments on Rietveld.

--
nosy: +zach.ware
stage:  -> patch review

___
Python tracker 

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



[issue25925] Coverage support for CPython 2

2015-12-22 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

Thank you for the reviews. I've added a new patch (v02) to correct the issues.

--
Added file: http://bugs.python.org/file41386/coverage-2.7-v02.patch

___
Python tracker 

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



[issue4709] Mingw-w64 and python on windows x64

2015-12-22 Thread Nathaniel Smith

Nathaniel Smith added the comment:

> We are working on the Fortran issue in a few different ways, one of which is 
> your work on MinGW compatibility so that gfortran can be used. But that isn't 
> the only solution to this whole problem, and it's not even preferable for a 
> lot of Python users, so expect other proposals to come out.

Hey Steve, I'm a bit surprised to be hearing this now given all our off-list 
discussions about these issues this year. Can you clarify what you're talking 
about here? Who is "we", what other solutions do you see, and why would they be 
preferable? (If the compatibility issues are solved, then AFAIK gfortran is 
basically perfect for 99% of uses; the only alternatives are proprietary 
compilers with much nastier -- F/OSS-incompatible -- license terms. Note that 
by contrast gfortran itself is GPLed, but with a specific exemption added to 
clarify that it is totally okay to use for compiling proprietary code.)

--

___
Python tracker 

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



[issue25599] asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock

2015-12-22 Thread Guido van Rossum

Guido van Rossum added the comment:

No I just misremembered.

--Guido (mobile)

--

___
Python tracker 

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



[issue25599] asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock

2015-12-22 Thread Yury Selivanov

Yury Selivanov added the comment:

> Now we missed the 3.5.2 deadline.

Did you mean 3.5.1?  Or Larry is going to rush 3.5.2 soon?

--

___
Python tracker 

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



[issue8604] Adding an atomic FS write API

2015-12-22 Thread Марк Коренберг

Марк Коренберг added the comment:

instead of realpath, os.lstat() may be used in order to detect if target file 
object is not plain file. Also, os.rename() cannot be used since it follows 
symlinks by default.

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-22 Thread Alessandro Cucci

Alessandro Cucci added the comment:

Thanks SilentGhost!

--
Added file: http://bugs.python.org/file41391/issue19475_v9.patch

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-22 Thread Alessandro Cucci

Alessandro Cucci added the comment:

Sorry @SilentGhost, I didn't seen your comment at the bottom of the review. 
With this patch is microsecond is 0, the time will display 6 zeroes.

--
Added file: http://bugs.python.org/file41388/issue19475_v8.patch

___
Python tracker 

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



[issue25919] htp.client PUT method ignores error responses sent immediatly after headers

2015-12-22 Thread Wiktor Niesiobedzki

Wiktor Niesiobedzki added the comment:

Maybe something like this? Doesn't look too complicated and I haven't noticed 
any breakage yet.

--
keywords: +patch
Added file: http://bugs.python.org/file41390/http.client.put.fix.patch

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-22 Thread Alessandro Cucci

Changes by Alessandro Cucci :


Added file: http://bugs.python.org/file41387/issue19475_v7.patch

___
Python tracker 

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



[issue8604] Adding an atomic FS write API

2015-12-22 Thread Марк Коренберг

Марк Коренберг added the comment:

Also, modern kernels allows to replace entire directory!

renameat2() + RENAME_EXCHANGE

So, there should be more atomic operations

--

___
Python tracker 

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



[issue21579] Python 3.4: tempfile.close attribute does not work

2015-12-22 Thread Марк Коренберг

Марк Коренберг added the comment:

David Murray, in your code, if temporary file cannot be created, it attempts to 
unlink unknown name :).

But, I already have almost the same solution in production. I mention it 
sources in issue8604.

--

___
Python tracker 

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



[issue11588] Add "necessarily inclusive" groups to argparse

2015-12-22 Thread Chris Mayo

Changes by Chris Mayo :


--
nosy: +cjmayo

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-22 Thread SilentGhost

SilentGhost added the comment:

I think the patch is nearly finalised, but I'd appreciate if someone else would 
carefully go over the new C code. After that, I think, the patch could be 
committed.

--

___
Python tracker 

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



[issue4709] Mingw-w64 and python on windows x64

2015-12-22 Thread Steve Dower

Steve Dower added the comment:

"We" is a lot of different companies and individuals. Anyone distributing 
prebuilt binaries is helping here, a few people are working on the licensing 
concerns for some components, other people are working on C BLAS libraries.

I see the issue approximately as "it's hard to install the scipy stack", which 
is broader than "Windows does not have a Free Fortran compiler" and allows for 
more solutions (apologies for putting words in your mouth, which is not my 
intent, though I have certainly seen a fixation on this one particular solution 
to the exclusion of other possibilities).

--

___
Python tracker 

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



[issue24840] implement bool conversion for enums to prevent odd edge case

2015-12-22 Thread Gregory P. Smith

Gregory P. Smith added the comment:

This change breaks existing code that is relying on the behavior of the enum 
API as shipped in 3.4 and 3.5.  Please do NOT do this.

Worse, you've landed this change in a "stable" release of the enum34 "backport" 
module (1.1.1) despite it never having been released as a stable Python API.  
Please do not let *the backport* get ahead of the latest stable released Python 
API.

https://bitbucket.org/stoneleaf/enum34/issues/10/versions-of-enum34-111-break-support-for

--
nosy: +gregory.p.smith
resolution: fixed -> 
status: closed -> open
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



[issue21815] imaplib truncates some untagged responses

2015-12-22 Thread Lita Cho

Lita Cho added the comment:

Sounds good.

On Tuesday, December 22, 2015, Maciej Szulik  wrote:

>
> Maciej Szulik added the comment:
>
> Lita can you please apply the changes from latest review (from
> SilentGhost). Especially the one regarding newline, which currently fails
> to apply this patch on default. If all those will be cleaned I'll recommend
> this patch for David for inclusion.
>
> --
>
> ___
> Python tracker >
> 
> ___
>

--

___
Python tracker 

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



[issue25930] os.unlink != os.remove in python3.5

2015-12-22 Thread Anthony Sottile

Anthony Sottile added the comment:

Breaks this function:

```
def rmtree(path):
"""On windows, rmtree fails for readonly dirs."""
def handle_remove_readonly(func, path, exc):  # pragma: no cover (windows)
excvalue = exc[1]
if func in (os.rmdir, os.remove) and excvalue.errno == errno.EACCES:
os.chmod(path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
func(path)
else:
raise
shutil.rmtree(path, ignore_errors=False, onerror=handle_remove_readonly)
```

--

___
Python tracker 

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



[issue25251] Unknown MS Compiler version 1900

2015-12-22 Thread Tod Haren

Tod Haren added the comment:

In addition to patching cygwincompiler.py I also had to patch 
numpy\distutils\misc_util.py and numpy\distutils\mingw32ccompiler.py to handle 
the new dll name.

A pull request has been submitted for the numpy patches. 
https://github.com/numpy/numpy/pull/6875

--
nosy: +Tod Haren

___
Python tracker 

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



[issue25930] Document that os.remove is semantically identical to os.unlink

2015-12-22 Thread Brett Cannon

Brett Cannon added the comment:

I think it's reasonable to say the documentation could be misconstrued -- as 
Anthony has shown -- and so a patch changing the os.remove docs to say "This 
function is semantically identical to os.unlink()" would be acceptable.

--
assignee:  -> docs@python
components: +Documentation -Argument Clinic, Library (Lib)
nosy: +brett.cannon, docs@python
resolution: not a bug -> 
status: closed -> open
title: os.unlink != os.remove in python3.5 -> Document that os.remove is 
semantically identical to os.unlink

___
Python tracker 

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



[issue25929] When doing string.replace, it uses the entire 'find' string and doesn't let it get reused...

2015-12-22 Thread R. David Murray

R. David Murray added the comment:

No, you aren't missing anything, it is working as designed.

--
nosy: +r.david.murray
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25770] expose name, args, and kwargs from methodcaller

2015-12-22 Thread Joe Jevnik

Joe Jevnik added the comment:

Is there a decision on the name? I can update the patch if needed.

--

___
Python tracker 

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



[issue24379] operator.subscript

2015-12-22 Thread Joe Jevnik

Joe Jevnik added the comment:

> and the latter might give the impression it was some sort of special 
> method/attribute when it was not.

Wouldn't adding this be special because it is specifically reserved by CPython 
as an implementation detail?

Also, would adding this name (__stub or __stub__) be sufficient to get this 
patch merged again. I would not mind investigating the gc_head issue after but 
I view that as a separate issue which is only exercised by this patch.

--

___
Python tracker 

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



[issue25930] os.unlink != os.remove in python3.5

2015-12-22 Thread Larry Hastings

Larry Hastings added the comment:

Unless you can explain what bugs this is causing, I don't see any need to 
change the behavior.

--
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



[issue25930] os.unlink != os.remove in python3.5

2015-12-22 Thread Anthony Sottile

Anthony Sottile added the comment:

When calling shutil.rmtree on windows on a readonly directory, the error 
handler is called with os.unlink as the first argument `func` which fails the 
check `func in (os.rmdir, os.remove)` which succeeded on previous python 
versions

--

___
Python tracker 

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



[issue15068] fileinput requires two EOF when reading stdin

2015-12-22 Thread Benjamin Peterson

Benjamin Peterson added the comment:

That individually is probably okay. It's more a question of whether the
entire change is appropriate for 2.7.

Note PendingDeprecationWarning is fairly useless, since it's rarely
enabled.

On Sat, Dec 19, 2015, at 00:34, Serhiy Storchaka wrote:
> 
> Serhiy Storchaka added the comment:
> 
> Benjamin, is it good to add PendingDeprecationWarning in 2.7?
> 
> --
> nosy: +benjamin.peterson
> versions:  -Python 3.4
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue21998] asyncio: support fork

2015-12-22 Thread Adam Bishop

Adam Bishop added the comment:

A note about this issue should really be added to the documentation - on OS X, 
it fails with the rather non-sensical "OSError: [Errno 9] Bad file descriptor", 
making this very hard to debug.

I don't have any specific requirement for fork support in asyncio as it's 
trivial to move loop creation after the fork, but having to run the interpreter 
through GDB to diagnose the problem is not a good state of affairs.

--
nosy: +Adam.Bishop

___
Python tracker 

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



[issue25930] os.unlink != os.remove in python3.5

2015-12-22 Thread Larry Hastings

Larry Hastings added the comment:

How does it break?  Maybe you could explain more.

--

___
Python tracker 

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



[issue25931] os.fork() command distributed in windows Python27 (in SocketServer module)

2015-12-22 Thread Sam Lobel

New submission from Sam Lobel:

I ran into this bug while using multiprocessing in Flask, which deep down uses 
the SocketServer.py module.

There's a call to os.fork() in the windows version , which obviously doesn't 
work. So SocketServer.py can't be used on windows.

Maybe replace it with something from the multiprocessing module?

--
components: Windows
messages: 256896
nosy: Sam Lobel, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: os.fork() command distributed in windows Python27 (in SocketServer 
module)
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue24379] Add operator.subscript as a convenience for creating slices

2015-12-22 Thread Emanuel Barry

Changes by Emanuel Barry :


--
nosy: +ebarry
stage: resolved -> patch review
title: operator.subscript -> Add operator.subscript as a convenience for 
creating slices

___
Python tracker 

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



[issue4709] Mingw-w64 and python on windows x64

2015-12-22 Thread Nathaniel Smith

Nathaniel Smith added the comment:

Hi Steve- okay, thanks for clarifying! I think you already know this, but for 
the general record: the reason for the apparent fixation on this solution is 
that after a lot of struggle it's emerged as basically the only contender for 
scipy-development-on-windows; there are a number of problems (fortran, BLAS, 
C99, python 2.7 support, desire to distribute F/OSS software) and it's the only 
thing that solves all of them. The details that lead to this conclusion are 
rather complicated, but here's how I understand the situation as of the end of 
2015:

- If you just want to compile C/C++ (don't need fortran or BLAS), and you can 
either [live with MSVC 2008's somewhat archaic understanding of C] or [drop 2.7 
support and only support 3.5], then we're actually in a pretty good place now: 
you can install the msvc-for-2.7 distribution for 2.7, install msvc 2015 for 
3.5, and you're good to go.

- Alternatively if you don't care about your code being F/OSS and have money to 
spare, then you can solve all of the above problems by using icc/ifort for your 
compiler and MKL for your BLAS. (The "F/OSS" caveat here is because you 
actually cannot distribute binaries using this toolchain as F/OSS.)

- If you're a F/OSS project and you need BLAS, then your options are either 
OpenBLAS or (hopefully soon) BLIS. Neither of them can be compiled with any 
version of MSVC, because both of them use asm extensions/dialects that MSVC 
doesn't understand. The good news is that soon probably you will be able to 
compile them with clang! However, I think clang only targets compatibility with 
recent MSVC, not MSVC 2008, so this is useless for python 2.7? I could be wrong 
here.

(Well, you can also try crossing your fingers and try mixing runtimes -- the 
BLAS interface specifically is narrow enough that you might be able to get away 
with it. I'm not sure how many projects can get away with just BLAS and no 
LAPACK, though, and LAPACK is Fortran; I've heard rumors of LAPACK-in-C, but 
AFAICT they're still just rumors...)

- If you're a free software project who needs [C99 on Python 2.7] or [BLAS on 
2.7] or [Fortran, period], then none of the above options help, or show any 
prospect of helping (except maybe if clang can target MSVC 2008 compatibility). 
OTOH the mingw-w64-with-improved-MSVC-compatibility approach fixes all of these 
problems at once, thus eliminating the whole decision tree above in one swoop.

It is true that it doesn't help with the "GPL cooties" problem; AFAIK that's 
the only limitation. Of course any company has the right to decide that they 
absolutely will not use a GPL-licensed compiler, for any reason they might feel 
like. But if they want random volunteers at python.org to care about this then 
it seems to me that those companies need to *either* articulate some convincing 
reason why their needs are legitimate (gcc seems to work just fine for tons and 
tons of companies, including e.g. the entire linux and android ecosystems), 
*or* start paying those volunteers to care :-). And even if we do care, then 
I'm not sure what there is to be done about it anyway -- if you want to go buy 
a license to icc/ifort then you can do that today, have fun, it seems to work 
great?

--

___
Python tracker 

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



[issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.*

2015-12-22 Thread Марк Коренберг

New submission from Марк Коренберг:

dir_fd support is good in `os` module. but tempfile module lack support of that 
great feature. Please add.

--
messages: 256856
nosy: mmarkk
priority: normal
severity: normal
status: open
title: add dir_fd for mkstemp, and also maybe to all tempfile.*
versions: 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



[issue25860] os.fwalk() silently skips remaining directories when error occurs

2015-12-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 767262c149ca by Serhiy Storchaka in branch '3.5':
Issue #25860: os.fwalk() no longer skips remaining directories when error 
occurs.
https://hg.python.org/cpython/rev/767262c149ca

New changeset a85675dabb8f by Serhiy Storchaka in branch 'default':
Issue #25860: os.fwalk() no longer skips remaining directories when error 
occurs.
https://hg.python.org/cpython/rev/a85675dabb8f

--
nosy: +python-dev

___
Python tracker 

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



[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-22 Thread John Walker

John Walker added the comment:

Heres the output of running the benchmark on my machine:

Testing proposed implementation
number = 1
0.07098613299967838
number = 10
0.6952260910002224
number = 100
6.948197601999709
Testing current implementation
number = 1
0.141816276996
number = 10
1.350394603001405
number = 100
13.625065807000283

--

___
Python tracker 

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



[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-22 Thread John Walker

Changes by John Walker :


--
type:  -> performance

___
Python tracker 

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



[issue25929] When doing string.replace, it uses the entire 'find' string and doesn't let it get reused...

2015-12-22 Thread Mark Cline

New submission from Mark Cline:

The Title might be a bit awkward but this is what I mean:

before = ''
after = before.replace(',,', ',null,')
print(after)
>,null,,null,

I suspect it is starting the second search at the start of the first find + 
length of the find? ie:

0123
Starting the next search at spot 2 (the 3rd ,).

This might be expected behaviour as it is looking at the rest of the string 
after finding the match, as opposed to taking the updated string:
,null,,, after the first replace. (Actually, writing that out it does make 
sense that it would behave like this, but thought I would mention just in case 
I am missing something). 

[Its easy enough to work around it, but just thought I would mention it :D]

--
components: Library (Lib)
messages: 256877
nosy: Mark Cline
priority: normal
severity: normal
status: open
title: When doing string.replace, it uses the entire 'find' string and doesn't 
let it get reused...
type: behavior
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



[issue21815] imaplib truncates some untagged responses

2015-12-22 Thread Maciej Szulik

Maciej Szulik added the comment:

Lita can you please apply the changes from latest review (from SilentGhost). 
Especially the one regarding newline, which currently fails to apply this patch 
on default. If all those will be cleaned I'll recommend this patch for David 
for inclusion.

--

___
Python tracker 

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



[issue12797] io.FileIO and io.open should support openat

2015-12-22 Thread Eryk Sun

Eryk Sun added the comment:

Марк, os.open added dir_fd support in 3.3, which is implemented on POSIX 
systems by calling openat. The dir_fd parameter is available for many os 
functions. This is discussed in section 1.5, Files and Directories [1].

It would be nice if we could support dir_fd on Windows as well, but we'd have 
to bypass the CRT and Windows API to use the native NT API instead, such as 
NtCreateFile [2]. The kernel has supported opening a file relative to a 
directory handle since it was release in 1993 (NT 3.1). All named kernel 
objects are referenced using an OBJECT_ATTRIBUTES [3] data structure. 
ObjectName -- a path with up to 32768 UTF-16 characters -- is relative to the 
RootDirectory handle if non-NULL. This is how paths relative to the process 
working directory are implemented, but changing the working directory isn't 
thread safe. 

[1]: https://docs.python.org/3/library/os.html#files-and-directories
[2]: https://msdn.microsoft.com/en-us/library/ff566424
[3]: https://msdn.microsoft.com/en-us/library/ff557749

--
nosy: +eryksun

___
Python tracker 

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



[issue25860] os.fwalk() silently skips remaining directories when error occurs

2015-12-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7995a81236b6 by Serhiy Storchaka in branch '3.5':
Issue #25860: Fixed test failure caused by inconsistency of os.walk() and
https://hg.python.org/cpython/rev/7995a81236b6

New changeset dcf9e9ae5393 by Serhiy Storchaka in branch 'default':
Issue #25860: Fixed test failure caused by inconsistency of os.walk() and
https://hg.python.org/cpython/rev/dcf9e9ae5393

--

___
Python tracker 

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



[issue25919] htp.client PUT method ignores error responses sent immediatly after headers

2015-12-22 Thread Wiktor Niesiobedzki

Wiktor Niesiobedzki added the comment:

Here is revised patch. Also covers changes to tests.

--
Added file: http://bugs.python.org/file41392/http.client.put.fix.patch

___
Python tracker 

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



[issue24840] implement bool conversion for enums to prevent odd edge case

2015-12-22 Thread Ethan Furman

Ethan Furman added the comment:

The enum34 backport has been fixed to not have 3.6 only features (assuming the 
__bool__ change was the only one).

Was that your only objection, or do you not want this change in 3.6 either?

--

___
Python tracker 

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



[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-22 Thread John Walker

New submission from John Walker:

In statistics, there is a FIXME on Line 250 above _decimal_to_ratio that says:

# FIXME This is faster than Fraction.from_decimal, but still too slow.

Half of the time is spent in a conversion in d.as_tuple(). Decimal internally 
stores the digits as a string, but in d.as_tuple(), the digits are individually 
cast to integers and returned as a tuple of integers.

This is OK, but _decimal_to_ratio undoes the work that was done in d.as_tuple() 
by adding them all back into an integer. A similar, but slightly different 
approach is taken in Fractions.from_decimal, where the tuple is cast into a 
string and then parsed into an integer. We can be a lot faster if we use the 
_int instance variable directly.

In the case of _decimal_to_ratio, the new code seems to be twice as fast with 
usage _decimal_to_ratio(Decimal(str(random.random(:


def _decimal_to_ratio(d):
sign, exp = d._sign, d._exp
if exp in ('F', 'n', 'N'):  # INF, NAN, sNAN
assert not d.is_finite()
return (d, None)
num = int(d._int)
if exp < 0:
den = 10**-exp
else:
num *= 10**exp
den = 1
if sign:
num = -num
return (num, den)

If the performance improvement is considered worthwhile, here are a few 
solutions I see.

1) Use _int directly in fractions and statistics.

2) Add a digits_as_str method to Decimal. This prevents exposing _int as an 
implementation detail, and makes sense to me since I suspect there is a lot of 
code casting the tuple of int to a string anyway. 

3) Add a parameter to as_tuple for determining whether digits should be 
returned as a string or a tuple.

4) Deprecate _int in Decimal and add a new reference str_digits.

There are probably more solutions. I lean towards 4, because it makes usage 
easier and avoids cluttering Decimal with methods. 

Here is what I used for benchmarks:



import timeit

old_setup = """
import random
from decimal import Decimal

def _decimal_to_ratio(d):
sign, digits, exp = d.as_tuple()
if exp in ('F', 'n', 'N'):  # INF, NAN, sNAN
assert not d.is_finite()
return (d, None)
num = 0
for digit in digits:
num = num*10 + digit
if exp < 0:
den = 10**-exp
else:
num *= 10**exp
den = 1
if sign:
num = -num
return (num, den)

def run_it():
dec = Decimal(str(random.random()))
_decimal_to_ratio(dec)
"""

new_setup = """
import random
from decimal import Decimal

def _decimal_to_ratio(d):
sign, exp = d._sign, d._exp
if exp in ('F', 'n', 'N'):  # INF, NAN, sNAN
assert not d.is_finite()
return (d, None)
num = int(d._int)
if exp < 0:
den = 10**-exp
else:
num *= 10**exp
den = 1
if sign:
num = -num
return (num, den)

def run_it():
dec = Decimal(str(random.random()))
_decimal_to_ratio(dec)
"""

if __name__ == '__main__':
print("Testing proposed implementation")
print("number = 1")
print(timeit.Timer(stmt='run_it()', setup=new_setup).timeit(number=1))
print("number = 10") 
print(timeit.Timer(stmt='run_it()', setup=new_setup).timeit(number=10))
print("number = 100") 
print(timeit.Timer(stmt='run_it()', setup=new_setup).timeit(number=100))

print("Testing old implementation")
print("number = 1")
print(timeit.Timer(stmt='run_it()', setup=old_setup).timeit(number=1))
print("number = 10") 
print(timeit.Timer(stmt='run_it()', setup=old_setup).timeit(number=10))
print("number = 100") 
print(timeit.Timer(stmt='run_it()', setup=old_setup).timeit(number=100))

--
components: Library (Lib)
messages: 256873
nosy: johnwalker
priority: normal
severity: normal
status: open
title: Improve performance of statistics._decimal_to_ratio and 
fractions.from_decimal
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



[issue25930] os.unlink != os.remove in python3.5

2015-12-22 Thread Anthony Sottile

New submission from Anthony Sottile:

I've confirmed this bug is present on both windows and linux, the outputs below 
are from linux however.

Compare:

```
$ python3.4 --version
Python 3.4.3
$ python3.4 -c 'import os; print(os.unlink == os.remove)'
True
```

```
$ python3.5 --version
Python 3.5.0
$ python3.5 -c 'import os; print(os.unlink == os.remove)'
False
```

The docs say: https://docs.python.org/3/library/os.html#os.remove

"This function is identical to unlink()."

To me identity means `is` but I at least expect the `==` behaviour of previous 
versions.

--
messages: 256880
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: os.unlink != os.remove in python3.5
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



[issue23846] asyncio : ProactorEventLoop raised BlockingIOError when ThreadPoolExecutor has many workers

2015-12-22 Thread Yury Selivanov

Yury Selivanov added the comment:

> Why are you using 2 threads?

That's a good question.

In any case it looks like self-pipe sock's buffer was overflown because 
call_soon_threadsafe was called too many times, and loop._read_from_self 
couldn't empty the buffer promptly.  Then, at some point, _write_to_self failed 
with an IOError.

It looks like this was fixed for the selector loop, but not for proactor:

selector_events.py:

def _write_to_self(self):
csock = self._csock
if csock is not None:
try:
csock.send(b'\0')
except OSError:
if self._debug:
logger.debug("Fail to write a null byte into the "
 "self-pipe socket",
 exc_info=True)

proactor_events.py:

def _write_to_self(self):
self._csock.send(b'\0')

--

___
Python tracker 

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



[issue8604] Adding an atomic FS write API

2015-12-22 Thread Марк Коренберг

Марк Коренберг added the comment:

You also forgot about two things:

1. set temporary file permissions before rename
2. fsync(open(os.dirname(temporaryfile)))
3. if original file name is symlink, replace will works wrong. os.realpath 
should be used.

So, here are real life function, that we use in production:


# TODO: save_mtime, save_selinux, extended attr, chattrs and so on...
# TODO: malicious user may replace directory with another while writing to file,
#   so we should use open directory first, and then use openat() and 
renameat()
#   with relative filename instead of specifying absolute path.
#   also NameTemporaryFile should allow to specify dir=
@contextmanager
def replace_file(path, save_perms=False, fsync=True, **kwargs):
realpath = os.path.realpath(path)
operating_dir = os.path.dirname(realpath)
uid = None
gid = None
mode = None
if save_perms:
try:
stinfo = os.lstat(realpath)
uid = stinfo.st_uid
gid = stinfo.st_gid
mode = stinfo.st_mode
except OSError as e:
if e.errno != errno.ENOENT:
raise

with NamedTemporaryFile(dir=operating_dir, **kwargs) as fff:
filedes = fff.fileno()
if None not in (uid, gid, mode):
os.fchown(filedes, uid, gid)
os.fchmod(filedes, mode & 0o)

yield fff

# survive application crash
fff.flush()
if fsync:
# survive power outage, is not required if that is temporary file
os.fsync(filedes)
os.rename(fff.name, realpath)

# see http://bugs.python.org/issue21579
fff._closer.delete = False

if fsync:
# Sync directory: 
http://stackoverflow.com/questions/3764822/how-to-durably-rename-a-file-in-posix
dirfd = os.open(operating_dir, os.O_RDONLY | os.O_CLOEXEC | 
os.O_DIRECTORY)
try:
os.fsync(dirfd)
finally:
os.close(dirfd)

--
nosy: +mmarkk

___
Python tracker 

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



[issue12797] io.FileIO and io.open should support openat

2015-12-22 Thread Марк Коренберг

Марк Коренберг added the comment:

But... os.openat() is still missing... why status is closed() ?!

--
nosy: +mmarkk

___
Python tracker 

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



[issue4709] Mingw-w64 and python on windows x64

2015-12-22 Thread Steve Dower

Steve Dower added the comment:

And FTR, there are plenty of major Python-using companies that insist on 
compiling from scratch and also refuse to touch GPL at all, no matter how many 
exemptions are in the licenses. GFortran is not the ideal solution for these 
users.

--

___
Python tracker 

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



[issue25919] htp.client PUT method ignores error responses sent immediatly after headers

2015-12-22 Thread SilentGhost

SilentGhost added the comment:

There is a test suite which can be run to test for breakages:

./python -m test test_httplib

If you do that you'll notice that some things are broken, I got error in 5 
different tests related to you select.select call:

TypeError: argument must be an int, or have a fileno() method. 

Your test code seems to be running fine now, though.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue25919] htp.client PUT method ignores error responses sent immediatly after headers

2015-12-22 Thread SilentGhost

SilentGhost added the comment:

That was a testing issue, apparently test.test_httplib.FakeSocket is not fake 
enough.

--

___
Python tracker 

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



[issue25930] os.unlink != os.remove in python3.5

2015-12-22 Thread Eryk Sun

Eryk Sun added the comment:

This is due to using argument clinic in Modules/posixmodule.c:

/*[clinic input]
os.remove = os.unlink

builtin_function_or_method instances are equal if m_self (the module in this 
case) and m_ml->ml_meth (the C function) are the same. In 3.4, the function 
posix_unlink is used for both os.unlink and os.remove, which is why they 
compare as equal. In 3.5, argument clinic defines separate os_unlink and 
os_remove implementations in Modules/clinic/posixmodule.c.h.

--
components: +Argument Clinic, Library (Lib)
nosy: +eryksun, larry
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



[issue24840] implement bool conversion for enums to prevent odd edge case

2015-12-22 Thread Gregory P. Smith

Gregory P. Smith added the comment:

lets collect some examples of where it causes problems (someone ran into the 
problem at work which is why i hunted down this bugs.python.org issue) before 
deciding.

If it stays in, it needs a mention in both Misc/NEWS and What's New as it will 
require some people to test and update their code for 3.6.  Examples will let 
us decide which way to go.

--

___
Python tracker 

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2015-12-22 Thread Ian Carroll

Ian Carroll added the comment:

Write still fails on 3.5.1 and OS X 10.11.2. I'm no dev, so can someone explain 
how to use the patch while it's under review?

--
nosy: +Ian Carroll

___
Python tracker 

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



[issue25913] base64.a85decode adobe flag incorrectly utilizes <~ as a marker causing error

2015-12-22 Thread Swati Jaiswal

Changes by Swati Jaiswal :


Added file: http://bugs.python.org/file41393/iss_25913_2.patch

___
Python tracker 

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



[issue4709] Mingw-w64 and python on windows x64

2015-12-22 Thread Ralf Gommers

Ralf Gommers added the comment:

> "We" is a lot of different companies and individuals. Anyone distributing 
> prebuilt binaries is helping here, a few people are working on the licensing 
> concerns for some components, other people are working on C BLAS libraries.

Note that we by default recommend to users to use a distribution like 
Anaconda/Canopy (for example at http://scipy.org/install.html). That's fine for 
many scientific users, but not for people that already have a Python stack 
installed or simply prefer to use pip for another reason.  So pre-built 
binaries like the ones in Anaconda/Canopy help, but don't solve the "make `pip 
install scipy` work" problem. And giving up on pip/PyPi would make no one 
happy...

> I see the issue approximately as "it's hard to install the scipy stack", 
> which is broader than "Windows does not have a Free Fortran compiler" 

It's: "it's hard to install the scipy stack on Windows". On OS X and Linux it's 
really not that hard. On OS X, you can install all core packages with pip 
(there are binary wheels on PyPi). On Linux you can do that too after using 
your package manager to install a few things like BLAS/LAPACK and Python 
development headers.

And the lack of Windows wheels on PyPi is directly related to no free Fortran 
compiler.

> and allows for more solutions (apologies for putting words in your mouth, 
> which is not my intent, though I have certainly seen a fixation on this one 
> particular solution to the exclusion of other possibilities).

Much more effort has gone into pre-built binaries than into MinGW, as well as 
into other things that help but can't be a full solution like a C BLAS. And I 
haven't seen other solutions to "make the scipy stack pip-installable" that 
could work. So I have to disagree with "fixation".

--

___
Python tracker 

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



[issue4709] Mingw-w64 and python on windows x64

2015-12-22 Thread Ralf Gommers

Ralf Gommers added the comment:

> I'm happy and keen to help so please feel free to poke me if you need 
> assistance with anything. I'll keep an eye out too - is it actively being 
> discussed on any list?

Thanks Henry. There's no ongoing discussion on a list right now, but give it a 
week or two. I'll make sure to ping you.

--

___
Python tracker 

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



[issue25931] os.fork() command distributed in windows Python27 (in SocketServer module)

2015-12-22 Thread Eryk Sun

Eryk Sun added the comment:

Starting a Windows process is expensive. Who not use threading, e.g. 
SocketServer.ThreadingTCPServer? 

It seems to me that it's a bug to even define ForkingMixIn, ForkingTCPServer, 
and ForkingUDPServer on Windows. Those should be conditionally defined 
depending on the existence of os.fork.

--
components: +Library (Lib)
nosy: +eryksun
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue13317] building with 2to3 generates wrong import paths because build_ext is run after build_py

2015-12-22 Thread Swati Jaiswal

Swati Jaiswal added the comment:

Can someone help with tests? I just need a pointer on how to do it.

--
keywords: +patch
Added file: http://bugs.python.org/file41394/iss_13317.patch

___
Python tracker 

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



[issue25599] asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock

2015-12-22 Thread Joseph Gordon

Joseph Gordon added the comment:

I uploaded a patch that appears to fix the issue.

--
keywords: +patch
Added file: http://bugs.python.org/file41396/issue25599.patch

___
Python tracker 

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



[issue21815] imaplib truncates some untagged responses

2015-12-22 Thread Lita Cho

Lita Cho added the comment:

Here is a patch after SlientGhost's review. I have added back the newline and 
included the comments for the imaplib documentation.

--
Added file: 
http://bugs.python.org/file41395/imaplib_after_silentghost_review.patch

___
Python tracker 

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



[issue25913] base64.a85decode adobe flag incorrectly utilizes <~ as a marker causing error

2015-12-22 Thread Martin Morrison

Martin Morrison added the comment:

The proposed patch does stop requiring the leading <~, but still trims the 
first two characters off the data set. This will no doubt fail in cases where 
there is no leading marker.

I think it will need to explicitly handle the case where the leading marker is 
there vs. not.

--

___
Python tracker 

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



[issue23846] asyncio : ProactorEventLoop raised BlockingIOError when ThreadPoolExecutor has many workers

2015-12-22 Thread Guido van Rossum

Guido van Rossum added the comment:

Why are you using 2 threads?

--Guido (mobile)
On Dec 22, 2015 02:03, "Joseph Gordon"  wrote:

>
> Changes by Joseph Gordon :
>
>
> --
> nosy: +josephgordon
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue23894] lib2to3 doesn't recognize rb'...' as a raw byte string in Python 3

2015-12-22 Thread Joseph Gordon

Joseph Gordon added the comment:

With the changes in the uploaded patch it looks like strings of the form 
rb'...' are now recognized as raw byte strings.

--
keywords: +patch
Added file: http://bugs.python.org/file41382/issue23894.patch

___
Python tracker 

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



[issue25661] tokenize.untokenize does not maintain the order of tabbed indentations and leading spaces

2015-12-22 Thread Joseph Gordon

Changes by Joseph Gordon :


--
nosy: +josephgordon

___
Python tracker 

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



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2015-12-22 Thread Joseph Gordon

Changes by Joseph Gordon :


--
nosy: +josephgordon

___
Python tracker 

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



[issue25922] canceling a repair install breaks the ability to uninstall, repair, or re-install

2015-12-22 Thread Steve Dower

Steve Dower added the comment:

Does rebooting allow you to keep going?

--

___
Python tracker 

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



[issue4709] Mingw-w64 and python on windows x64

2015-12-22 Thread Steve Dower

Steve Dower added the comment:

We are working on the Fortran issue in a few different ways, one of which is 
your work on MinGW compatibility so that gfortran can be used. But that isn't 
the only solution to this whole problem, and it's not even preferable for a lot 
of Python users, so expect other proposals to come out.

I'm not aware of any C99 limitations still present in VC14, so please let me 
know so I can file bugs against the team.

--

___
Python tracker 

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



[issue25900] unittest ignores the first ctrl-c when it shouldn't

2015-12-22 Thread Marius Gedminas

Marius Gedminas added the comment:

Somewhat unrelated nitpick: I'm not very happy that _InterruptHandler doesn't 
return early after calling the original handler.

It's all very well, if the original handler raises or does nothing at all, but 
if it's a user-installed handler that does something (e.g. print a stack trace 
to sys.stderr), then it might get called twice (or three times, after my patch).

AFAIU the situation would have to be pretty contrived:

- there's a user-provided SIGINT handler
- unittest installs its own on top
- one of the tests (or some test runner plugin) overrides the SIGINT handler 
again
- user presses Ctrl-C
- the current SIGINT handler delegates to the unittest _InterruptHandler
- _InterruptHandler notices it's not the current handler and delegates to the 
original one
- the original handler doesn't raise
- _InterruptHandler.__call__ doesn't return early and goes on to perform the 
"if called check"
- if this is a second Ctrl-C, the original handler will get called a second 
time for the same Ctrl-C event
- if there are no registered results, my new code will cause the original 
handler to get called again (a third, or a 2nd time for the same Ctrl-C event)

Is there a good reason not to add early returns after defering to the original 
handler?  Maybe it's desired that ^C should stop the test suite even if a test 
overrides the SIGINT handler but delegates back to the unittest one?

--

___
Python tracker 

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



[issue25599] asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock

2015-12-22 Thread Joseph Gordon

Changes by Joseph Gordon :


--
nosy: +josephgordon

___
Python tracker 

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



[issue25900] unittest ignores the first ctrl-c when it shouldn't

2015-12-22 Thread Marius Gedminas

Marius Gedminas added the comment:

Here's an updated patch with tests

--
Added file: 
http://bugs.python.org/file41383/dont-ignore-first-ctrl-c-with-tests.patch

___
Python tracker 

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



[issue4709] Mingw-w64 and python on windows x64

2015-12-22 Thread Henry Gomersall

Henry Gomersall added the comment:

Thanks Ralf - I'm happy and keen to help so please feel free to poke me if you 
need assistance with anything. I'll keep an eye out too - is it actively being 
discussed on any list?

--

___
Python tracker 

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



[issue25900] unittest ignores the first ctrl-c when it shouldn't

2015-12-22 Thread Marius Gedminas

Marius Gedminas added the comment:

I looked for any existing tests (by grepping for 'signals' and 'import' on the 
same line), didn't find any (because my assumption that 'signals' would have to 
be explicitly imported was wrong).

Wrote some new tests, which made me also make some further changes to 
unittest/signals.py: https://gist.github.com/mgedmin/a91872054884dbaaa344

And that's how I discovered that there's an existing test suite for SIGINT 
handling, in test_break.py, and that it fails after my changes.

Stay tuned.

--

___
Python tracker 

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



[issue25664] Logging cannot handle Unicode logger names

2015-12-22 Thread Joseph Gordon

Changes by Joseph Gordon :


--
nosy: +josephgordon

___
Python tracker 

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



[issue25324] Importing tokenize modifies token

2015-12-22 Thread Joseph Gordon

Changes by Joseph Gordon :


--
nosy: +josephgordon

___
Python tracker 

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



[issue23846] asyncio : ProactorEventLoop raised BlockingIOError when ThreadPoolExecutor has many workers

2015-12-22 Thread Joseph Gordon

Changes by Joseph Gordon :


--
nosy: +josephgordon

___
Python tracker 

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



[issue25597] unittest.mock does not wrap dict objects correctly

2015-12-22 Thread Joseph Gordon

Changes by Joseph Gordon :


--
nosy: +josephgordon

___
Python tracker 

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



[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2015-12-22 Thread Ronald Oussoren

New submission from Ronald Oussoren:

https://emptysqua.re/blog/getaddrinfo-deadlock/ claims that getaddrinfo may 
deadlock when using threads and fork on (amongst others) OSX due to using a 
global lock.

That lock is used when getaddrinfo is believed to be not thread safe, see the 
relevant code below (from the blog post):

/* On systems on which getaddrinfo() is believed to not be thread-safe,
   (this includes the getaddrinfo emulation) protect access with a lock. */
#if defined(WITH_THREAD) && (defined(__APPLE__) || \
(defined(__FreeBSD__) && __FreeBSD_version+0 < 503000) || \
defined(__OpenBSD__) || defined(__NetBSD__) || \
defined(__VMS) || !defined(HAVE_GETADDRINFO))
#define USE_GETADDRINFO_LOCK
#endif

I think it is worthwhile to investigate whether or not getaddrinfo on OSX is 
really not thread safe. 

Some source code for OSX can be found at the link below, I haven't checked yet 
which OSX release this corresponds to:

http://www.opensource.apple.com/source/Libinfo/Libinfo-278/lookup.subproj/getaddrinfo.c

--
assignee: ronaldoussoren
components: Macintosh
messages: 256838
nosy: ned.deily, ronaldoussoren
priority: low
severity: normal
status: open
title: investigate if getaddrinfo(3) on OSX is thread-safe
type: enhancement
versions: Python 2.7, 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



[issue25923] More const char

2015-12-22 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch adds the const qualifier to char* parameter declarations and 
static char arrays if appropriate. This makes the code more strict and can help 
to catch bugs or generate more efficient code. In additional it can decrease 
memory consumption by avoiding copying constant data.

--
assignee: serhiy.storchaka
components: Extension Modules, Interpreter Core
files: const_char_ptr.patch
keywords: patch
messages: 256837
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: More const char
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file41384/const_char_ptr.patch

___
Python tracker 

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



[issue25848] Tkinter tests failed on Windows buildbots

2015-12-22 Thread R. David Murray

R. David Murray added the comment:

Well, it clutters up the buildbot web interface with builders that aren't being 
used.  Our historical pattern has been to deactivate the builders after a 
release goes into security-fix-only mode.

Zach, would it be practical to just comment them out and then reactivate them 
when Larry does a release, or would that eliminate the benefit from your point 
of view?

--
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



[issue25925] Coverage support for CPython 2

2015-12-22 Thread Emanuel Barry

Changes by Emanuel Barry :


--
nosy: +ebarry

___
Python tracker 

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



[issue25925] Coverage support for CPython 2

2015-12-22 Thread Alecsandru Patrascu

New submission from Alecsandru Patrascu:

Hi All,

This is Alecsandru from Server Scripting Languages Optimization team at Intel 
Corporation. I would like to submit a patch that adds extended support for 
coverage, in the same way that it is used in CPython3. Used in conjunction with 
the regrtests, it provides a broader view of the hot and cold zones in the 
interpreter.

Thank you,
Alecsandru

--
components: Build
files: coverage-2.7-v01.patch
keywords: patch
messages: 256839
nosy: alecsandru.patrascu
priority: normal
severity: normal
status: open
title: Coverage support for CPython 2
type: enhancement
versions: Python 2.7
Added file: http://bugs.python.org/file41385/coverage-2.7-v01.patch

___
Python tracker 

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



[issue25926] problems with "times" keyword in itertools.repeat

2015-12-22 Thread Thomas Feldmann

New submission from Thomas Feldmann:

According to the docs `itertools.repeat(object[, times])` is equivalent to

```
def repeat(object, times=None):
# repeat(10, 3) --> 10 10 10
if times is None:
while True:
yield object
else:
for i in range(times):
yield object
```

But it raises a TypeError when used this way:

```
Python 3.5.1 (default, Dec 10 2015, 10:34:07)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from itertools import repeat
>>> repeat('x', times=None)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'NoneType' object cannot be interpreted as an integer
```

The `times` keyword can be omitted but not explicitly set to None.
I checked with Python Versions 2.7 and 3.5.1 on Mac OS X and Windows 10.

--
components: Interpreter Core
messages: 256847
nosy: Thomas Feldmann
priority: normal
severity: normal
status: open
title: problems with "times" keyword in itertools.repeat
type: behavior
versions: Python 2.7, Python 3.5

___
Python tracker 

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



[issue25926] problems with "times" keyword in itertools.repeat

2015-12-22 Thread R. David Murray

R. David Murray added the comment:

Huh.  I always thought the wording was "roughly equivalent to".  This is a 
consequence of C vs python, and is the reason the docstring uses the [] 
notation.

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

___
Python tracker 

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



[issue25848] Tkinter tests failed on Windows buildbots

2015-12-22 Thread Zachary Ware

Zachary Ware added the comment:

Would pretty much eliminate the benefit; there are currently a few special 
cases for 3.4 (particularly for the ICC builders, and the XP bot), which could 
go away.

For the record, the secret undocumented method for running a build on all 
custom builders is to fill out the third-to-last set of entry boxes (the one 
that includes a "Repo path" box) on http://buildbot.python.org/all/builders and 
click the associated 'Force Build' button.  It's really not that hard to 
request such a build, but I will grant that it's rather inconvenient.

On the other hand, it wouldn't be too hard to just add the branch back without 
the special cases around release time for a little while, but there may be some 
expected failures.

--

___
Python tracker 

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



[issue25848] Tkinter tests failed on Windows buildbots

2015-12-22 Thread R. David Murray

R. David Murray added the comment:

How about just keeping the stable set configs, minus any from that set that 
have special cases?  Although if it is just one form submission, maybe we just 
need to document that in the release manager's guide?

--

___
Python tracker 

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



[issue25848] Tkinter tests failed on Windows buildbots

2015-12-22 Thread Zachary Ware

Zachary Ware added the comment:

I think only keeping some builders would be more complex than any other option. 
 Here's a patch against pep101 to document the custom builder trick.

--
keywords: +patch
Added file: http://bugs.python.org/file41389/pep101_custom_buildbots.diff

___
Python tracker 

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



[issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.*

2015-12-22 Thread Марк Коренберг

Changes by Марк Коренберг :


--
components: +Library (Lib)

___
Python tracker 

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



[issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.*

2015-12-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Do you want to provide a patch Mark?

--
nosy: +georg.brandl, ncoghlan, serhiy.storchaka
stage:  -> needs patch
type:  -> enhancement
versions:  -Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue25599] asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock

2015-12-22 Thread Guido van Rossum

Guido van Rossum added the comment:

Oh dang. We were waiting for the OP to submit a patch (not very complex)
but they never did. Now we missed the 3.5.2 deadline. Maybe someone can try
again for 3.5.3?

On Tue, Dec 22, 2015 at 12:30 AM, Joseph Gordon 
wrote:

>
> Changes by Joseph Gordon :
>
>
> --
> nosy: +josephgordon
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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