[issue27581] Fix overflow check in PySequence_Tuple

2016-07-20 Thread Xiang Zhang

New submission from Xiang Zhang:

Overflow check in PySequence_Tuple relies on undefined behaviour, fix it.

--
components: Interpreter Core
files: overflow_check_in_PySequence_Tuple.patch
keywords: patch
messages: 270909
nosy: martin.panter, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: Fix overflow check in PySequence_Tuple
type: enhancement
versions: Python 2.7, Python 3.5, Python 3.6
Added file: 
http://bugs.python.org/file43806/overflow_check_in_PySequence_Tuple.patch

___
Python tracker 

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



[issue27580] CSV Null Byte Error

2016-07-20 Thread Bobby Ocean

New submission from Bobby Ocean:

I think this has been asked before, but it has been awhile and I think needs to 
be re-addressed. 

Why doesn't the CSV module handle NULL bytes? 

Let me do some examples, 

ascii = [chr(n) for n in range(256)] #No errors
print(ascii) #No errors
print(dict(zip(ascii,ascii))) #No errors

open('temp','r').writelines(ascii) #No errors
f=open('temp','r')
for line in f: print(line) #No errors
f.close()

Python hsndles every ascii chr, DEL, ESC, RETURN, etc. It displays those 
characters, uses them as keys or values, etc. 

But now try, 

import csv
data = csv.DictReader(ascii) 
for line in data: print(line) #NULL Byte Error

But we can quick fix this easily, 

ascii.pop(0)
data = csv.DictReader(ascii)
for line in data: print(line) #No Errors

Doesn't it seem odd that we allow the use of every chr as keys, vslues, prints, 
etc. but then we hold a special exception for using the csv module and yhat 
special exception is not the ESC or DEL or any other non-printable chr, the 
exception is for the NULL?

--
components: Extension Modules
messages: 270908
nosy: bobbyocean
priority: normal
severity: normal
status: open
title: CSV Null Byte Error
type: enhancement
versions: Python 3.5

___
Python tracker 

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



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

2016-07-20 Thread Xiang Zhang

Xiang Zhang added the comment:

Hi, Martin. I replied your last comment and your patch looks good to me except 
one test fails:

[1/1] test_zlib
test_abcdefghijklmnop (test.test_zlib.ChecksumTestCase)
test issue1202 compliance: signed crc32, adler32 in 2.x ... ok
test_adler32empty (test.test_zlib.ChecksumTestCase) ... ok
test_adler32start (test.test_zlib.ChecksumTestCase) ... ok
test_crc32empty (test.test_zlib.ChecksumTestCase) ... ok
test_crc32start (test.test_zlib.ChecksumTestCase) ... ok
test_negative_crc_iv_input (test.test_zlib.ChecksumTestCase) ... ok
test_penguins (test.test_zlib.ChecksumTestCase) ... ok
test_same_as_binascii_crc32 (test.test_zlib.ChecksumTestCase) ... ok
test_big_buffer (test.test_zlib.ChecksumBigBufferTestCase) ... ERROR
test_badcompressobj (test.test_zlib.ExceptionTestCase) ... ok
test_baddecompressobj (test.test_zlib.ExceptionTestCase) ... ok
test_badlevel (test.test_zlib.ExceptionTestCase) ... ok
test_decompressobj_badflush (test.test_zlib.ExceptionTestCase) ... ok
test_overflow (test.test_zlib.ExceptionTestCase) ... ok
test_64bit_compress (test.test_zlib.CompressTestCase) ... ok
test_big_compress_buffer (test.test_zlib.CompressTestCase) ... ok
test_big_decompress_buffer (test.test_zlib.CompressTestCase) ... ok
test_custom_bufsize (test.test_zlib.CompressTestCase) ... ok
test_incomplete_stream (test.test_zlib.CompressTestCase) ... ok
test_large_bufsize (test.test_zlib.CompressTestCase) ... ok
test_speech (test.test_zlib.CompressTestCase) ... ok
test_speech128 (test.test_zlib.CompressTestCase) ... ok
test_64bit_compress (test.test_zlib.CompressObjectTestCase) ... ok
test_badcompresscopy (test.test_zlib.CompressObjectTestCase) ... ok
test_baddecompresscopy (test.test_zlib.CompressObjectTestCase) ... ok
test_big_compress_buffer (test.test_zlib.CompressObjectTestCase) ... ok
test_big_decompress_buffer (test.test_zlib.CompressObjectTestCase) ... ok
test_clear_unconsumed_tail (test.test_zlib.CompressObjectTestCase) ... ok
test_compresscopy (test.test_zlib.CompressObjectTestCase) ... ok
test_compressincremental (test.test_zlib.CompressObjectTestCase) ... ok
test_compressoptions (test.test_zlib.CompressObjectTestCase) ... ok
test_compresspickle (test.test_zlib.CompressObjectTestCase) ... ok
test_decompimax (test.test_zlib.CompressObjectTestCase) ... ok
test_decompinc (test.test_zlib.CompressObjectTestCase) ... ok
test_decompincflush (test.test_zlib.CompressObjectTestCase) ... ok
test_decompress_incomplete_stream (test.test_zlib.CompressObjectTestCase) ... ok
test_decompress_unused_data (test.test_zlib.CompressObjectTestCase) ... ok
test_decompresscopy (test.test_zlib.CompressObjectTestCase) ... ok
test_decompressmaxlen (test.test_zlib.CompressObjectTestCase) ... ok
test_decompressmaxlenflush (test.test_zlib.CompressObjectTestCase) ... ok
test_decompresspickle (test.test_zlib.CompressObjectTestCase) ... ok
test_empty_flush (test.test_zlib.CompressObjectTestCase) ... ok
test_flush_custom_length (test.test_zlib.CompressObjectTestCase) ... ok
test_flush_large_length (test.test_zlib.CompressObjectTestCase) ... ok
test_flush_with_freed_input (test.test_zlib.CompressObjectTestCase) ... ok
test_flushes (test.test_zlib.CompressObjectTestCase) ... ok
test_large_unconsumed_tail (test.test_zlib.CompressObjectTestCase) ... ok
test_large_unused_data (test.test_zlib.CompressObjectTestCase) ... ok
test_maxlen_custom (test.test_zlib.CompressObjectTestCase) ... ok
test_maxlen_large (test.test_zlib.CompressObjectTestCase) ... ok
test_maxlenmisc (test.test_zlib.CompressObjectTestCase) ... ok
test_odd_flush (test.test_zlib.CompressObjectTestCase) ... ok
test_pair (test.test_zlib.CompressObjectTestCase) ... ok
test_wbits (test.test_zlib.CompressObjectTestCase) ... ok

