[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2015-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a37ea1d56e98 by Terry Jan Reedy in branch '2.7':
Issue #25507: move test-specific imports to test function (idlelib.IOBinding).
https://hg.python.org/cpython/rev/a37ea1d56e98

New changeset 38b6b7253ba1 by Terry Jan Reedy in branch '3.4':
Issue #25507: move test-specific imports to test function (idlelib.IOBinding).
https://hg.python.org/cpython/rev/38b6b7253ba1

--
nosy: +python-dev

___
Python tracker 

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



[issue18531] Undocumented different between METH_KEYWORDS and **kws

2015-10-30 Thread Evgeny Kapun

Changes by Evgeny Kapun :


--
nosy: +abacabadabacaba

___
Python tracker 

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



[issue25512] apparent memory leak using ctypes

2015-10-30 Thread Benjamin Peterson

Benjamin Peterson added the comment:

cast() always creates a ref cycle, which is probably what you are seeing.

>>> from ctypes import c_double, cast, POINTER
>>> samples = (c_double*23)()
>>> cast(samples, POINTER(c_double))
<__main__.LP_c_double object at 0x7f33bc920560>
>>> samples._objects
{13986018358: <__main__.c_double_Array_23 object at 0x7f33bc8ef280>}
>>> samples
<__main__.c_double_Array_23 object at 0x7f33bc8ef280>

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue25041] document AF_PACKET socket address format

2015-10-30 Thread Berker Peksag

Berker Peksag added the comment:

Thanks! The patch looks good to me. I left a few minor comments on Rietveld: 
http://bugs.python.org/review/25041/

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

___
Python tracker 

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



[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-30 Thread Stefan Krah

Stefan Krah added the comment:

Per the docs the readonly flag must be consistent for all consumers,
so checking for writability after getting the view should be okay in
principle.

--

___
Python tracker 

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



[issue25487] imp module DeprecationWarning in test suite

2015-10-30 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for the finding these, Martin!

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25495] binascii documentation incorrect

2015-10-30 Thread Martin Panter

Martin Panter added the comment:

I was only referring to the original Python documentation and library. See the 
base64.encode() implementation for an example which does do this 57-byte 
pre-chunking. Simplified:

MAXLINESIZE = 76 # Excluding the CRLF
MAXBINSIZE = (MAXLINESIZE//4)*3  # 57
...
while True:
s = input.read(MAXBINSIZE)
if not s:
break
line = binascii.b2a_base64(s)
output.write(line)

Here’s my attempt to rewrite the doc (3.6 version):

'''
Convert binary data to the base 64 encoding defined in :rfc:`4648`. The return 
value includes a trailing newline ``b"\n"`` if *newline* is true.

To be MIME-compliant, base 64 output should be broken into lines at most 76 
characters long. One way to do this is to call this function with 57-byte 
chunks and ``newline=True``. Also, the original PEM context-transfer encoding 
limited the line length to 64 characters.
'''

But if PEM is long gone as you say, perhaps we don’t need that last sentence?

--

___
Python tracker 

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



[issue25519] Minor difflib documentation bug

2015-10-30 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
assignee: docs@python -> terry.reedy
nosy: +terry.reedy
versions:  -Python 3.2, Python 3.3

___
Python tracker 

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



[issue25150] 3.5: Include/pyatomic.h is incompatible with OpenMP (compilation of the third-party yt module fails on Python 3.5)

2015-10-30 Thread Arkadiusz Miskiewicz Arkadiusz Miskiewicz

Arkadiusz MiskiewiczArkadiusz Miskiewicz added the 
comment:

Same for 3.5 branch from hg (git mirror actually).

--

___
Python tracker 

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



[issue25521] optparse module does not emit DeprecationWarning

2015-10-30 Thread John Hagen

New submission from John Hagen:

According to the Python docs, optparse has been deprecated since Python 3.2, 
but it does not emit a DeprecationWarning when imported Python 3.2+.

https://docs.python.org/3/library/optparse.html

PyCharm can uses these DeprecationWarnings to provide helpful alerts the user: 
https://youtrack.jetbrains.com/issue/PY-16589

--
components: Library (Lib)
messages: 253768
nosy: John Hagen
priority: normal
severity: normal
status: open
title: optparse module does not emit DeprecationWarning
type: behavior
versions: 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



[issue25505] undefined name 'window' in Tools/scripts/fixdiv.py

2015-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2672ab3cfb23 by Terry Jan Reedy in branch '2.7':
Issue #25505: Remove unused buggy method.
https://hg.python.org/cpython/rev/2672ab3cfb23

New changeset ef435729bc80 by Terry Jan Reedy in branch '3.4':
Issue #25505: Remove unused buggy method.
https://hg.python.org/cpython/rev/ef435729bc80

--
nosy: +python-dev

___
Python tracker 

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



[issue25519] Minor difflib documentation bug

2015-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4ed175ee3cca by Terry Jan Reedy in branch '2.7':
Issue #25519: Mark difflib.ndiff as a functions where not already.
https://hg.python.org/cpython/rev/4ed175ee3cca

New changeset b7686cb0b698 by Terry Jan Reedy in branch '3.4':
Issue #25519: Mark difflib.ndiff as a functions where not already.
https://hg.python.org/cpython/rev/b7686cb0b698

--
nosy: +python-dev

___
Python tracker 

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



[issue25519] Minor difflib documentation bug

2015-10-30 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue17214] http.client.HTTPConnection.putrequest encode error

