[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-07-23 Thread Martin Panter

Martin Panter added the comment:

Thanks Xiang for your work on this, and Klamann for the report.

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

___
Python tracker 

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



[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-07-23 Thread Klamann

Klamann added the comment:

Thanks Xiang and Martin for solving this, you guys are awesome :)

--

___
Python tracker 

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



[issue24291] Many servers (wsgiref, http.server, etc) can truncate large output blobs

2016-07-23 Thread Martin Panter

Martin Panter added the comment:

The bug should no longer be a problem in 3.6, as long as my change for Issue 
26721 survives.

Here is an updated patch against 3.5.

--
versions:  -Python 3.6
Added file: http://bugs.python.org/file43840/wfile-partial.v5.patch

___
Python tracker 

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



[issue27539] negative Fraction ** negative int not normalized

2016-07-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Tests for fractions are in Lib/test/test_fractions.py.  In necessary, post the 
new code in a message.

--

___
Python tracker 

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



[issue15661] OS X installer packages should be signed for OS X 10.8 Gatekeeper feature

2016-07-23 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Ned,

Can this issue be closed? The current installers on www.python.org are signed.

Ronald

--

___
Python tracker 

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



[issue27596] Build failure with Xcode 8 beta on OSX 10.11

2016-07-23 Thread Ronald Oussoren

New submission from Ronald Oussoren:

I just noticed that building the Xcode 8 beta 2 on OSX 10.11 results in a link 
failure of the python binary.

Based on a quick glance at the error (before switching back to Xcode 7):

1) macOS 10.12 appears to have a getentropy function that's detected
   by the configure script.
   
2) For some reason the build environment for configure and the actual build
   are different resulting in the link error.

Even with the link failure fixed the build will fail because getentropy isn't 
present on 10.11 and hence the binary won't work on 10.11.

IMHO it would be worthwhile to at least create a patch that makes it possible 
to use Xcode 8 for building on OSX 10.11, and better yet deploy on older OSX 
releases.

Based on the invasiveness of such a patch we could discuss if the patch would 
be acceptable for merging.

--
assignee: ronaldoussoren
components: Macintosh
messages: 271069
nosy: ned.deily, ronaldoussoren
priority: low
severity: normal
stage: needs patch
status: open
title: Build failure with Xcode 8 beta on OSX 10.11
type: compile error
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



[issue27596] Build failure with Xcode 8 beta on OSX 10.11

2016-07-23 Thread Ronald Oussoren

Ronald Oussoren added the comment:

P.S. This issue is mostly a reminder for myself, Xcode 8 is still in beta and 
hence patches to CPython to support it are IMHO still out of scope for merging 
at this time.

--

___
Python tracker 

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



[issue18049] Re-enable threading test on OSX

2016-07-23 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The patch increases the stack size for threads to slightly less than size as is 
used for the main thread, see this fragment in configure.ac:

   # Issue #18075: the default maximum stack size (8MBytes) is too
   # small for the default recursion limit. Increase the stack size
   # to ensure that tests don't crash
   LINKFORSHARED="-Wl,-stack_size,100 $LINKFORSHARED"

Maybe the patch should be updated to use the same size? 

The disadvantage of any increase of size is that this reduces the number of 
threads that can be used, in particular for 32-bit builds (64-bit builds have 
more than enough address space)

--

___
Python tracker 

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



[issue27597] Add usage examples for TracebackException, StackSummary and FrameSummary

2016-07-23 Thread Ram Rachum

New submission from Ram Rachum:

I saw these new interesting classes in the `traceback` docs, but if I were 
shown an example of how they are used, I might get inspired to use them in my 
own code.

--
assignee: docs@python
components: Documentation
messages: 271072
nosy: cool-RR, docs@python
priority: normal
severity: normal
status: open
title: Add usage examples for TracebackException, StackSummary and FrameSummary
type: enhancement
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



[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-07-23 Thread koobs

koobs added the comment:

Also failing on all freebsd buildbots, all tests failing with:

FileNotFoundError: [Errno 2] No such file or directory: 
'/usr/share/zoneinfo/Iran'

--
nosy: +koobs
resolution: fixed -> 

___
Python tracker 

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



[issue27506] make bytes/bytearray delete a keyword argument

2016-07-23 Thread Martin Panter

Martin Panter added the comment:

This patch is what I had in mind for setting the documented default as 
delete=b'', but using NULL internally.

I also changed it to allow the table argument to be omitted. We can change the 
documentation accordingly. These are just suggestions; use either or both 
aspects as you please :)

--
Added file: http://bugs.python.org/file43841/table-optional-delete-empty.patch

___
Python tracker 

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



[issue13849] Add tests for NUL checking in certain strs

2016-07-23 Thread Martin Panter

Martin Panter added the comment:

Buildbots seem happier now

--
status: open -> closed

___
Python tracker 

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



[issue27581] Fix overflow check in PySequence_Tuple

2016-07-23 Thread Xiang Zhang

Xiang Zhang added the comment:

I'd prefer the size_t method. The others seems to make the logic not clear. 
I've seen some codes using size_t to do overflow checking, such as 
https://hg.python.org/cpython/file/tip/Python/bltinmodule.c#l1954. There are 
more if you use a simple grep. So I think the logic is okay.

--

___
Python tracker 

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