==
ERROR: test_big_buffer (test.test_zlib.ChecksumBigBufferTestCase)
--
Traceback (most recent call last):
  File "/usr/home/zhangxiang3/Python-2.7.12/Lib/test/test_support.py", line 
1348, in wrapper
return f(self, maxsize)
  File "/usr/home/zhangxiang3/Python-2.7.12/Lib/test/test_zlib.py", line 90, in 
test_big_buffer
ChecksumTestCase.assertEqual32(self, zlib.crc32(data), 1044521549)
TypeError: unbound method assertEqual32() must be called with ChecksumTestCase 
instance as first argument (got ChecksumBigBufferTestCase instance instead)

--
Ran 54 tests in 317.008s

FAILED (errors=1)
test test_zlib failed -- Traceback (most recent call last):
  File "/usr/home/zhangxiang3/Python-2.7.12/Lib/test/test_support.py", line 
1348, in wrapper
return f(self, maxsize)
  File "/usr/home/zhangxiang3/Python-2.7.12/Lib/test/test_zlib.py", line 90, in 
test_big_buffer
ChecksumTestCase.assertEqual32(self, zlib.crc32(data), 1044521549)
TypeError: unbound method assertEqual32() must be called with ChecksumTestCase 
instance as first argument 

[issue27575] dict viewkeys intersection slow for large dicts

2016-07-20 Thread David Su

David Su added the comment:

Here are some tests that I ran:


Using current naive viewkeys intersection:

$ python -m timeit -n 100 -s "d = dict.fromkeys(xrange(1000), 0)" 
"d.viewkeys() & {0}"
100 loops, best of 3: 447 msec per loop

Nearly half a second per iteration is unacceptably slow.



Solution 1 from my previous comment:

$ python -m timeit -n 100 -s "d = dict.fromkeys(xrange(1000), 0); s = 
set(d)" "s & {0}"
100 loops, best of 3: 0.391 usec per loop

This solution caches the keys of the dict in a set, then performs all 
intersections on that set. 
The initial creation of the set is slow, and it wastes a lot of memory, but 
each iteration is much faster.



The workaround that I ended up using:

$ python -m timeit -n 100 -s "d = dict.fromkeys(xrange(1000), 0)" "{item 
for item in {0} if item in d}"
100 loops, best of 3: 0.629 usec per loop

This solution just looks up each value in the set to see if it is also in the 
dict using a set comprehension.
This avoids wasting time and space on creating a set. For my use case, memory 
was a bigger issue as my dictionary can approach tens of GBs in size, and 
almost doubling the memory consumption from creating a cache set was 
unacceptable. 

Of course, in the set comprehension, the smaller of the dict/set should be 
iterated over to satisfy the O(min(len(d), len(s))) condition as specified in 
https://wiki.python.org/moin/TimeComplexity.
A implementation would look something like this:

def efficient_intersection(smaller_dict_or_set, bigger_dict_or_set):
if len(bigger_dict_or_set) < len(smaller_dict_or_set):
bigger_dict_or_set, smaller_dict_or_set = smaller_dict_or_set, 
bigger_dict_or_set

return {item for item in smaller_dict_or_set if item in bigger_dict_or_set}




In conclusion, porting over the set intersection logic to viewkeys would be the 
ideal solution. It avoids wasting memory like in the set cache solution, and I 
am sure the C implementation will be much faster than my workaround of manually 
performing an intersection using set comprehensions.

My view is that dict.viewkeys() & set(...) should be as performant as the 
syntax suggests.

--

___
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-20 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, sets and dicts convert back and forth very efficiently (the hash values 
are reused and the collection is presized with just a single memory 
allocation).  Also, the sets and dicts have shared pointers to the underlying 
data (which is often much bigger than the containers that refers to the data).

Also, the use case of having very large dicts with repeated intersection 
operations isn't common enough to warrant any significant code expansion (your 
solution two).   

I don't understand your "solution one".  PySet_New(self) does copy references 
to the keys from the dict to a set and the intersection_update() does perform 
operations on that set.