2015-10-30 Thread Martin Panter

Martin Panter added the comment:

This bug only applies to Python 3. In Python 2, the non-ASCII bytes are sent 
through to the redirect target verbatim. I think this would also be the ideal 
way to handle the problem in 3, but percent-encoding them as proposed also 
seems good enough, and does not require hacking the HTTPConnection.putrequest() 
internals.

My patch updates Christian’s patch:
* Tested, so hopefully no typos :)
* Add test cases based on Issue 22248, as well as a URL already including a 
percent sign
* Process entire URL, not just the path component. A non-ASCII byte could just 
as easily be in the query component, for example.
* Remove redundant encoding of space character from redirect_request() method.

--
stage: test needed -> patch review
versions: +Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40907/issue17214.redirect.v2.patch

___
Python tracker 

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



[issue25505] undefined name 'window' in Tools/scripts/fixdiv.py

2015-10-30 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
assignee:  -> terry.reedy
nosy: +terry.reedy

___
Python tracker 

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



[issue25426] Deprecate the regex_compile benchmark

2015-10-30 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for the pointer about re.purge(), Serhiy!

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25426] Deprecate the regex_compile benchmark

2015-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0da7b44c2ea3 by Brett Cannon in branch 'default':
Use re.purge() to clear the re cache.
https://hg.python.org/benchmarks/rev/0da7b44c2ea3

--
nosy: +python-dev

___
Python tracker 

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



[issue25443] Add a count of how many benchmarks are left to run

2015-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 71967658feb5 by Brett Cannon in branch 'default':
Issue #25443: Add a running count of benchmarks.
https://hg.python.org/benchmarks/rev/71967658feb5

--
nosy: +python-dev

___
Python tracker 

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



[issue25156] shutil.copyfile should internally use os.sendfile when possible

2015-10-30 Thread desbma

desbma added the comment:

Here is an improved patch with the following changes:
* Fallback to copyfileobj if sendfile fails with errno set to EINVAL or ENOSYS 
* Add a test for > 4GB file

--
Added file: http://bugs.python.org/file40906/issue25156_v2.patch

___
Python tracker 

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



[issue25505] undefined name 'window' in Tools/scripts/fixdiv.py

2015-10-30 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-30 Thread STINNER Victor

STINNER Victor added the comment:

> As in my previous example, if other 3rd party libraries(ncurses in my case) 
> need to handle the signal, signal is consumed by Python handler and not 
> delivered to the library.

In the Python signal handler, can't you call the ncurses function that
should be called when the terminal is resized?

--

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2015-10-30 Thread Brian Sutherland