[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-07-23 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks Martin too. Nobody than me knows how much work you have done to this. :) 
I could have made it better at first. :( Sorry for the noise to everyone.

--

___
Python tracker 

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



[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-07-23 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks Martin too. Nobody than me knows how much work you have done to this. :) 
I could have made it better at first. :( Sorry for the noise to everyone.

--

___
Python tracker 

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



[issue27587] Issues, reported by PVS-Studio static analyzer

2016-07-23 Thread Christian Heimes

Christian Heimes added the comment:

Hi Pavel,

The issues in ASN1_PRINTABLE_type() [N2], BN_mask_bits() [N4 bn_lib.c,
digest.c, evp_enc.c], dh_cms_set_peerkey() [N5, dh_ameth.c] and
cms_env_set_version() [N6, cms_env.c] are all OpenSSL issues and should
be reported to OpenSSL. The Windows build system also builds a static version 
of OpenSSL and a couple of other dependencies.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue27587] Issues, reported by PVS-Studio static analyzer

2016-07-23 Thread Chris Angelico

Changes by Chris Angelico :


--
nosy: +Rosuav

___
Python tracker 

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



[issue26462] Patch to enhance literal block language declaration

2016-07-23 Thread Julien

Julien added the comment:

Hi,

Look like it has not been merged, is there something I can do to help with this?

Bests

--

___
Python tracker 

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



[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-07-23 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Does anyone know whether zoneinfo is installed on FreeBSD buildbot?  If it is, 
at which path?

> On Jul 23, 2016, at 7:24 AM, koobs  wrote:
> 
> 
> koobs added the comment:
> 
> Also failing on all freebsd buildbots, all tests failing with:
> 
> FileNotFoundError: [Errno 2] No such file or directory: 
> '/usr/share/zoneinfo/Iran'
> 
> --
> nosy: +koobs
> resolution: fixed -> 
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3005fc6cff8a by Steve Dower in branch '3.5':
Issue #27469: Adds a shell extension to the launcher so that drag and drop 
works correctly.
https://hg.python.org/cpython/rev/3005fc6cff8a

New changeset f56adb9800fa by Steve Dower in branch 'default':
Issue #27469: Adds a shell extension to the launcher so that drag and drop 
works correctly.
https://hg.python.org/cpython/rev/f56adb9800fa

--
nosy: +python-dev

___
Python tracker 

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



[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-23 Thread Steve Dower

Steve Dower added the comment:

Fixed. This should get out into the wild first with 3.6.0a4, and then 3.5.3[rc1]

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

___
Python tracker 

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



[issue1621] Do not assume signed integer overflow behavior

2016-07-23 Thread Xiang Zhang

Xiang Zhang added the comment:

Change tuple_and_list.patch with empty curly braces. I don't add the test for 
__length_hint__. According to the comment, when overflow happens, it is either 
ignored or a MemoryError will finally be raised. I am not willing to test a 
MemoryError in this case.

BTW, how do you get the error?

--
Added file: http://bugs.python.org/file43842/tuple_and_list_v2.patch

___
Python tracker 

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



[issue26823] Shrink recursive tracebacks

2016-07-23 Thread Emanuel Barry

Emanuel Barry added the comment:

After discussing with someone, I realized that the tests actually test the 
Python implementation twice, and never the C implementation (since I use 
traceback.print_exc() to "test" the C implementation).

I don't think it's possible to both catch the output from the C implementation 
and prevent it from exiting out of the function prematurely, but if anyone 
knows how to do that, be my guest! In the meantime, I'm going to mess about 
with _testcapi and see if I can add something there to help with this.

--

___
Python tracker 

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



[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-07-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e72aab080165 by Alexander Belopolsky in branch 'default':
Issue 24773: Make zoneinfo tests more robust.
https://hg.python.org/cpython/rev/e72aab080165

--

___
Python tracker 

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



[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-07-23 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> AssertionError: False is not true : Africa/El_Aaiun system_transitions

This may be an indication of misconfigured zoneinfo on the buildbot.  What 
system_transitions test does is compare the results obtained from the system 
timezone computations to the same computations using an explicitly loaded 
timezone.  This may fail if /usr/share/zoneinfo exists, but the system is using 
a different database.

Is there a way to troubleshoot the buildbot short of trying a series of hg 
commits?

--

___
Python tracker 

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



[issue27598] Add SizedIterable to collections.abc and typing

2016-07-23 Thread Brett Cannon

New submission from Brett Cannon:

See the discussion on python-ideas entitled "An ABC representing "Iterable, 
Sized, Container"".

--
components: Library (Lib)
messages: 271088
nosy: brett.cannon, gvanrossum
priority: normal
severity: normal
stage: test needed
status: open
title: Add SizedIterable to collections.abc and typing
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



[issue26823] Shrink recursive tracebacks

2016-07-23 Thread Emanuel Barry

Emanuel Barry added the comment:

Turns out there's already some functions in _testcapi that do this, great! 
Here's an updated patch actually testing the C implementation (and the tests 
pass, obviously :)

--
Added file: http://bugs.python.org/file43843/short_tracebacks_5.patch

___
Python tracker 

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



[issue27506] make bytes/bytearray delete a keyword argument

2016-07-23 Thread Xiang Zhang

Xiang Zhang added the comment:

LGTM. Using b'' instead of the None as the default value of *delete* looks 
better since it doesn't break backwards compatibility. As for the first 
argument optional or not, actually it's both okay. You have changed the doc 
accordingly.

--

___
Python tracker 

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



[issue26974] Crash in Decimal.from_float

2016-07-23 Thread Stefan Krah

Changes by Stefan Krah :


--
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

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



[issue27594] Assertion failure when running "test_ast" tests with coverage.

2016-07-23 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +benjamin.peterson, georg.brandl

___
Python tracker 

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



[issue27577] Make implementation and doc of tuple and list more compliant

2016-07-23 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks for replies. Attach a small documentation patch.

--
keywords: +patch
Added file: http://bugs.python.org/file43844/tuple_and_list_parameter_name.patch

___
Python tracker 

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



[issue27599] Buffer overrun in binascii

2016-07-23 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

There is reading one byte past the end of the input buffer in 
binascii.b2a_qp(). Following example shows the behavior difference depending on 
the value of this byte:

>>> binascii.b2a_qp(memoryview(b'..')[:-1])
b'.'
>>> binascii.b2a_qp(bytes(memoryview(b'..')[:-1]))
b'=2E'

In rare cases (memoryview of mmap object or custom buffer) this can cause a 
segfault.

Maybe there are similar issues with other binascii functions (not checked).

--
components: Extension Modules
messages: 271092
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Buffer overrun in binascii
type: behavior
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



[issue27600] None

2016-07-23 Thread Thanatas Pongpanotkorn

Changes by Thanatas Pongpanotkorn :


--
hgrepos: 350
nosy: xaxadmin
priority: normal
severity: normal
status: open
title: None

___
Python tracker 

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



[issue27600] None

2016-07-23 Thread Thanatas Pongpanotkorn

Changes by Thanatas Pongpanotkorn :


--
hgrepos:  -350

___
Python tracker 

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



[issue27600] None

2016-07-23 Thread Thanatas Pongpanotkorn

Changes by Thanatas Pongpanotkorn :


--
components: +Build, XML, email
nosy: +barry, r.david.murray
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



[issue27600] Spam

2016-07-23 Thread Emanuel Barry

Changes by Emanuel Barry :


--
components:  -Build, XML, email
nosy:  -barry, r.david.murray, xaxadmin
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
title: None -> Spam
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



[issue27271] asyncio lost udp packets

2016-07-23 Thread Yury Selivanov

Yury Selivanov added the comment:

> Can you prove that packets may be lost even in UNIX sockets ?
> (it is not related to this task directly)

Quoting wiki:

"""Like named pipes, Unix domain sockets support transmission of a reliable 
stream of bytes (SOCK_STREAM, compare to TCP). In addition, they support 
ordered and reliable transmission of datagrams (SOCK_SEQPACKET), or unordered 
and unreliable transmission of datagrams (SOCK_DGRAM, compare to UDP)."""

I'm also sure I saw that UDP can never be used as a reliable protocol in 
Stevens books.  (I'm sure you can google this too.)

--

___
Python tracker 

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



[issue27598] Add SizedIterable to collections.abc and typing

2016-07-23 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm thinking that it should be called Collection after all.

--Guido (mobile)

--

___
Python tracker 

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



[issue27575] dict viewkeys intersection slow for large dicts

2016-07-23 Thread David Su

David Su added the comment:

I am trying to implement the following algorithm:

http://blog.faroo.com/2012/06/07/improved-edit-distance-based-spelling-correction/

This algorithm is used for fast nearest neighbor queries for spell correction. 

Given a corpus of strings, for each string s, I generate all subsequences 
(Note: subsequence, not substring) of that string length (len(n) - k), call 
that subsequence t, where k is a tunable parameter. Then, I create a dict 
mapping the subsequences t to the original string s.

This process creates a very large dict from a relatively small corpus. For 
example, my corpus of ~500k strings blew up to a dict of ~10M keys, with k=3.

Then, for a query string q, you generate all subsequences of (len(q) - k), and 
perform an intersection with the keys of the dict. Then, the values of the dict 
corresponding to the key intersection will be possible misspelling of the query 
string q.

In pseudo-python:

def get_subseq(s: str, k: int):
returns all subsequences of s of length len(s) - k

def build_dict(corpus: List[str], k: int):
d = defaultdict(list)

for orig_str in corpus:
for subseq in get_subseq(orig_str, k):
d[subseq].append(orig_str)

return d

def query(d: dict, q: str, k:int):
q_subseq = set(get_subseq(q, k))
intersection = d.viewkeys() & q_subseq # this is slow when len(d) is large
return [orig_str for k in intersection for orig_str in d[k]]


By exposing an intersection interface, a certain degree of performance is 
expected by the user. It took me a considerable amount of debugging to realize 
that the dict.viewkeys() intersection was the performance bottleneck. I finally 
decided to dig into the CPython source code before discovering the root cause 
of the issue. While I am familiar with C and found the issue relatively 
quickly, for those that aren't, it should not be necessary to dig into the 
source code for a mainstream programming language like Python.


I am currently looking at how to potentially fix this in the CPython 
repository. I may submit a patch in the near future if I find a good solution.

--

___
Python tracker 

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



[issue27454] PyUnicode_InternInPlace can use PyDict_SetDefault

2016-07-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
stage: patch review -> commit review

___
Python tracker 

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



[issue27601] Minor inaccuracy in hash documentation

2016-07-23 Thread Aleksandr Koshkin

New submission from Aleksandr Koshkin:

https://docs.python.org/3.6/library/stdtypes.html#hashing-of-numeric-types
Look at semantics example for hash_complex function. The variable 'hash' is 
clearly misused - it is not defined or refers to builtin function 'hash'. 
Either way the example is incorrect.

--
assignee: docs@python
components: Documentation
messages: 271097
nosy: docs@python, magniff
priority: normal
severity: normal
status: open
title: Minor inaccuracy in hash documentation
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

> Certainly some of the requests for IDLE could be accommodated).

Steve, what did you have in mind here?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue27601] Minor inaccuracy in hash documentation

2016-07-23 Thread Aleksandr Koshkin

Aleksandr Koshkin added the comment:

Moreover this example contains following code
if hash_ == -1:
   hash_ == -2
return hash_
that doesn`t make too much sense.

--

___
Python tracker 

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



[issue15661] OS X installer packages should be signed for OS X 10.8 Gatekeeper feature

2016-07-23 Thread Ned Deily

Changes by Ned Deily :


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



[issue27601] Minor inaccuracy in hash documentation

2016-07-23 Thread Emanuel Barry

Emanuel Barry added the comment:

Indeed, nicely spotted! Patch attached (hash_complex_type_1.patch)

P.S.: I don't like the 'hash_' name as a variable for this example; it  looks 
like grit on Tim's monitor to me, so I went ahead and renamed it to 
'hash_value' in that block. Attached as a separate patch for good measure 
(hash_doc_renamed_1.patch)

--
keywords: +patch
nosy: +ebarry
stage:  -> patch review
versions:  -Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file43845/hash_complex_typo_1.patch

___
Python tracker 

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



[issue27601] Minor inaccuracy in hash documentation

2016-07-23 Thread Emanuel Barry

Changes by Emanuel Barry :


Added file: http://bugs.python.org/file43846/hash_doc_renamed_1.patch

___
Python tracker 

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



[issue27572] Support bytes-like objects when base is given to int()

2016-07-23 Thread Xiang Zhang

Xiang Zhang added the comment:

pypy seems so.

[PyPy 5.2.0-alpha0 with GCC 4.8.2] on linux
 int(memoryview(b'123A'[1:3]))
23
 int(memoryview(b'123 '[1:3]))
23

--

___
Python tracker 

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



[issue27601] Minor inaccuracy in hash documentation

2016-07-23 Thread Aleksandr Koshkin

Aleksandr Koshkin added the comment:

Thanks)

--
resolution:  -> fixed
versions: +Python 3.2, 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



[issue27601] Minor inaccuracy in hash documentation

2016-07-23 Thread Aleksandr Koshkin

Changes by Aleksandr Koshkin :


--
status: open -> closed

___
Python tracker 

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



[issue27490] Do not run pgen when it is not going to be used (cross-compiling)

2016-07-23 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +doko

___
Python tracker 

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



[issue27601] Minor inaccuracy in hash documentation

2016-07-23 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: docs@python -> mark.dickinson
nosy: +mark.dickinson

___
Python tracker 

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



[issue27601] Minor inaccuracy in hash documentation

2016-07-23 Thread SilentGhost

Changes by SilentGhost :


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

___
Python tracker 

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



[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-23 Thread Steve Dower

Steve Dower added the comment:

The "Edit in IDLE" submenu we implemented could be moved from a collection of 
registry keys into the shell extension, which would also let us detect all 
Python installations, as right now we only have 3.5 and later (we could even 
filter out those that are missing IDLE for whatever reason). We'd also be able 
to fully control launching it, so we could set the working directory properly 
and any environment variables that may be needed/helpful.

I believe we can also do other tricks like treating Shift+Click differently 
from a regular click, if that was any value (run in IDLE and leave the 
interactive session open, perhaps?).

--

___
Python tracker 

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



[issue27601] Minor inaccuracy in hash documentation

2016-07-23 Thread Emanuel Barry

Emanuel Barry added the comment:

Do note that nothing has been changed in the docs yet. I submitted the patch, 
and now other developers need to review it, decide whether it's correct or need 
modifications, and then someone needs to commit it. Let the bikeshedding start 
=)

--

___
Python tracker 

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



[issue26462] Patch to enhance literal block language declaration

2016-07-23 Thread Zachary Ware

Zachary Ware added the comment:

Hi Julien, there are still a few unanswered review comments.  Check the 
'review' link on 'issue26462_regen.diff' (which was your patch, I just 
recreated it in a format that our Rietveld review tool would accept).

--

___
Python tracker 

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



[issue19489] move quick search box above TOC

2016-07-23 Thread Zachary Ware

Zachary Ware added the comment:

The patch needs some work, as it stands it makes the 'Report a Bug' link 
disappear.  I haven't looked into it far enough to determine why.

For an alternative bikeshed color, would it be possible to put the quick search 
in the header, just left of the 'previous | next | modules | index' links?

--
nosy: +zach.ware
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



[issue27601] Minor inaccuracy in hash documentation

2016-07-23 Thread R. David Murray

R. David Murray added the comment:

Adding a _ after a keyword is a very common trick.  The fact that one got lost 
indicates that it isn't necessarily optimal :).  I don't really have an opinion 
one way or the other on the variable rename.

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



[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Having "Edit in IDLE' work uniformly for all installed versions would be great.

> set the working directory properly

This needs some discussion and coordination.  I am thinking of patching IDLE to 
switch to $HOME when cwd is the python install dir, but this would very likely 
only be done for 3.6 as part of re-writing the startup code.

> and any environment variables that may be needed/helpful.
Can't think of anything at the moment, but this has never been an option.

> treating Shift+Click differently from a regular click, if that was any value 
> (run in IDLE and leave the interactive session open, perhaps?).

IDLE's "-r file.py" runs the file and leaves Shell open.  I believe this is 
meant as a substitute for setting $IDLESTARTUP or $PYTHONSTARTUP and using -s.  
For development, one should open in the editor and hit f5.   There might be a 
controversy whether to run in IDLE or 'python -i'.  If control or alt click 
could be distinguished, both would be possible.

Are you going to open issues, or should I?

--

___
Python tracker 

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



[issue27601] Minor inaccuracy in hash documentation

2016-07-23 Thread Mark Dickinson

Mark Dickinson added the comment:

The changes look good to me. Thanks for spotting this!

--

___
Python tracker 

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



[issue27598] Add SizedIterable to collections.abc and typing

2016-07-23 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Does all of the recognition patterns in typing.py also need to be in 
collections.abc? 

AFAICT, the current collections.abc classes for Sized, Iterable, and Container 
almost never get used (possibly because they don't provide any useful mixin 
methods).  In the interest of maximizing the ratio of useful ABCs (like 
MutableMapping), could we defer expanding collections.abc until we've seen some 
real use cases?

--
nosy: +rhettinger

___
Python tracker 

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



[issue27602] Enable py launcher to launch repository Python.

2016-07-23 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Running a repository build by typing a path such as
  F:\Python\dev\36\PCbuild\win32\python_d.exe
is tedious and error prone and I have to remember to omit '\win32' for 2.7 and 
it takes up much of a command line.

I would like to be able to run something like
  py -register 3.6r   # 'r' for repository, or possibly '+'
and subsequently have
  py -3.6r
launch the locally compiled but un-installed binary.  Possible?

I did not find 'py launcher' in Expert's Index or Components, so selected you 
two from memory and 'Windows'.  Please modify Components and Nosy as 
appropriate.  I have an impression that there is a launcher version for Mac but 
know nothing about it.

--
components: Windows
messages: 27
nosy: paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware
priority: normal
severity: normal
stage: test needed
status: open
title: Enable py launcher to launch repository Python.
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue25170] 3.4.4, 3.4.5, 3.5.0, 3.5.1, 3.5.2 documentation archives missing

2016-07-23 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
title: 3.5.0 documentation archives missing -> 3.4.4, 3.4.5, 3.5.0, 3.5.1, 
3.5.2 documentation archives missing
versions: +Python 3.4

___
Python tracker 

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



[issue27598] Add SizedIterable to collections.abc and typing

2016-07-23 Thread Guido van Rossum

Guido van Rossum added the comment:

It would be a deviation from existing practice for a collection ABC to
exist in typing but not in collections.abc, and it would mean the
inheritance tree for the types in typing.py would be different from
that in collections.abc.

These ABCs, while not so useful by themselves, are building blocks for
the more useful ABCs. They also give people the right terminology.
That arguably is the biggest problem here -- it's clear that people
desperately want to be able to talk about the common API for sets and
sequences, which happens to be __len__, __iter__ and __contains__. But
it's also clear that people often believe that that common API is
called Iterable, which it isn't.

--

___
Python tracker 

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



[issue27602] Enable py launcher to launch repository Python.

2016-07-23 Thread Paul Moore

Paul Moore added the comment:

This sounds like 2 related items (but I'm happy for them both to be under this 
issue, I'm not suggesting we need 2 issues):

1. Allowing py -register to add PEP 514 metadata to the registry for the given 
path.
2. Allowing py - to use PEP 514 metadata more generally, rather than its 
current explicit registry scan.

I'm OK with both of these in principle. I'd suggest that (1) register under 
HKEY_CURRENT_USER (so that it doesn't need elevation, and so it's a per-user 
setting) and that it uses the PythonCore "Company" value (as it's a core 
CPython facility).

We might need an "unregister" option as well, to avoid leaving clutter in the 
registry, and maybe even some means of listing what's been registered. That may 
be overkill, and manual registry tidy-up may be fine (but the same could be 
said of -register).

There are other considerations, too - this should probably be solely for 
interactive invocations. I assume you wouldn't expect to support shebang lines 
like "#!python3.6r"?

I'm not likely to have time to work on this myself in the short term (my C 
skills are a bit rusty, TBH) but I'm happy to review patches, etc.

--

___
Python tracker 

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



[issue27602] Enable py launcher to launch repository Python.

2016-07-23 Thread Zachary Ware

Zachary Ware added the comment:

--register sounds interesting.  It could write to the user-specific py.ini, and 
would be useful for other things, like for `py --register pypy 
C:\pypy\pypy.exe`.  I've also thought it would be useful to be able to use 
py.exe directly to invoke interpreters configured in py.ini.

--

___
Python tracker 

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



[issue27602] Enable py launcher to launch repository Python.

2016-07-23 Thread Eryk Sun

Eryk Sun added the comment:

> I assume you wouldn't expect to support shebang lines 
> like "#!python3.6r"?

That's already supported in py.ini in the [commands] section, per PEP 397. I've 
used this from Vinay's initial releases on Bitbucket, before the launcher was 
officially distributed with Python. 

One catch is that commands can't start with "python" because that's 
special-cased in the launcher. Instead you could use the following:

[commands]
rpython3.6=F:\Python\dev\36\PCbuild\win32\python_d.exe

Then create a script with the shebang `#!rpython3.6 -i` that starts the REPL 
after it executes.

What's missing is a way to run custom commands directly from the py[w].exe 
command line. I wouldn't want to hog a letter such as "r" that a python.exe 
option could use someday (noting that command-line options can be combined like 
`-SORE`). But maybe it could use "--" or some other symbol to demarcate the 
command.

--
nosy: +eryksun

___
Python tracker 

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



[issue27602] Enable py launcher to launch repository Python.

2016-07-23 Thread Paul Moore

Paul Moore added the comment:

On 23 July 2016 at 23:01, Eryk Sun  wrote:
>> I assume you wouldn't expect to support shebang lines
>> like "#!python3.6r"?
>
> That's already supported in py.ini in the [commands] section, per PEP 397.

True, I'd forgotten that. I was meaning for interactive use, which as
you say isn't supported (I asked for it a long time back, but it was
rejected - maybe it's worth revisiting the idea, as I don't recall the
reason for the rejection).

Of course, having two places for launcher configuration, the registry
and the ini file, seems like it would be confusing. So that's an
argument for everything being controlled via the ini file. (BTW, the
documentation in
https://docs.python.org/3/using/windows.html#customization doesn't
give much detail about what can go in the ini file, maybe that needs
improving)

--

___
Python tracker 

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



[issue26462] Patch to enhance literal block language declaration

2016-07-23 Thread Julien

Julien added the comment:

Hi,

I completly missed the "review" link, sry. I reviewed comments, and I'm trying 
to provide an up-to-date patch that you'll hopefully won't have to doctor to 
make Rietveld eat it.

--
Added file: http://bugs.python.org/file43847/issue26462.diff

___
Python tracker 

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



[issue1621] Do not assume signed integer overflow behavior

2016-07-23 Thread Martin Panter

Martin Panter added the comment:

The error message comes from Undefined Behaviour Sanitizer, which was added to 
newer versions of GCC and Clang. Currently I am compiling with

./configure --with-pydebug CC="gcc -fsanitize=undefined -fno-sanitize=alignment 
-fno-sanitize=shift"

https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#index-fsanitize_003dundefined-962

I thought it is worth adding a test for the impossible __length_hint__() value. 
Since the test iterator returns no elements, there will not be a MemoryError, 
but if overflow detection is enabled (such as UB Sanitizer or -ftrapv), it is 
guaranteed to exercise the overflow path and would be detected.

--

___
Python tracker 

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



[issue19489] move quick search box above TOC

2016-07-23 Thread Ammar Askar

Ammar Askar added the comment:

Thank you for pointing that out to me, it completely slipped past.

It looks like the 'Report a Bug' link disappears because deprecated api is used 
in Doc/tools/templates/layout.html

{% block sidebarsourcelink %}
{% endblock %}

http://www.sphinx-doc.org/en/stable/templating.html#blocks

>The following four blocks are only used for pages that do not have
>assigned a list of custom sidebars in the html_sidebars config
>value"

I've amended the patch to fix this by using the way they recommend with a 
custom html_sidebar.


As far as putting it in the title bar goes, I think it's slightly more prone to 
breakage since we're essentially duplicating sphinx's searchbar code. It's easy 
enough to add it to the right of those links, there's a {% block relbaritems %} 
for that. Adding it to the left is slightly more complicated. Personally I like 
just pinning it to the top of the sidebar but I can look into that as well if 
you really want. 
https://github.com/sphinx-doc/sphinx/blob/master/sphinx/themes/basic/layout.html#L27-L46

--
Added file: http://bugs.python.org/file43848/searchbar.diff2

___
Python tracker 

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



[issue27546] Integrate tkinter and asyncio (and async)

2016-07-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Speed tests:
First -- raw loops/second.  The attached loopspeed.py has code for tk and 
asyncio that is equivalent as I know how.  The tkasync loop is for the asyncio 
loop with a root.update() call added, where the root is a fresh instance of 
Tk().  (Reusing the old root resulted in the tk loop restarting.)
  tcl/tk loop:  13300 l/s
  asyncio loop: 14900 l/s
  tkasync loop: 10900 l/s (uncomment commented lines)
The two bare loops have a std.dev. of roughly around 100, with +- up to 300.  
This suggests to me that the tcl loop might be written in tcl, not C.  This 
result reduces my motivation to write a tcl/tk based replacement for 
BaseEventLoop, thought I still might.

Second -- IDLE syntax highlighting speed.  I opened 9 idlelib files in 
installed 3.6.0a3 and patched repository 3.6.0a3+.  I switched between a light 
default and custom custom theme and hit apply.  For stock IDLE, it took 2 
subjective mental 'thousand and one...' counts.  For patched IDLE, three.  
Reducing the call_later delay from .01 to .001 reduced the count to about two 
and a half.  Replacing call_later with call_soon may have given a small further 
speedup.

Changing highlight theme (or changing font or font size, which trigger 
re-highlighting) with at least a few thousand lines of code to process, is 
sufficiently rare that a slowdown of 25% or less does not bother me.  When I 
want to try to experiment with using asyncio with IDLE, I will use the current 
patch until it proves not to work.  I am now thinking of this as perhaps just a 
doc issue.

--
Added file: http://bugs.python.org/file43849/loopspeed.py

___
Python tracker 

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



[issue27579] Add a tutorial for AsyncIO in the documentation

2016-07-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I would like the tutorial to include something like the following.

Adding Tkinter GUI to Asyncio Program
-

Assuming that the tkinter Tk instance is called 'root' and the asyncio loop is 
called 'loop', add the following callback loop.

def tk_update():
root.update()
loop.call_soon(tk_update)

Before each loop.run_forever() or loop.run_until_complete(...) call, add

tk_update()

Do not call root.mainloop() or root.quit().  Loop.stop() or completion of 
run_until_complete will stop the tk_update loop.
---

This is the result of my experiments in #27546.  One of my tests was running 
IDLE with an asyncio loop augmented with the above replacing root.mainloop.  I 
don't yet know how to work with git and github.

--

___
Python tracker 

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



[issue27602] Enable py launcher to launch repository Python.

2016-07-23 Thread Steve Dower

Steve Dower added the comment:

I think this is best written as:
* extend py.exe to handle PEP 514 properly
* write "PythonCore\dev36" (or equivalent - maybe "PythonDev\dev36"?) keys on 
each build

That way you could use "py -dev36" to get your latest build from source (actual 
tag open to bikeshedding).

Right now we write "python.bat" in the root of the source directory for the 
most recent build, so maybe that's a good enough workaround?

While I'd like to enable a "register" command, it's complicated enough and I 
suspect of limited value compared to directly editing the registry (or updating 
other interpreter's installers) that I'd rather not worry. A big part of the 
reason for PEP 514 is to be able to point other interpreters to it and say "do 
this and your users won't need to know where you installed everything".

--

___
Python tracker 

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



[issue27603] Migrate IDLE context menu items to shell extension

2016-07-23 Thread Steve Dower

New submission from Steve Dower:

Currently (on Windows) we register a set of subcommands in order to display an 
expanding list of versions of IDLE when users right-click a .py file.

With issue27469, a proper shell extension was added, which means we can now use 
IContextMenu to implement the menu rather than fixed registry keys. This would 
allow us to detect all installed versions of IDLE and present them without 
having to register new keys (i.e. forwards and backwards compatibility).

--
assignee: terry.reedy
components: IDLE, Windows
messages: 271123
nosy: paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware
priority: low
severity: normal
stage: needs patch
status: open
title: Migrate IDLE context menu items to shell extension
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue27603] Migrate IDLE context menu items to shell extension

2016-07-23 Thread Steve Dower

Steve Dower added the comment:

Another idea: we can also provide extra ("extended") commands when the user 
holds Shift and right-clicks a file. We could use this to add items to do "-r 
file.py" with IDLE, which would run the file with IDLE and leave the Shell open.

--

___
Python tracker 

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



[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-23 Thread Steve Dower

Steve Dower added the comment:

I just created issue27603 for any work that goes into adapting the IDLE context 
menu. Pretty good chance I'll get to look at it for 3.6.

--

___
Python tracker 

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



[issue27602] Enable py launcher to launch repository Python.

2016-07-23 Thread Steve Dower

Steve Dower added the comment:

> having two places for launcher configuration, the registry and the ini file, 
> seems like it would be confusing

My hope here is that the registry is "the place where all your Pythons are 
registered" and py.ini is "the place where settings for py.exe are kept".

By default (in time), py.exe will look through the registry at all your 
Pythons, but changes that should only affect py.exe go in its settings file.

--

___
Python tracker 

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



[issue27366] PEP487: Simpler customization of class creation

2016-07-23 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-07-23 Thread koobs

koobs added the comment:

I can help providing information on the koobs-* freebsd buildbots (I run them). 

In a default installation, the timezone entries are available in 
/usr/share/zoneinfo (see attachment for contents)

Iran is not in the root directory, 'Tehran' is in Asia/ subdirectory

tzsetup man page: https://www.freebsd.org/cgi/man.cgi?query=tzsetup&sektion=8

The misc/zoneinfo port/package [1] can be installed which overwrites entries in 
the above location.

The files this port/package installs are in the pkg-plist file:

https://svnweb.freebsd.org/ports/head/misc/zoneinfo/pkg-plist?view=log

There doesn't appear to be an 'Iran' entry in the root of this port/package 
either, so my guess is its a distribution specific location

[1] https://svnweb.freebsd.org/ports/head/misc/zoneinfo/

Beyond the above, tests should not fail (but skip) if the resources it requires 
are not available, so the change in e72aab080165 is welcome

--
Added file: 
http://bugs.python.org/file43850/koobs-freebsd-current-usr-share-zoneinfo.txt

___
Python tracker 

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



[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-07-23 Thread koobs

koobs added the comment:

See Also:

non standard (standard?) timezones.
https://lists.freebsd.org/pipermail/freebsd-hackers/2015-May/047765.html

I don't know to what extent these links are considered standard, but I'll talk 
to Julian about whether we can get these links installed in FreeBSD base (and 
the zoneinfo port/package). having said that, even if they can be/are added, 
the tests should still not expect them (blindly) to be available.

--

___
Python tracker 

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



[issue27366] PEP487: Simpler customization of class creation

2016-07-23 Thread Nick Coghlan

Nick Coghlan added the comment:

I started reviewing Martin's patch, and I initially thought I had found a 
problem with the way __init_subclass__ is currently defined. It turned out I 
was wrong about it actually being broken, but I *do* now think it's inherently 
confusing, and we may be able to do something different that's more obviously 
correct (or at least easier to document - it was proposing revisions to the 
documentation that got me thinking along this path).

Specifically, I was thinking using super() in either the zero argument form or 
the explicit form could create an infinite loop due to the way we're currently 
proposing to interact with the MRO. Consider:

class BaseClass:
@classmethod
def __init_subclass__(cls):
super(cls, BaseClass).__init_subclass__()

class SubClass(BaseClass):
pass

If the initial call made by type.__new__() is effectively 
"SubClass.mro()[1].__init_subclass__()", then the super() call is going to call 
BaseClass.__init_subclass__ again.

However, it turned out I was wrong, as that's not what happens: the call made 
by the type machinery is instead "super(SubClass, SubClass).__init_subclass__", 
which gets it to the right place in the MRO and causes further super() calls to 
do the right thing.

However, the "more obviously correct" signature that occurred to me was to do 
this instead:

class BaseClass:
@classmethod
def __init_subclass__(cls, subcls):
super(cls, BaseClass).__init_subclass__(subcls)

class SubClass(BaseClass):
pass

Then the invocation from type.__new__ could be defined more simply as:

SubClass.mro()[1].__init_subclass__(SubClass)

In all cases then (regardless of where you were in the MRO), "cls" would refer 
to "the class first in the MRO after the class being defined" and "subcls" 
would refer to "the class currently being defined".

If you consider the plugin example in the PEP, with the revised signature, it 
would look like:

class PluginBase:
subclasses = []

def __init_subclass__(cls, subcls, **kwargs):
super().__init_subclass__(**kwargs)
cls.subclasses.append(subcls)

And *even if the subclass being defined shadowed the "subclasses" attribute*, 
this initialisation would still work. (You can still get yourself in trouble if 
a subclass somewhere else in the MRO shadows the attribute, but that's life in 
complex type hierarchies)

In the version in the PEP, the fact that "cls" is actually a subclass, and 
we're relying on the MRO to find "subclasses" is a really subtle implementation 
detail, while having two parameters makes it clear that "the class defining 
__init_subclass__" is distinct from the "new subclass being defined".

--
nosy: +gvanrossum

___
Python tracker 

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



[issue734176] Make Tkinter.py's nametowidget work with cloned menu widgets

2016-07-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Issue18686 is reproducible to me. Here is a script based on issue18686 example. 
Run it and open the "File" menu.

$ python3 issue18686.py 
.#3069298188.#3069298188#3069298252
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1553, in __call__
return self.func(*args)
  File "issue18686.py", line 24, in entry_focus_lost
widget_with_focus = self.focus_get()
  File "/usr/lib/python3.5/tkinter/__init__.py", line 550, in focus_get
return self._nametowidget(name)
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1204, in nametowidget
w = w.children[n]
KeyError: '#3069298188'

But my patch doesn't help in case of tearoff menu. Detach the "File" menu and 
hover a mouse on its item.

$ ./python issue18686.py 
.#`menu.#`menu#`menu
.`menu.`menu
.tearoff1
Exception in Tkinter callback
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 1712, in __call__
return self.func(*args)
  File "issue18686.py", line 24, in entry_focus_lost
widget_with_focus = self.focus_get()
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 692, in focus_get
return self._nametowidget(name)
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 1344, in 
nametowidget
w = w.children[n]
KeyError: 'tearoff1'

--

___
Python tracker 

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



[issue734176] Make Tkinter.py's nametowidget work with cloned menu widgets

2016-07-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Following patch tries to handle the case when there are multiple clones  (but 
it doesn't help with tearoff menus).

--
Added file: http://bugs.python.org/file43851/nametowidget_clonedmenus_3.patch

___
Python tracker 

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



[issue734176] Make Tkinter.py's nametowidget work with cloned menu widgets

2016-07-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
type: enhancement -> behavior
versions: +Python 3.5, Python 3.6 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue27366] PEP487: Simpler customization of class creation

2016-07-23 Thread Nick Coghlan

Nick Coghlan added the comment:

Scratch that, my revised idea is fundamentally broken, as this example 
illustrates:

>>> class BaseClass: pass
... 
>>> class OtherClass: pass
... 
>>> class SubClass(OtherClass, BaseClass): pass
... 
>>> SubClass.mro()
[, , , ]


The PEP as written handles this correctly, while the alternative signature 
would fail miserably ("OtherClass" wouldn't chain up to "BaseClass" properly). 
So I'll review the rest of the patch, and we can figure out the documentation 
problem later.

--

___
Python tracker 

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



[issue27366] PEP487: Simpler customization of class creation

2016-07-23 Thread Nick Coghlan

Changes by Nick Coghlan :


--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue27581] Fix overflow check in PySequence_Tuple

2016-07-23 Thread Martin Panter

Martin Panter added the comment:

I don’t accept that the bltinmodule.c code is similar to your patch. It gets a 
size_t from calling strlen() on a string that potentially comes from outside 
Python, so it is definitely valid to check for PY_SSIZE_T_MAX.

However I did find PyByteArray_Resize() (revision 1590c594550e), where this 
technique of calculating in size_t and then checking for overflow is used. And 
also in your favour is the definition in Include/pyport.h which currently 
guarantees size_t can store up to double PY_SSIZE_T_MAX:

/* Largest positive value of type Py_ssize_t. */
#define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1))

So I am convinced there should be no real problem with your patch.

--

___
Python tracker 

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