Lastly, since there was no clear example given, there isn't an opportunity to 
look at it to see if the code would have been better designed to simply use 
sets for the set operations and keep the dict around to the key to value 
transformations (in other words, the current toolset may already afford some 
way to accomplish the goal).

--
versions:  -Python 2.7, 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



[issue26662] configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc

2016-07-20 Thread Martin Panter

Martin Panter added the comment:

The new patch looks good enough.

The main reason I complained about the error message is that it sounds like you 
need Python in order to build Python. Obviously you need Python to run a 
modified file like typeslots.py, but there is supposed to be an alternative if 
you don’t need to regenerate files. I think running “make touch” should fudge 
the timestamps so that Make does not run it. It works for me:

$ touch Objects/typeslots.py
$ make touch
cd .; \
hg --config extensions.touch=Tools/hg/hgtouch.py touch -v
Touching Objects/typeslots.inc
$ make  # Does not run typeslots.py
gcc [. . .] Objects/typeobject.c
[. . .]

Unfortunately, I understand “make touch” requires Mercurial, which requires 
Python 2. That weakens my argument about bootstrapping Python, but it is still 
valid in some scenarios. Maybe we should recommend “make -t 
Objects/typeslots.inc” etc instead of “make touch”.

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



[issue15786] IDLE code completion window can hang or misbehave with mouse

2016-07-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Serhiy, could you take at least a quick look at this troublesome issue?  The 
issue seems to be this: idlelib.autocomplete_w.py has

# at the top
LISTUPDATE_SEQUENCE = ""

# within show_window method
self.listupdateid = listbox.bind(LISTUPDATE_SEQUENCE,
 self.listselect_event)
# and later
def listselect_event(self, event):

However, when one clicks on a completion box, the click is only seen by the 
text window underneath, and the box disappears.  On Mac, there are also nasty 
symptoms like IDLE freezing.  I that changing the sequence to '' and 
addint 'return "break"' to the end of listselect_event might solve the problem. 
 When it did not, I added prints to the top of __init__ and listselect_event.  
Running in the console, the first printed, the second did not.  Do you have any 
idea why not?

--
nosy: +serhiy.storchaka

___
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-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Serhiy, if you are sure your patch is an improvement, then I think you should 
commit it without waiting for perfection.

Only the other hand, #18686 does not demonstrate a problem *to me* as it does 
not fail for me.  Does anyone else reproduce the failure on a current 
non-Windows system?  Based just on what I can see, I would be inclined to close 
this.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-20 Thread Martin Panter

Martin Panter added the comment:

I think I misunderstood the Windows situation. Now I understand Windows has no 
lower-case variable names, so this patch would stop accepting any HTTP_PROXY 
variable there (in CGI mode). But that is okay by me.

I agree the mixed-case scenario is not worth worrying too much about. The 
normal scenario is all lowercase (http_proxy), and I think all-uppercase 
(HTTP_PROXY) is only supported for compatibility with some older browsers or 
OSes (can’t remember the details). However, since we already document “a 
case-insensitive approach”, perhaps it needs tweaking somehow. Perhaps it would 
be more correct to say, in CGI mode:

* Only lowercase _proxy suffix is accepted (stricter than just ignoring 
uppercase)
* No variable is accepted where names must be uppercase, i.e. Windows. As I 
understand it, you cannot have a lowercase http_proxy variable there.

Also, I think the “note” additions should be indented under the getproxies() 
etc headings. (Or drop the markup and make it an ordinary sentence or 
paragraph. “Note that” is also redundant IMO.)

--

___
Python tracker 

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



[issue17310] Ctypes callbacks shows problem on Windows Python (64bit)

2016-07-20 Thread Patrick Stewart

Patrick Stewart added the comment:

This also fixes python 3.5

--
nosy: +Patrick Stewart

___
Python tracker 

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



[issue9618] IDLE shell ignores all but first statement

2016-07-20 Thread irdb

Changes by irdb :


--
nosy: +irdb

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-07-20 Thread Martin Panter

Martin Panter added the comment:

Mathieu: Maybe you haven’t seen some of the comments on your older patches. 
E.g. my comment on fromisoformat4.patch about improper use of “with 
self.assertRaises(...)” still stands.

Also, adding some documentation to the patch might help the likes of Anders 
figure out the scope of the change. I think we decided to parse RFC 3339’s 
“internet date and time format” profile of ISO 8601 with the date, time, and 
datetime classes, including tolerating arbitrary resolutions of fractions of 
seconds in the time, and parsing time zones.

I don’t think we need to test every combination of the other ISO 8601 formats. 
There are already a couple of negative tests. Are there any in particular you 
think are important to add?

--

___
Python tracker 

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



[issue16198] IDLE - tabbing in a string always brings up file completion window

2016-07-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

It is intentional that   be treated as a normal tab.  The 
autocomplete_event tab handler begins with
if hasattr(event, "mc_state") and event.mc_state:
# A modifier was pressed along with the tab, continue as usual.
return

To fix the problem with tabs at the beginning of a line within multiline 
strings, I am adding to the condition a clause to catch tabs at the beginning 
of lines, whether within a multiline string or not.

or not self.text.get("insert linestart", "insert").strip()

Tests still pass with this addition.  I need to add a test that fails without 
it.