Brian Sutherland added the comment:

On Wed, Oct 28, 2015 at 03:32:36PM +, Guido van Rossum wrote:
> 
> Guido van Rossum added the comment:
> 
> How about we extend loop.stop() so that you can pass it an exception to
> raise once the loop is stopped? This exception would then be thrown out of
> run_forever(). There may be some delay (callbacks already scheduled will
> run first) but it is how things were meant to be.

It is better than the current situation where to call loop.stop() and
have the correct exit code I would need to resort to a global variable.

I would then probably try to write an exception handler like this:

def exception_handler(loop, context):
loop.stop(context.get('exception', Exception('unknown error')))

And then hope I don't lose the traceback!

> FWIW this isn't really enough to ensure cleanup happens before destructors
> run -- when the loop exits, tasks may still be active unless you keep track
> of all of them and explicitly cancel them (and run the loop until they have
> processed the cancellation).

At least in my situation I don't think this is a problem, the objective
is to shut down the process quickly to prevent bad things happening.

--

___
Python tracker 

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



[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-30 Thread Martin Panter

Martin Panter added the comment:

Okay, so  says 
writability must be consistent. As far as I can see, there is no similar 
requirement for contiguity. So in theory PyBUF_FULL_RO could produce a 
discontiguous buffer when PyBUF_WRITABLE would have produced a contiguous one. 
But I guess this is rather unlikely, so Eryksun’s approach might be good enough.

I am starting to wonder why the current memory view hack should even be 
necessary. It seems like a memory view created by PyMemoryView_FromBuffer() 
will eventually do the equivalent of PyBuffer_Release(), except that it leaks a 
reference to the underlying Python object. This was also brought up at 
, but the question is not 
resolved that I can see.

Possibly also related is Issue 15821, but I don’t know enough details or 
history to be sure.

--

___
Python tracker 

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



[issue15994] memoryview to freed memory can cause segfault

2015-10-30 Thread Martin Panter

Martin Panter added the comment:

Saving a reference to the overall buffered reader is probably not good enough. 
I think the buffer is freed when close() is called, so a reference to this 
internal buffer would need to be saved instead (or as well). Unless we stop 
having close() free the buffer.

--
components: +IO
nosy: +martin.panter

___
Python tracker 

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



[issue25522] IDLE: warn if save-as name matches stdlib name

2015-10-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The lib messages should say "Neither you nor python will be able to import the 
stdlib module".  Example of python-imported lib names that a beginner might 
write are abc, io, os, nt, and stat.

--

___
Python tracker 

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



[issue25454] operator.methodcaller should accept additional arguments during the call

2015-10-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Closing this for the reasons mentions above.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue25041] document AF_PACKET socket address format

2015-10-30 Thread Martin Panter

Martin Panter added the comment:

Quickly looking through the history (annotate function on Mercurial web 
frontend):

* Revisions 3d4a7cd0bf17, c8ef864ba861 (2001): AF_PACKET support added on 
Linux. Partially documented in C comment and socket.bind() docstring. 
AF/PF_PACKET, PACKET_* constants also added.

* #947352 (Python 2.4), 8b3288f607e1: Support specifying hardware address, for 
sendto().

Here are some more things might be good to tease out:

1. Please don’t invent new parameter names without a good reason. I suggest 
(ifname, proto, pkttype, hatype, addr). These are already used in the bind() 
doc string, most are consistent with Linux’s struct sockaddr_ll fields, and 
“proto” is consistent with Python’s socket() constructor.

2. There is an error message mentioning “protoNumber” which could also be 
adjusted for consistency

3. When Python generates the ifname string, it uses the empty string for 
ifindex zero (matching any interface), although it does not look like parsing 
this back is supported

4. proto is endian-corrected, in contrast with Linux’s version being in network 
byte-order

5. Default pkttype is zero. This is equal to PACKET_HOST, so could be useful. 
Might also be worth changing the source code to explicitly use PACKET_HOST.

6. addr has to be a bytes-like object

7. Packet support is specific to Linux, and may not be compiled in

8. Existence of *_PACKET and PACKET_* constants

9. socket.bind() doc string needs updating since revision c8ef864ba861 (missing 
fifth parameter, addr)

--
nosy: +martin.panter

___
Python tracker 

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



[issue25522] IDLE: warn if save-as name matches stdlib name

2015-10-30 Thread Terry J. Reedy

New submission from Terry J. Reedy:

When users 'saveas', warn if name matches that of a stdlib modules. Note that 
shadowing is opposite for lib and binary (builtin) modules, so message needs to 
be different.  I am not worrying about 3rd party modules on the search path 
(ie, site-packages), which would be shadowed like lib modules. Rough outline of 
code to add to IOBinding.

from os,path import dirname
import sys

# this part on initiallzation or first saveas call
def libmodules():
with open(dirname(dirname(__file__))) as lib:
for f in lib:
if  or f.endswith(.py):
yield f
# test.test__all__ has this code

islibmodule = frozenset(libmodules()).__contains__
isbinmodule = frozenset(sys.builtin_module_names).__contains__

# this part after saveas dialog returns
if islibmodule(name):
go = warn("This name matches a stdlib name in /Lib. If you run python in 
this directory, you will not be able to import the stdlib module.  Continue?".)
elif isbinmodule(name):
go = warn("This name matches a builtin stdlib name.  You will not be able 
to import this file.  Continue?".)
else:
go = True
if go:

else:
   (get name again>  # or put in while not go loop

--
messages: 253775
nosy: lac, markroseman, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: warn if save-as name matches stdlib name
type: enhancement
versions: Python 2.7, 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



[issue11315] Fix type regression in http.cookies.load (want bytes, not str)

2015-10-30 Thread Chad Whitacre

Chad Whitacre added the comment:

Here's a patch with a couple failings tests for the type regression in 3.x.

--
Added file: 
http://bugs.python.org/file40901/failing-tests-for-type-regression.patch

___
Python tracker 

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



[issue25485] Add a context manager to telnetlib.Telnet

2015-10-30 Thread SilentGhost

SilentGhost added the comment:

That's fine as a code change, but that's not the kind of test I meant. There is 
a Lib/test/test_ftplib.py and it basically needs test_with_statement added to 
one or few test cases. Have a look at how the similar functions implemented in 
Lib/test/.

--

___
Python tracker 

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



[issue25485] Add a context manager to telnetlib.Telnet

2015-10-30 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

New version of the patch, I have modified the 'test' function. In this 
function, I use the with statement with the __enter__ and __exit__.

--
Added file: http://bugs.python.org/file40902/issue25485-2.patch

___
Python tracker 

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



[issue11315] Fix type regression in http.cookies.load (want bytes, not str)

2015-10-30 Thread Chad Whitacre

Changes by Chad Whitacre :


--
title: Fix/add unicode support in Cookie module? -> Fix type regression in 
http.cookies.load (want bytes, not str)
versions: +Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 -Python 
2.7

___
Python tracker 

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



[issue11315] Fix/add unicode support in Cookie module?

2015-10-30 Thread Chad Whitacre

Chad Whitacre added the comment:

> in the 3.x version, only character strings (unicode) are accepted
> The code was changed to do this in r83361 #3788.

That seems like a bug to me. It looks like the intention was to avoid the 
`type("")` check for stylistic reasons, so `isinstance(rawdata, str)` is an 
understandable translation under 3.1 (which #3788 targets), but I suspect that 
`type("")` should never have survived the transition to Python 3 in the first 
place. The 2.7 branch still has `type("")` (not `str("")` as originally 
reported):

https://hg.python.org/cpython/file/2.7/Lib/Cookie.py#l639


> “raw” would suggest to me than only bytes make sense.

Agreed. Cookie names and values are constrained to a subset of ASCII:

https://tools.ietf.org/html/rfc6265#section-4.1.1

I suggest cookies be thought of as a binary data store, with programmers 
responsible to encode/decode their data at the boundary with the cookies 
library.


> I would tend to edit the documentation but no[t] the behavior, given that 2.7 
> is stable and this behavior has been present and documented for a long time.

Leaving 2.7 as-is makes sense, but now I think it looks like we have a 
regression in 3, which should be fixed.



P.S. I arrived here from https://github.com/gratipay/aspen.py/pull/524.

--
nosy: +whit537

___
Python tracker 

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



[issue25144] 3.5 Win install fails with "TARGETDIR"

2015-10-30 Thread Steve Dower

Steve Dower added the comment:

That's a good idea.

Can you grab the log files from %UserProfile%\AppData\Local\Temp (sort by date 
- they'll all be grouped together) and upload to this issue? 

Like Felipe, you may want to censor some usernames/paths. If you do, please let 
me know if they contain anything other than letters or digits (spaces and 
punctuation may be very important here).

--

___
Python tracker 

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



[issue25150] 3.5: Include/pyatomic.h is incompatible with OpenMP (compilation of the third-party yt module fails on Python 3.5)

2015-10-30 Thread Arkadiusz Miskiewicz Arkadiusz Miskiewicz

Arkadiusz MiskiewiczArkadiusz Miskiewicz added the 
comment:

Should it work with /configure '--with-cxx-main=g++' && make?

Because currently it doesn't:

g++ -c -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv 
-O3 -Wall -Wstrict-prototypes-Werror=declaration-after-statement   -I. 
-IInclude -I./Include-DPy_BUILD_CORE -o Programs/python.o 
./Programs/python.c
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC 
but not for C++
In file included from Include/pyatomic.h:10:0,
 from Include/Python.h:53,
 from ./Programs/python.c:3:
/usr/lib64/gcc/x86_64-pld-linux/5.2.0/include/stdatomic.h:40:9: error: 
‘_Atomic’ does not name a type
[...]

(testing 3.5.0 + patch for this issue from hg)

--
nosy: +arekm

___
Python tracker 

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



[issue25474] Weird behavior when setting f_trace in a context manager

2015-10-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

ZERO <__main__.Context object at 0x00874AF3E0B8>
ONE <__main__.Context object at 0x00874AF326D8>
Traceback (most recent call last):
  File "F:\Python\mypy\tem.py", line 45, in 
print ('TWO', two)
NameError: name 'two' is not defined
Traceback (most recent call last):
  File "F:\Python\mypy\tem.py", line 53, in 
print ('THREE', three)
NameError: name 'three' is not defined
FOUR <__main__.Context object at 0x00874AF32748>
FIVE <__main__.Context object at 0x00874B157EB8>

--
nosy: +ncoghlan, terry.reedy
stage:  -> test needed
versions: +Python 2.7, 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



[issue25516] threading.Condition._is_owned() is wrong when using threading.Lock

2015-10-30 Thread Nir Soffer

Changes by Nir Soffer :


--
type:  -> behavior

___
Python tracker 

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



[issue11315] Fix type regression in http.cookies.load (want bytes, not str)

2015-10-30 Thread Chad Whitacre

Chad Whitacre added the comment:

Here's a patch that fixes the two new failing tests. Now a bunch of other tests 
are busted. :-)

--
Added file: http://bugs.python.org/file40903/fix-the-two-new-tests.patch

___
Python tracker 

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



[issue25144] 3.5 Win install fails with "TARGETDIR"

2015-10-30 Thread Laura Creighton

Laura Creighton added the comment:

webmaster just got mail from another person hit with this on Windows 10.

--
nosy: +lac

___
Python tracker 

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



[issue25512] apparent memory leak using ctypes

2015-10-30 Thread Martin Smith

Martin Smith added the comment:

I'm persuaded that this is not a sustained memory leak.

Thanks to Martin Panter and Benjamin Peterson for the tests and the careful 
explanations.

Apologies for distracting busy people.

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



[issue25519] Minor difflib documentation bug

2015-10-30 Thread Andrew Scheller

New submission from Andrew Scheller:

In the documentation for difflib.HtmlDiff.__init__ there's a couple of 
references to ``ndiff()``. I believe these should be modified to :func:`ndiff` 
(as used elsewhere in the difflib documentation) so that they get nicely 
hyperlinked in the HTML documentation.

See e.g. 
https://docs.python.org/2/library/difflib.html#difflib.HtmlDiff.__init__ and 
https://docs.python.org/3/library/difflib.html#difflib.HtmlDiff.__init__
where 'ndiff()' isn't hyperlinked, and 
https://docs.python.org/3/library/difflib.html#difflib.restore where 'ndiff()' 
*is* hyperlinked.

--
assignee: docs@python
components: Documentation
messages: 253743
nosy: docs@python, lurchman
priority: normal
severity: normal
status: open
title: Minor difflib documentation bug
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue25518] Investigate implementation of PyOS_CheckStack on OSX

2015-10-30 Thread Ronald Oussoren

New submission from Ronald Oussoren:

On OSX 10.4 or later the following functions are available:

size_t pthread_get_stacksize_np(pthread_t);
void* pthread_get_stackaddr_np(pthread_t);

These functions could be used to implement PyOS_CheckStack on OSX. The 
advantage of this would be that it would get less likely that recursion causes 
hard crashes when the recursion limit is not optimally tuned to the stack size 
on OSX. (Note that OSX has a fixed size stack for the main thread as well, 
AFAIK unlike linux).

The disadvantage of implementing this is that a naive implementation might have 
a negative performance impact. It should be possible to avoid this by caching 
the return values of these functions in the thread state.

Another disadvantage according to a quick search on Google: 
``pthread_get_stacksize_np`` appears to be buggy on some OSX versions, which 
requires workarounds to get the right behavior.

--
components: Interpreter Core, Macintosh
messages: 253742
nosy: ned.deily, ronaldoussoren
priority: low
severity: normal
stage: test needed
status: open
title: Investigate implementation of PyOS_CheckStack on OSX
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue25495] binascii documentation incorrect

2015-10-30 Thread Mouse

Mouse added the comment:

As far as I remember, the data was not "originally processed in 57-byte 
chunks". I've been around the first PEM and MIME standards and discussions (and 
code, though not in Python, which wasn't around then) to be in position to 
know. :)

Whether the user prefers to process data in chunks or not, is up to the user. 
Not to mention that PEM is long gone, and MIME also changed somewhat. 

The link between this function and RFC4648 can and should be more explicit, but 
I think just referring to it is enough. 

Do you have a recommendation for additional info to explain newline issues?

Yes, changing "Base64 output" to "function output" makes perfect sense.

Thanks!

--

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2015-10-30 Thread Guido van Rossum

Guido van Rossum added the comment:

OK, I'll wait for someone to submit a patch for this. (I tried a quick hack, 
but unless we limit this to BaseException instances that aren't also Exception 
instances it's complicated).

--

___
Python tracker 

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



[issue25514] better startup error messages in IDLE when stdlib modules shadowed

2015-10-30 Thread Laura Creighton

Laura Creighton added the comment:

Re: misunderstanding

Sorry Terry.  From my end the great 4 day "weekend of mail.python.org needs to 
be rebuilt from scratch" happened precisely as I was about
to reply to your post.  The reply to Peter Otten showed up later 
as part of my mailer agent trying to send the thing every 4 hours for
a week.  So confusion reigns.

--

___
Python tracker 

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



[issue11315] Fix type regression in http.cookies.load (want bytes, not str)

2015-10-30 Thread R. David Murray

R. David Murray added the comment:

If strings and values are constrained to be ascii, there is no obvious reason 
to use bytes.  I don't see a bug here in python3.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue25516] threading.Condition._is_owned() is wrong when using threading.Lock

2015-10-30 Thread Nir Soffer

Nir Soffer added the comment:

The commit hash in the previous message is a git commit from the github mirror:
https://github.com/python/cpython/commit/8cb1ccbb8b9ed01c26d2c5be7cc86682e525dce7

--

___
Python tracker 

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



[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Before committing any solution we first should have understood the cause of the 
crash. The peculiarity of example ctypes_crash.py is that the argument of 
ctypes.c_char.from_buffer is a memoryview. With current code we have following 
chain (the list creates a reference loop with itself):

list->memoryview->ManagedBuffer->memoryview->ManagedBuffer->bytearray

Using PyMemoryView_FromObject or hypothetical PyMemoryView_FromObjectEx we 
could get shorter chain:

list->memoryview->ManagedBuffer->bytearray

May be the cause not in current hack, but in memoryview that can't survive with 
breaking long chain? Or may be we just are lucky in latter case?

I share Martin's doubts about writability in Eryksun’s patch.

--

___
Python tracker 

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



[issue11315] Fix type regression in http.cookies.load (want bytes, not str)

2015-10-30 Thread Chad Whitacre

Chad Whitacre added the comment:

Here's a start on converting to bytes everywhere for cookies. I'm not sure I 
fully understand the library's original worldview on type conversion. There's a 
value_{decode,encode} facility, and in the test suite attribute values in 
particular are often not even strings of any kind.

--
Added file: 
http://bugs.python.org/file40904/start-converting-to-bytes-everywhere.patch

___
Python tracker 

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



[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-30 Thread Stefan Krah

Stefan Krah added the comment:

If memoryview B is created from memoryview A, then B must be
registered with the same ManagedBuffer as A, otherwise the
whole scheme breaks down (PyMemoryView_FromObject() performs
this check).


PyMemoryView_FromBuffer() is really a legacy function that
should be only used for creating temporary views within a
function.  As far as I know, it has usually been used that
way from the start (since 3.0).

--

___
Python tracker 

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



[issue25520] unittest load_tests protocol not working as documented

2015-10-30 Thread Stefan Seefeld

New submission from Stefan Seefeld:

As described in the README contained in the attached tarball, I'm observing 
wrong behavior. I have based this code on my understanding of 
https://docs.python.org/2/library/unittest.html#load-tests-protocol, but the 
effect isn't as expected (I see duplicate appearances of tests whenever I use 
the load_tests() mechanism.)

--
files: unittest_bug.tgz
messages: 253757
nosy: stefan
priority: normal
severity: normal
status: open
title: unittest load_tests protocol not working as documented
type: behavior
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file40905/unittest_bug.tgz

___
Python tracker 

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



[issue25443] Add a count of how many benchmarks are left to run

2015-10-30 Thread Brett Cannon

Changes by Brett Cannon :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25487] imp module DeprecationWarning in test suite

2015-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3f924cb4c3eb by Brett Cannon in branch 'default':
Issue #25487: Fix tests not updated when the imp module moved to a
https://hg.python.org/cpython/rev/3f924cb4c3eb

--
nosy: +python-dev

___
Python tracker 

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



[issue25493] warnings.warn: wrong stacklevel causes import of local file "sys"

2015-10-30 Thread Brett Cannon

Brett Cannon added the comment:

So I'm going to close this as "won't fix" because linecache is horribly 
over-engineered and I'm afraid trying to fix this will break code that actually 
worked previously. This is obviously an odd edge case that I think we can live 
with.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue25144] 3.5 Win install fails with "TARGETDIR"

2015-10-30 Thread Wade Hedrick

Wade Hedrick added the comment:

I had the same problem when trying to install 3.5 with Windows 10. I got the 
same results as Felipe has listed in the post from 9/16.

--
nosy: +WadeH
type: behavior -> 

___
Python tracker 

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



[issue25485] Add a context manager to telnetlib.Telnet

2015-10-30 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Ok i will submit an other patch for the tests and the documentation

> On 30 oct. 2015, at 4:37 PM, SilentGhost  wrote:
> 
> 
> SilentGhost added the comment:
> 
> That's fine as a code change, but that's not the kind of test I meant. There 
> is a Lib/test/test_ftplib.py and it basically needs test_with_statement added 
> to one or few test cases. Have a look at how the similar functions 
> implemented in Lib/test/.
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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