I think a tab should bring up completion box even immediately after an opening 
quote, as in
open('
Typing a letter fails to open a box if there is only one completion, so that is 
not a foolproof way to get a box with all choices.

--

___
Python tracker 

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



[issue3559] IDLE: Pasted newline doesn't trigger execution when typed newline would

2016-07-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

My initial experiments indicate that pasted tabs are at least sometimes treated 
differently, but I need to do more to be sure.

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



[issue23951] Update devguide style to use a similar theme as Docs

2016-07-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7d8f988522ed by Victor Stinner in branch 'default':
Issue #23951: remove devguide_theme_revised.patch
https://hg.python.org/devguide/rev/7d8f988522ed

--

___
Python tracker 

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



[issue23951] Update devguide style to use a similar theme as Docs

2016-07-20 Thread STINNER Victor

STINNER Victor added the comment:

Berker Peksag
> -1. I think the current devguide theme looks fine and it would be nice to 
> keep devguide and Python documentations use different themes.

I pushed the change because there were 3 positive votes and no negative vote, 
and I like the proposed them.


> I'd be -0 if the patch was small, but diff stat "11 files changed, 1651 
> insertions(+), 10 deletions(-)" is huge and it would be nice to avoid  code 
> duplication. The current theme has some bugs and now we will have to update 
> two different repos everytime we touch the docs.p.o theme.

Sorry but I don't know anything about Sphinx theme. If you know how to fix 
mentionned issues, please write a patch and/or push directly changes.


> It seems like devguide_theme_revised.patch was committed accidentally: 
> https://hg.python.org/devguide/rev/9e7b1bc15ba7#l3.3

What do you mean? It was deliberate for me to push 
devguide_theme_revised.patch. I don't see strong reason in comments to not push 
the change.


> I'd also delete rstllint.py.

It adds a new "make check" which doesn't hurt.

Maybe it may be better to contribute to Sphinx, but again, it's short and 
doesn't hurt.

--

___
Python tracker 

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



[issue27569] Windows install problems

2016-07-20 Thread Ricardo Esperanza

Ricardo Esperanza added the comment:

Steve
 I tried again an installed correctly. Don´t understand what happened, but 
anyway it installed

thanks

--

___
Python tracker 

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



[issue27569] Windows install problems

2016-07-20 Thread Steve Dower

Steve Dower added the comment:

That time it looks like it failed to install the launcher for all users. Did 
you get an elevation prompt?

--

___
Python tracker 

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



[issue27294] Better repr for Tkinter event objects

2016-07-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Addendum: I verified flag 8 is Mod1 is Numlock on Windows.  
http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/event-handlers.html has table 
that claims that 8 is Left Alt and that 16 is NumLock. From what you say above, 
true on non-mac *nix, and only there.

Flag 32 is Mod3 = Scrolllock on Windows.

Question: autocomplete.py refers to event.mc_state in

if hasattr(event, "mc_state") and event.mc_state:
# A modifier was pressed along with the tab, continue as usual.
return

It is not mentioned as an event field in either the NMT ref or 
http://www.tcl.tk/man/tcl8.6/TkCmd/event.htm#M29.  However, it seems to be the 
state minus any 'lock' flags, Nun/Caps/Scrolllock on Windows.  It must use a 
system-specific mask.  The only Google hit for "tk event mc_state" is my recent 
commit of test_autocomplete.py.  Is this a normal tk event attribute or a local 
addition?

There is also mc_type, which is 0 for a tab combinations.

--

___
Python tracker 

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



[issue27294] Better repr for Tkinter event objects

2016-07-20 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
Removed message: http://bugs.python.org/msg268826

___
Python tracker 

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



[issue27294] Better repr for Tkinter event objects

2016-07-20 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
Removed message: http://bugs.python.org/msg268824

___
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-20 Thread David Su

Changes by David Su :


--
nosy: +rhettinger

___
Python tracker 

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



[issue21136] fractions.Fraction.__pow__ does unneeded renormalization

2016-07-20 Thread Ned Deily

Ned Deily added the comment:

I now see Vedran has already opened Issue27539 for this.  Sorry for the 
additional noise.

--

___
Python tracker 

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



[issue27576] An unexpected difference between dict and OrderedDict

2016-07-20 Thread Alakshendra Yadav

Changes by Alakshendra Yadav :


--
nosy: +alakyadav

___
Python tracker 

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



[issue21136] fractions.Fraction.__pow__ does unneeded renormalization

2016-07-20 Thread Ned Deily

Ned Deily added the comment:

@Vedran, the original issue is closed and the code for it already released.  
Please open a new issue referencing this one, otherwise your comments here will 
likely be forgotten.

--
nosy: +ned.deily
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



[issue27574] Faster parsing keyword arguments

2016-07-20 Thread Brett Cannon

Brett Cannon added the comment:

I haven't reviewed the patch, but the idea is great as I know one of Larry's 
hopes of using Argument Clinic was to allow for this kind of speed-up.

--
nosy: +brett.cannon, larry

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2016-07-20 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I've seen a similar glitch. Reloading the page usually fixes the problem. 

> On Jul 20, 2016, at 11:37 AM, Steve Holden  wrote:
> 
> 
> Steve Holden added the comment:
> 
> BTW, I presume it's a bug in the issue tracker that my view of this message 
> ends after a few lines of msg166386? Makes it rather difficult to track the 
> issue!
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
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-20 Thread Ludovic Gasc

Changes by Ludovic Gasc :


--
nosy: +Ludovic.Gasc

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2016-07-20 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2016-07-20 Thread R. David Murray

R. David Murray added the comment:

I doubt it is a bug in the tracker.  I've seen that kind of thing when I am 
having network issues...the browser renders what it gets, and if it doesn't get 
it all it looks like the page ends early.

--

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2016-07-20 Thread Tim Peters

Tim Peters added the comment:

FYI, I'm seeing the same kind of odd truncation Steve sees - but it goes away 
if I refresh the page.

--

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2016-07-20 Thread Steve Holden

Steve Holden added the comment:

BTW, I presume it's a bug in the issue tracker that my view of this message 
ends after a few lines of msg166386? Makes it rather difficult to track the 
issue!

--

___
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-20 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue23951] Update devguide style to use a similar theme as Docs

2016-07-20 Thread Berker Peksag

Berker Peksag added the comment:

Can we at least serve images and JS files (py.png -- this gives 404 now, 
copybutton.js, sidebar.js) from docs.python.org?

It seems like devguide_theme_revised.patch was committed accidentally: 
https://hg.python.org/devguide/rev/9e7b1bc15ba7#l3.3

The color of a:hover needs to be tweaked here: 
https://dl.dropboxusercontent.com/u/166024/devguide.png

I'd also delete rstllint.py.

--

___
Python tracker 

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



[issue8406] Make some setup.py paths exclude-able

2016-07-20 Thread Carol Willing

Carol Willing added the comment:

Fair enough.

Ronald and David, I respect your suggestions and thoughts, and I will not 
triage or close old issues. FWIW, I was trying to be helpful. We regularly 
close issues that are 1+ year old on Jupyter/IPython or rescope the issue to be 
actionable for contribution.

--

___
Python tracker 

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



[issue8406] Make some setup.py paths exclude-able

2016-07-20 Thread R. David Murray

R. David Murray added the comment:

Heh, that should have been "only close an old issue that hasn't been otherwise 
resolved if...".

--

___
Python tracker 

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



[issue8406] Make some setup.py paths exclude-able

2016-07-20 Thread R. David Murray

R. David Murray added the comment:

Right.  Only close an issue if there is an existing open issue that addresses 
the topic better.  Age alone is never a criteria for closing issues.

Since Ronald agrees the other issue is enough we'll leave this closed, but it 
wouldn't be crazy to reopen it either.

--

___
Python tracker 

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



[issue23951] Update devguide style to use a similar theme as Docs

2016-07-20 Thread R. David Murray

R. David Murray added the comment:

I think a reasonably consistent look and feel for all our docs is a good thing. 
 It's a "branding" kind of thing.  Differentiation by color works for me, but 
really I don't care about differentiating them, myself.  (I actually find it 
jarring that I don't get a table of contents as the main page, like I do in the 
rest of our docs.)

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



[issue8406] Make some setup.py paths exclude-able

2016-07-20 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Did you create that new issue? If not this feature request will likely be 
forgotten.  

Hmmm... Issue7713 appears to be good enough for remembering that there is a 
problem with the way setup.py looks for libraries.

--

___
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-20 Thread Yury Selivanov

Yury Selivanov added the comment:

I guess someone has to step forward -- i can propose an initial patch with the 
tutorial.

--

___
Python tracker 

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



[issue8406] Make some setup.py paths exclude-able

2016-07-20 Thread Carol Willing

Carol Willing added the comment:

Ronald, while I may have closed this issue prematurely in other folks' view, I 
did not do so without thought or reflecting if the issue was relevant.

My recommendation to close the issue was based on several factors:

- the desire to assist triaging issues that are not actionable in their current 
state

- the lack of activity for over 6 years on an overly broad issue topic

- an opportunity for a more suitable issue to be opened which more accurately 
reflects the development needed and actions needed

- this issue's history, if necessary, could easily be referred to in a better 
scoped issue

Overall, I see closing this issue as an opportunity to address in a new issue 
the specific setup.py improvements that would be helpful today.

--

___
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-20 Thread Stéphane Wirtel

New submission from Stéphane Wirtel:

The documentation of AsyncIO is well written for a developer, but it's a 
reference. We have the description of all the methods, classes, etc...

But we want to learn to develop with AsyncIO, it's difficult, because there is 
no many examples in this reference and we have to look for some examples on 
Internet.

Could we add a AsyncIO tutorial|cookbook|howto ? because we have a "Logging 
Cookbook" but not a "AsyncIO 101".

Thank you

Stephane

--
assignee: docs@python
components: Documentation
messages: 270876
nosy: asvetlov, docs@python, haypo, matrixise, yselivanov
priority: normal
severity: normal
status: open
title: Add a tutorial for AsyncIO in the documentation
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



[issue23951] Update devguide style to use a similar theme as Docs

2016-07-20 Thread Carol Willing

Carol Willing added the comment:

Lisa, thanks for your work and persistence on this patch. In particular, the 
pydoctheme's sidebar improves the user's ability to navigate through the 
devguide's content. Thank you!

If folks desire more distinction between the devguide and the language docs, 
color and styling could be tweaked in a future patch or PR.

--

___
Python tracker 

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



[issue13376] readline: pre_input_hook not getting called

2016-07-20 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The problem with fixing in editline is that Apple ships a copy of editline and 
that is used when build CPython by default.

IMHO it would be acceptable to work around this in the readline extension if 
that can be done in a clean way.

--

___
Python tracker 

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



[issue8406] Make some setup.py paths exclude-able

2016-07-20 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I don't understand why this issue was closed. Apparently it was closed because 
it is an old issue without checking if the issue is still relevant???

To be honest the way setup.py looks for libraries could use some attention, the 
current methods is a bit too magical to my taste. It is also too easy to 
accidentally depend on libraries you don't want to rely on (I have to create 
CPython builds for internal redistribution on a separate VM to avoid relying on 
HomeBrew).

P.S. Sorry about the late reaction, the bug tracker mails about this came in 
just before I went on a trip. I'm finally catching up with older mail.

--

___
Python tracker 

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



[issue23951] Update devguide style to use a similar theme as Docs

2016-07-20 Thread Berker Peksag

Berker Peksag added the comment:

-1

I think the current devguide theme looks fine and it would be nice to keep 
devguide and Python documentations use different themes.

I'd be -0 if the patch was small, but diff stat "11 files changed, 1651 
insertions(+), 10 deletions(-)" is huge and it would be nice to avoid  code 
duplication. The current theme has some bugs and now we will have to update two 
different repos everytime we touch the docs.p.o theme.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue27578] inspect.findsource raises exception with empty __init__.py

2016-07-20 Thread R. David Murray

R. David Murray added the comment:

I agree that this is inconsistent.  It might be quite tricky to fix, though, 
unless we special case file.endswith('__init__.py'), which feels like a hack.  
But maybe it is appropriate.

--
nosy: +r.david.murray
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



[issue20932] Undefined behavior flagged by Clang 3.4 (Python 3.5 from hg)

2016-07-20 Thread Martin Panter

Martin Panter added the comment:

Serhiy’s patch does fix about half the errors (1 whole screenful reduces to a 
bit over 1/2 a screenful). I do find it a bit ugly though (four casts in the 
one term of a macro!).

--

___
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-20 Thread Martin Panter

Martin Panter added the comment:

Serhiy: slice-step.patch seems to be fine with negative slice steps. The actual 
indexes are still positive, and “unsigned” arithmetic is really modular 
arithmetic, so when you add the negative “unsigned” step value, it decrements 
the index properly.

Antti: if you use the sanitizer, (almost?) all the shift errors are for left 
shifts, either of a positive signed overflow, or a negative value. There is a 
bit more discussion of bit shift errors in Issue 20932. Examples:

Modules/audioop.c:1527:43: runtime error: left shift of negative value -24
Objects/unicodeobject.c:5152:29: runtime error: left shift of 255 by 24 places 
cannot be represented in type 'int'

I didn’t see any sanitizer reports about right shifts; perhaps it doesn’t 
report those (being implemenation-defined, rather than undefined, behaviour). 
And the only report about an excessive shift size is due to a known bug in 
ctypes, Issue 15119.

--

___
Python tracker 

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



[issue14903] dictobject infinite loop in module set-up

2016-07-20 Thread Max Khon

Max Khon added the comment:

I reproduced the problem with Python 2.7.5 as shipped with CentOS 7:

root@192.168.0.86 /home/padmin # python -V
Python 2.7.5
root@192.168.0.86 /home/padmin # rpm -q python
python-2.7.5-34.el7.x86_64
root@192.168.0.86 /home/padmin # 

(gdb) bt
#0  lookdict_string (mp=, key='RPMTAG_OPTFLAGS', 
hash=411442822543039667)
at /usr/src/debug/Python-2.7.5/Objects/dictobject.c:461
#1  0x7f92d6d9f2c9 in insertdict (mp=0x2502600, key='RPMTAG_OPTFLAGS', 
hash=411442822543039667, 
value=1122) at /usr/src/debug/Python-2.7.5/Objects/dictobject.c:559
#2  0x7f92d6d9f3b0 in dict_set_item_by_hash_or_entry (
op={'RPMTAG_HEADERREGIONS': 64, 'RPMTAG_EXCLUSIVEOS': 1062, 'fi': , 'RPMTAG_CHANGELOGNAME': 1081, 'RPMTAG_CONFLICTNEVRS': 
5044, 'RPMTAG_FILECAPS': 5010, 'RPMTAG_FILERDEVS': 1033, 'RPMTAG_COLLECTIONS': 
5029, 'RPMTAG_BUGURL': 5012, 'setStats': , 
'RPMTAG_FILEDIGESTALGO': 5011, 'RPMTAG_DEPENDSDICT': 1145, 'RPMTAG_CLASSDICT': 
1142, 'RPMTAG_FILEMODES': 1030, 'RPMTAG_FILEDEPENDSN': 1144, 
'RPMTAG_BUILDTIME': 1006, 'ii': , 
'RPMTAG_INSTALLCOLOR': 1127, 'RPMTAG_CHANGELOGTEXT': 1082, 
'RPMTAG_HEADERCOLOR': 5017, 'RPMTAG_CONFLICTNAME': 1054, 'RPMTAG_CONFLICTS': 
1054, 'setLogFile': , 'versionCompare': , 'RPMTAG_CONFLICTVERSION': 1055, 'RPMTAG_NVRA': 1196, 
'RPMTAG_NOPATCH': 1052, 'RPMTAG_HEADERI18NTABLE': 100, 
'RPMTAG_LONGARCHIVESIZE': 271, 'RPMTAG_FILEREQUIRE': 5002, 
'RPMTAG_FILEDEPENDSX': 1143, 'RPMTAG_EVR': 5013, 'RPMTAG_INSTALLTIME': 1008, 
 'RPMTAG_NAME': 1000, 'RPMTAG_LONG...(truncated), key=, 
hash=, 
ep=, value=) at 
/usr/src/debug/Python-2.7.5/Objects/dictobject.c:774
#3  0x7f92d6da18a8 in PyDict_SetItemString (
v={'RPMTAG_HEADERREGIONS': 64, 'RPMTAG_EXCLUSIVEOS': 1062, 'fi': , 'RPMTAG_CHANGELOGNAME': 1081, 'RPMTAG_CONFLICTNEVRS': 
5044, 'RPMTAG_FILECAPS': 5010, 'RPMTAG_FILERDEVS': 1033, 'RPMTAG_COLLECTIONS': 
5029, 'RPMTAG_BUGURL': 5012, 'setStats': , 
'RPMTAG_FILEDIGESTALGO': 5011, 'RPMTAG_DEPENDSDICT': 1145, 'RPMTAG_CLASSDICT': 
1142, 'RPMTAG_FILEMODES': 1030, 'RPMTAG_FILEDEPENDSN': 1144, 
'RPMTAG_BUILDTIME': 1006, 'ii': , 
'RPMTAG_INSTALLCOLOR': 1127, 'RPMTAG_CHANGELOGTEXT': 1082, 
'RPMTAG_HEADERCOLOR': 5017, 'RPMTAG_CONFLICTNAME': 1054, 'RPMTAG_CONFLICTS': 
1054, 'setLogFile': , 'versionCompare': , 'RPMTAG_CONFLICTVERSION': 1055, 'RPMTAG_NVRA': 1196, 
'RPMTAG_NOPATCH': 1052, 'RPMTAG_HEADERI18NTABLE': 100, 
'RPMTAG_LONGARCHIVESIZE': 271, 'RPMTAG_FILEREQUIRE': 5002, 
'RPMTAG_FILEDEPENDSX': 1143, 'RPMTAG_EVR': 5013, 'RPMTAG_INSTALLTIME': 1008, '
 RPMTAG_NAME': 1000, 'RPMTAG_LONG...(truncated), key=key@entry=0x7f92c83bf537 
"RPMTAG_OPTFLAGS", 
item=item@entry=1122) at 
/usr/src/debug/Python-2.7.5/Objects/dictobject.c:2448
#4  0x7f92d6e181f2 in PyModule_AddObject (m=m@entry=, 
name=name@entry=0x7f92c83bf537 "RPMTAG_OPTFLAGS", o=o@entry=1122)
at /usr/src/debug/Python-2.7.5/Python/modsupport.c:616
#5  0x7f92d6e182d8 in PyModule_AddIntConstant (m=m@entry=, 
name=name@entry=0x7f92c83bf537 "RPMTAG_OPTFLAGS", value=value@entry=1122)
at /usr/src/debug/Python-2.7.5/Python/modsupport.c:628
#6  0x7f92c85e2b20 in addRpmTags (module=) at 
rpmmodule.c:200
#7  initModule (m=) at rpmmodule.c:343
#8  init_rpm () at rpmmodule.c:281
#9  0x7f92d6e13ed9 in _PyImport_LoadDynamicModule 
(name=name@entry=0x24f69d0 "rpm._rpm", 
pathname=pathname@entry=0x24f79e0 
"/usr/lib64/python2.7/site-packages/rpm/_rpmmodule.so", 
fp=) at /usr/src/debug/Python-2.7.5/Python/importdl.c:53
...

The infinite loop happens when "import rpm" is called in low-memory conditions 
(e.g. when handling ENOMEM or exceptions.MemoryError - RedHat/CentOS 
abrt-addon-python package which installs sys.excepthook handler).

--
nosy: +Max Khon

___
Python tracker 

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



[issue27578] inspect.findsource raises exception with empty __init__.py

2016-07-20 Thread Alexander Todorov

New submission from Alexander Todorov:

$ python2
Python 2.7.5 (default, Oct 11 2015, 17:47:16) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> from pykickstart import handlers
>>> inspect.getsource(handlers)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python2.7/inspect.py", line 701, in getsource
lines, lnum = getsourcelines(object)
  File "/usr/lib64/python2.7/inspect.py", line 690, in getsourcelines
lines, lnum = findsource(object)
  File "/usr/lib64/python2.7/inspect.py", line 538, in findsource
raise IOError('could not get source code')
IOError: could not get source code
>>> 

There is a `pykickstart/handlers/__init__.py` file which is empty and the above 
import works fine as you can see. However `inspect.findsource` raises an 
exception. The same problem exists in Python 3.5 as well. The error comes from 
here:

532 module = getmodule(object, file)
533 if module:
534 lines = linecache.getlines(file, module.__dict__)
535 else:
536 lines = linecache.getlines(file)
537 if not lines:
538 raise IOError('could not get source code')


At this point `lines` is an empty list and we raise the exception. I'm hitting 
this problem when using a mutation testing tool that relies on getsource (which 
calls findsource). 

One possible workaround is to add a comment in the __init__.py file and 
everything seems to be working then. Another one is to patch the tool I'm using 
to take into account empty __init__.py files.

--
components: Library (Lib)
messages: 270867
nosy: Alexander Todorov
priority: normal
severity: normal
status: open
title: inspect.findsource raises exception with empty __init__.py
type: behavior
versions: Python 2.7, Python 3.5

___
Python tracker 

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



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

2016-07-20 Thread Martin Panter

Martin Panter added the comment:

Here is a possible patch for 2.7. To fix everything on 2.7 I changed the module 
to accept input buffers over 2 GiB by enabling PY_SSIZE_T_CLEAN. As a 
consequence, the patch also includes ports of Nadeem Vawda’s adler32(), crc32() 
changes from Issue 10276, and my tests from Issue 25626.

I have only tested this on computers with less than 4 GiB of memory. I can test 
compression and checksums with more input by using a sparse memory map, but not 
decompression.

fm = open("5GiB.sparse", "w+b")
fm.truncate(5 * 2**30)
m = mmap(fm.fileno(), 0)
z = compress(m)

--
type:  -> crash
Added file: 
http://bugs.python.org/file43805/64bit_support_for_zlib_v10-2.7.patch

___
Python tracker 

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



[issue16255] subrocess.Popen needs /bin/sh but Android only has /system/bin/sh

2016-07-20 Thread Stefan Krah

Stefan Krah added the comment:

Apparently sysconfig.get_config_var() is already called in site.py anyway,
so in principle I'm fine with using it here.

In the stdlib it seems to be the first use outside site.py though, and
site.py can be disabled by using "python -S", so perhaps we should be
extra careful, set UNIX_SHELL unconditionally to "/bin/sh" and move
the Android conditional inside a try/except.


But perhaps I'm being irrational here.  Victor, what do you think?

--

___
Python tracker 

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



[issue25571] Improve the lltrace feature with the Py_Debug mode

2016-07-20 Thread STINNER Victor

STINNER Victor added the comment:

Sorry, I don't know what is the best place to add new unit tests.

I don't know neither what is the best place to document the __ltrace__ feature. 
Maybe somewhere near:
* https://docs.python.org/dev/library/debug.html

Or maybe:
* https://docs.python.org/dev/library/trace.html

--

___
Python tracker 

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



[issue25571] Improve the lltrace feature with the Py_Debug mode

2016-07-20 Thread STINNER Victor

STINNER Victor added the comment:

It would be nice to have unit tests and docs :-)

For unit test, you can use a script like:
---
def func():
return 1

__ltrace__ = True
func()
---

Run the script with test.support.assert_python_ok(), and check stdout.

To skip the test if Python is compiled in released mode, you can use:
---
# Were we compiled --with-pydebug or with #define Py_DEBUG?
Py_DEBUG = hasattr(sys, 'gettotalrefcount')

...
@unittest.skipUnless(Py_DEBUG, 'need Py_DEBUG')
---

--

___
Python tracker 

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



[issue23951] Update devguide style to use a similar theme as Docs

2016-07-20 Thread STINNER Victor

STINNER Victor added the comment:

I pushed your new style, thanks. I didn't see any malware in the new Javascript 
nor new HTML :-)

I keep the issue open until the online doc is updated.

--

___
Python tracker 

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



[issue23951] Update devguide style to use a similar theme as Docs

2016-07-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9e7b1bc15ba7 by Victor Stinner in branch 'default':
Use the same style than Python ref doc
https://hg.python.org/devguide/rev/9e7b1bc15ba7

--
nosy: +python-dev

___
Python tracker 

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



[issue25571] Improve the lltrace feature with the Py_Debug mode

2016-07-20 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Totally agree with you, I am going to check that, because currently, 
there is no test with this "hidden" feature in Python.

I am going to discuss with Victor about this point.

Thanks,

Stephane

On 07/20, Xavier Combelle wrote:
>
>Xavier Combelle added the comment:
>
>I made some comment on code in review.
>
>A thing that worry me that there is zero automated test.
>
>In my opinion the minimal should be to test the expected output.
>
>A nice to have would be a test for the write_contents function of 
>makeopcodetranslations.py
>
>--
>nosy: +xcombelle
>
>___
>Python tracker 
>
>___
>___
>Python-bugs-list mailing list
>Unsubscribe: 
>https://mail.python.org/mailman/options/python-bugs-list/stephane%40wirtel.be
>

--

___
Python tracker 

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



[issue25571] Improve the lltrace feature with the Py_Debug mode

2016-07-20 Thread Xavier Combelle

Xavier Combelle added the comment:

I made some comment on code in review.

A thing that worry me that there is zero automated test.

In my opinion the minimal should be to test the expected output.

A nice to have would be a test for the write_contents function of 
makeopcodetranslations.py

--
nosy: +xcombelle

___
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-20 Thread Xiang Zhang

Changes by Xiang Zhang :


--
title: tuple and list parameter name conflicts between doc and implementation 
-> Make implementation and doc of tuple and list more compliant

___
Python tracker 

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



[issue27577] tuple and list parameter name conflicts between doc and implementation

2016-07-20 Thread Xiang Zhang

New submission from Xiang Zhang:

For tuple and list, their signatures are tuple([iterable]) and 
list([iterable]). But actually they support keyword argument *sequence*. The 
parameter names in doc are sometimes just placeholders but sometimes are real 
parameter names. So I suggest make the implementation and doc more compliant. 
One method is make the parameter name in implementation *iterable*. The other 
is totally suppress keyword argument since it is never documented. This is not 
a necessary change but I think the compliment is not a bad idea.

--
components: Interpreter Core
messages: 270858
nosy: serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: tuple and list parameter name conflicts between doc and implementation
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