[issue26547] Undocumented use of the term dictproxy in vars() documentation

2016-03-12 Thread Martin Panter

Martin Panter added the comment:

In Python 2, the class was called “dictproxy”, the repr() used “dict_proxy” 
with an underscore, and it is exposed as types.DictProxyType. So I guess that 
is where the term comes from. In Python 3.3, Issue 14386 renamed the class and 
repr() to “mappingproxy”, and re-introduced it to types as MappingProxyType. 
(DictProxyType was previously removed in revision 15649aef2db5.)

So in Python 3 I would probably change it from “dictproxy” to a 
types.MappingProxyType link.

--

___
Python tracker 

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



[issue23214] BufferedReader.read1(size) signature incompatible with BufferedIOBase.read1(size=-1)

2016-03-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Shouldn't read1(-1) be the same as read1(sys.maxsize)? I.e. read from a buffer 
without limit.

--
nosy: +benjamin.peterson, pitrou, serhiy.storchaka, stutzbach

___
Python tracker 

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



[issue25687] Error during test case and tearDown

2016-03-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cecd39887faa by Ezio Melotti in branch '3.5':
#25687: clarify that errors in tearDown increase the total number of reported 
errors.  Initial patch by HyeSoo Park.
https://hg.python.org/cpython/rev/cecd39887faa

New changeset d5f5a6f514f2 by Ezio Melotti in branch 'default':
#25687: merge with 3.5.
https://hg.python.org/cpython/rev/d5f5a6f514f2

New changeset 5e64ffe576a9 by Ezio Melotti in branch '2.7':
#25687: clarify that errors in tearDown increase the total number of reported 
errors.  Initial patch by HyeSoo Park.
https://hg.python.org/cpython/rev/5e64ffe576a9

--
nosy: +python-dev

___
Python tracker 

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



[issue25687] Error during test case and tearDown

2016-03-12 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report and the patch!

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



[issue26495] super() does not work in nested functions, genexps, listcomps, and gives misleading exceptions

2016-03-12 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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

___
Python tracker 

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



[issue26525] Documentation of ord(c) easy to misread

2016-03-12 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I concur that the Euro sign would be best (more recognizable and more likely to 
be renderable in a given font).

--
nosy: +rhettinger

___
Python tracker 

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



[issue26535] Minor typo in the docs for struct.unpack

2016-03-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage: patch review -> needs patch

___
Python tracker 

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



[issue26545] os.walk is limited by python's recursion limit

2016-03-12 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I think the code should be left as-is (we've used some variation of recursion 
for walking a very long time with no reported real-world problems).  Perhaps a 
documentation note can be added to the effect that the there is a recursion 
limit and that it can be changed by the user if needed.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python, rhettinger
priority: normal -> low

___
Python tracker 

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



[issue26535] Minor typo in the docs for struct.unpack

2016-03-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +pitrou

___
Python tracker 

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



[issue26314] interned strings are stored in a dict, a set would use less memory

2016-03-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Since interned strings table can only grow and contains exact strings, other 
data structure may be more appropriate (for example Modules/hashtable.c).

But for now status quo is good to me.

--

___
Python tracker 

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



[issue26511] Add link to id() built-in in comparison operator documentation for "is"

2016-03-12 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy
nosy: +ezio.melotti

___
Python tracker 

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



[issue26535] Minor typo in the docs for struct.unpack

2016-03-12 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The proposed wording looks fine.

--
nosy: +rhettinger

___
Python tracker 

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



[issue26511] Add link to id() built-in in comparison operator documentation for "is"

2016-03-12 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I agree with the OP that is would be useful to link to id().  I also concur 
with Terry that integer caching is to remain an undocumented implementation 
specific detail (just an optimization).  Also, Martin is correct that the 
proposed wording doesn't read well.

--
assignee: docs@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue26512] Vocabulary: Using "integral" in library/stdtypes.html

2016-03-12 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I don't think taking the table out makes the docs better.  It just removes a 
source of information just because the OP stumbled on the word "integral" which 
has both a standard (albeit erudite) meaning in Engligh and a precise meaning 
in the context of PEP-3141.   I recommend leaving the table as-is and linking 
to the PEP or to the numbers module so that an interested person can delved 
deeper if needed.  The table communicates a central concept that there are 
differences in the several ways to convert a float to an integer.

--
assignee: docs@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue26314] interned strings are stored in a dict, a set would use less memory

2016-03-12 Thread Gregory P. Smith

Gregory P. Smith added the comment:

The space for the strings is a fixed cost, the structure used to store them for 
efficient lookup is the only overhead that can be trimmed and is all in one 
contiguous allocation.

regardless, i agree, this isn't a large savings. priority low, feel free to 
drop if it you want.

--

___
Python tracker 

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



[issue26548] Probably missing word in a sentence in the doc of bitwise operations on integer types

2016-03-12 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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

___
Python tracker 

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



[issue26548] Probably missing word in a sentence in the doc of bitwise operations on integer types

2016-03-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b9256d5f1ab4 by Raymond Hettinger in branch '3.5':
Issue #26548:  Minor fix to awkward wording in docs
https://hg.python.org/cpython/rev/b9256d5f1ab4

--
nosy: +python-dev

___
Python tracker 

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



[issue26548] Probably missing word in a sentence in the doc of bitwise operations on integer types

2016-03-12 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
nosy: +rhettinger
priority: normal -> low

___
Python tracker 

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



[issue26314] interned strings are stored in a dict, a set would use less memory

2016-03-12 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I agree with Serhiy that this should not be done.   IIRC, there were some 
discussions on python-dev or python-ideas about using sets for interning and 
the judgment was the dicts are conceptually the right type and that using sets 
would be hack.  The other thought was that while a set is generally two-thirds 
the size of dict, the bulk of the space is for the interned strings themselves.

--
assignee:  -> rhettinger

___
Python tracker 

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



[issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file

2016-03-12 Thread Martin Panter

Martin Panter added the comment:

Thanks Silent Ghost, this patch looks pretty good. I did leave a couple more 
comments.

Also I just realized that HTTPResponse.readline() and read1() are not really 
documented. The BufferedIOBase support was meant to be added in 3.5, although 
readline() was supposed to be supported earlier for urlopen() compatibility.

--

___
Python tracker 

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



[issue23214] BufferedReader.read1(size) signature incompatible with BufferedIOBase.read1(size=-1)

2016-03-12 Thread Martin Panter

Martin Panter added the comment:

Looking at this again, I think a less intrusive way forward would be to:

* Document that in 3.6, the required signature is now 
BufferedIOBase.read1(size). An implementation no longer has to provide a 
default size, and no longer has to accept negative sizes.

* Explicitly document the behaviour of each concrete implementation like 
GzipFile.read1(-1) etc, if this behaviour is intentional

* Fix the BufferedReader error so that “read length must not be negative”

Relaxing the read1() signature would allow wider or easier use of 
BufferedReader, e.g. to implement HTTPResponse as I suggested in Issue 26499. 
The advantage would be using existing code that is well tested, used, 
optimized, etc, rather than a custom BufferedIOBase implementation which for 
the HTTP case is buggy.

--
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue26550] documentation minor issue : "Step back: WSGI" section from "HOWTO Use Python in the web"

2016-03-12 Thread Alejandro Soini

New submission from Alejandro Soini:

Bad article usage in the following sentence from the WSGI section on HOWTO Use 
Python in the web (https://docs.python.org/2/howto/webservers.html#wsgi) :

"Authentication is another a problem easily solved using existing middleware."

suggested change:

"Authentication is another problem that is easily solved using existing 
middleware."

--
assignee: docs@python
components: Documentation
messages: 261671
nosy: Alejandro Soini, docs@python
priority: normal
severity: normal
status: open
title: documentation minor issue : "Step back: WSGI" section from "HOWTO Use 
Python in the web"
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue26547] Undocumented use of the term dictproxy in vars() documentation

2016-03-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I would add a space between "dict" and "proxy".

--
nosy: +martin.panter, serhiy.storchaka

___
Python tracker 

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



[issue747320] rfc2822 formatdate functionality duplication

2016-03-12 Thread Berker Peksag

Berker Peksag added the comment:

-now = time.time()
-year, month, day, hh, mm, ss, x, y, z = time.localtime(now)
-s = "%02d/%3s/%04d %02d:%02d:%02d" % (
-day, self.monthname[month], year, hh, mm, ss)
+s = time.strftime("%d/%b/%Y %H:%M:%S", time.localtime())

This part of the patch is incorrect. time.strftime() will return non-English 
values for different locales.

About deprecations of weekdayname and monthname attributes:

I know that they are undocumented, but they are already being used in the wild. 
For example, see https://github.com/natemago/srv/blob/master/srv.py#L419 Since 
we don't have any public API for this use case, I'd be +1 to keep them for now.

Here is an updated patch.

--
Added file: http://bugs.python.org/file42153/issue747320_v2.diff

___
Python tracker 

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



[issue19450] Bug in sqlite in Windows binaries

2016-03-12 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue26549] co_stacksize is calculated from unoptimized code

2016-03-12 Thread Antti Haapala

New submission from Antti Haapala:

When answering a question on StackOverflow, I noticed that a function that only 
loads a constant tuple to a local variable still has a large `co_stacksize` as 
if it was built with BUILD_TUPLE.

e.g.

>>> def foo():
... a = (1,2,3,4,5,6,7,8,9,10)
...
>>> foo.__code__.co_stacksize
10
>>> dis.dis(foo)
  2   0 LOAD_CONST  11 ((1, 2, 3, 4, 5, 6, 7, 8, 9, 10))
  3 STORE_FAST   0 (a)
  6 LOAD_CONST   0 (None)
  9 RETURN_VALUE

I suspect it is because in the `makecode` the stack usage is calculated from 
the unoptimized assembler output instead of the actual optimized bytecode. I do 
not know if there is any optimization that would increase the stack usage, but 
perhaps it should be calculated from the resulting output.

--
components: Interpreter Core
messages: 261668
nosy: ztane
priority: normal
severity: normal
status: open
title: co_stacksize is calculated from unoptimized code
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



[issue26548] Probably missing word in a sentence in the doc of bitwise operations on integer types

2016-03-12 Thread Julien

New submission from Julien:

In 
https://docs.python.org/3.5/library/stdtypes.html#bitwise-operations-on-integer-types
 the sentence "this assumes a sufficiently large number of bits that no 
overflow occurs during the operation" looks wrong to me, so I asked on #python 
and got from @benzrf:

"this assumes that there are sufficiently many bits for no overflow to occur 
during the operation"

Which looks better to me.

--
assignee: docs@python
components: Documentation
messages: 261667
nosy: docs@python, sizeof
priority: normal
severity: normal
status: open
title: Probably missing word in a sentence in the doc of bitwise operations on 
integer types
type: enhancement

___
Python tracker 

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



[issue23606] ctypes.util.find_library("c") no longer makes sense

2016-03-12 Thread Eryk Sun

Eryk Sun added the comment:

I occasionally come across code snippets on Stack Overflow, and projects such 
as win-unicode-console (IIRC), that use ctypes to work with C stdio FILE 
streams (sometimes for dubious reasons, such as a DLL API that uses FILE 
streams). Maybe the _ctypes extension module could provide void pointers for 
the current C stdin, stdout, and stderr -- as well as stdio functions such as 
fflush, fopen, and freopen. This is already done with _ctypes._memmove_addr and 
_ctypes._memset_addr. However, getting the current standard stream pointers 
would need to use a callable or descriptor. 

> it'd be good content for a "Best practices" section 

The tutorial itself is outdated in places and doesn't promote best practices. 
For example, it assigns a ValidHandle function to 
windll.kernel32.GetModuleHandleA.restype, which would affect every module that 
uses windll.kernel32. Also, this ValidHandle example is bogus, as is every 
example in the tutorial that uses GetModuleHandle without setting restype to a 
pointer type such as c_void_p. It's truncating 64-bit pointers to 32-bit int 
values. You just need to try a DLL that loads at a high address:

>>> kernel32.GetModuleHandleA(b'advapi32')
-27590656
>>> def ValidHandle(value):
... if value == 0:
... raise WinError()
... return value
...
>>> kernel32.GetModuleHandleA.restype = ValidHandle
>>> kernel32.GetModuleHandleA(b'advapi32')
-27590656

>>> hex(kernel32.GetModuleHandleA(b'advapi32') & 2**32-1)
'0xfe5b'
>>> kernel32.GetModuleHandleA.restype = c_void_p 
>>> hex(kernel32.GetModuleHandleA(b'advapi32'))  
'0x7fefe5b'

--

___
Python tracker 

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



[issue26547] Undocumented use of the term dictproxy in vars() documentation

2016-03-12 Thread Julien

New submission from Julien:

I spotted un undocumented term here : 
https://docs.python.org/3.5/library/functions.html#vars

in: "Objects such as modules and instances have an updateable __dict__ 
attribute; however, other objects may have write restrictions on their __dict__ 
attributes (for example, classes use a dictproxy to prevent direct dictionary 
updates)."

The term "dictproxy" is not documented anywhere in the documentation, I assume 
it's a https://docs.python.org/3.4/library/types.html#types.MappingProxyType, 
which is right:

>>> class Foo():
... pass
... 
>>> vars(Foo)
mappingproxy({'__doc__': None, '__weakref__': , '__dict__': , 
'__module__': '__main__'})

So I propose a patch to link to it via a :class:`dictproxy 
`.

Should we leave "dictproxy" or change it to "mappingproxy" ?

--
assignee: docs@python
components: Documentation
files: dictproxy.patch
keywords: patch
messages: 261665
nosy: docs@python, sizeof
priority: normal
severity: normal
status: open
title: Undocumented use of the term dictproxy in vars() documentation
type: enhancement
Added file: http://bugs.python.org/file42152/dictproxy.patch

___
Python tracker 

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



[issue26176] EmailMessage example doesn't work

2016-03-12 Thread Julien

Julien added the comment:

Is this your bug:

  Traceback (most recent call last):
File "/tmp/email_example.py", line 9, in 
  with open(textfile) as fp:
  NameError: name 'textfile' is not defined

?

If not, can you please provide us the full traceback ?

--
nosy: +sizeof

___
Python tracker 

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



[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-03-12 Thread Julien

Julien added the comment:

To dig further, the DIGIT_MASK and DECIMAL_MASK used in `unicodeobject.c` are 
from `unicodectype.c` and they match values from `unicodetype_db.h` witch is 
generated by `Tools/unicode/makeunicodedata.py` which built those masks this 
way:

# decimal digit, integer digit
decimal = 0
if record[6]:
flags |= DECIMAL_MASK
decimal = int(record[6])
digit = 0
if record[7]:
flags |= DIGIT_MASK
digit = int(record[7])
if record[8]:
flags |= NUMERIC_MASK
numeric.setdefault(record[8], []).append(char)

Those "record"s are documented in 
ftp://unicode.org/Public/3.2-Update/UnicodeData-3.2.0.html in which fields 6, 
7, and 8 are:

 - 6Decimal digit value N   This is a numeric field. If the 
character has the decimal digit property, as specified in Chapter 4 of the 
Unicode Standard, the value of that digit is represented with an integer value 
in this field

 - 7Digit value N   This is a numeric field. If the character 
represents a digit, not necessarily a decimal digit, the value is here. This 
covers digits which do not form decimal radix forms, such as the compatibility 
superscript digits

 - 8Numeric value   N   This is a numeric field. If the character has 
the numeric property, as specified in Chapter 4 of the Unicode Standard, the 
value of that character is represented with an integer or rational number in 
this field. This includes fractions as, e.g., "1/5" for U+2155 VULGAR FRACTION 
ONE FIFTH Also included are numerical values for compatibility characters such 
as circled numbers.

Which is very close of the actual documentation. Yet the documentation is 
misleading using "This category includes digit characters" in the "isdecimal" 
documentation.

Posssible rewriting:

isdecimal: Return true if all characters in the string are decimal characters 
and there is at least one character, false otherwise. Decimal characters are 
those that can be used to form decimal-radix numbers, e.g. U+0660, ARABIC-INDIC 
DIGIT ZERO. Formally a decimal character is a character in the Unicode General 
Category "Nd".

isdigit: Return true if all characters in the string are digits and there is at 
least one character, false otherwise. Digits include decimal characters and 
digits that need special handling, such as the compatibility superscript 
digits. This covers digits which do not form decimal radix forms. Formally, a 
digit is a character that has the property value Numeric_Type=Digit or 
Numeric_Type=Decimal.

I don't think we can refactor more than this without rewriting documentation 
for isnumeric which mentions the Unicode standard the same way.

--
nosy: +sizeof

___
Python tracker 

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



[issue25638] Verify the etree_parse and etree_iterparse benchmarks are working appropriately

2016-03-12 Thread Brett Cannon

Changes by Brett Cannon :


--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue26079] Build with Visual Studio 2015 using PlatformToolset=v120

2016-03-12 Thread Steve Dower

Steve Dower added the comment:

Python 2.7 has a different section in its tcltk.props file and doesn't need 
this fix (yet).

Thanks for the patch, Bjoern!

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

___
Python tracker 

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



[issue26079] Build with Visual Studio 2015 using PlatformToolset=v120

2016-03-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7617f5b3f263 by Steve Dower in branch '3.5':
Issue #26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern 
Thiel.
https://hg.python.org/cpython/rev/7617f5b3f263

New changeset f426178c9d6c by Steve Dower in branch 'default':
Issue #26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern 
Thiel.
https://hg.python.org/cpython/rev/f426178c9d6c

--
nosy: +python-dev

___
Python tracker 

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



[issue23606] ctypes.util.find_library("c") no longer makes sense

2016-03-12 Thread Steve Dower

Steve Dower added the comment:

That's a bit too much of a tangent for me to note in-place in the docs, but 
it'd be good content for a "Best practices" section (I seem to recall we had 
one somewhere, that basically started with "avoid ctypes if possible"...)

Given we've heard no feedback about this change (well, I've heard no feedback - 
if anyone else has please let me know) I'm going to consider this closed.

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

___
Python tracker 

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



[issue23606] ctypes.util.find_library("c") no longer makes sense

2016-03-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f9dc71b566fb by Steve Dower in branch '3.5':
Issue #23606: Adds note to ctypes documentation regarding cdll.msvcrt.
https://hg.python.org/cpython/rev/f9dc71b566fb

New changeset 6d84fe4d8cb0 by Steve Dower in branch 'default':
Issue #23606: Adds note to ctypes documentation regarding cdll.msvcrt.
https://hg.python.org/cpython/rev/6d84fe4d8cb0

--

___
Python tracker 

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



[issue19450] Bug in sqlite in Windows binaries

2016-03-12 Thread Steve Dower

Steve Dower added the comment:

Assigning to Benjamin to make the call for 2.7. Either close or assign it back 
if you want the update.

--
assignee: steve.dower -> benjamin.peterson
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



[issue26513] platform.win32_ver() broken in 2.7.11

2016-03-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5564cf3ba523 by Steve Dower in branch '3.5':
Issue #26513: Fixes platform module detection of Windows Server
https://hg.python.org/cpython/rev/5564cf3ba523

New changeset 9db5846f126d by Steve Dower in branch '2.7':
Issue #26513: Fixes platform module detection of Windows Server
https://hg.python.org/cpython/rev/9db5846f126d

New changeset fabbfad67362 by Steve Dower in branch 'default':
Issue #26513: Fixes platform module detection of Windows Server
https://hg.python.org/cpython/rev/fabbfad67362

--
nosy: +python-dev

___
Python tracker 

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



[issue26513] platform.win32_ver() broken in 2.7.11

2016-03-12 Thread Steve Dower

Changes by Steve Dower :


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

___
Python tracker 

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



[issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file

2016-03-12 Thread SilentGhost

SilentGhost added the comment:

OK, here is the patch including the tests that seem to exercise the behaviour.

--
Added file: http://bugs.python.org/file42151/issue26499_4.diff

___
Python tracker 

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



[issue25687] Error during test case and tearDown

2016-03-12 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee:  -> ezio.melotti
stage: needs patch -> patch review

___
Python tracker 

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



[issue26226] Various test suite failures on Windows

2016-03-12 Thread Ezio Melotti

Ezio Melotti added the comment:

> I'm surprised by the test_codecencodings_iso2022 failures. Example:

==
FAIL: test_incrementaldecoder (test.test_codecencodings_iso2022.Test_ISO2022_KR)
--
Traceback (most recent call last):
  File "E:\GitHub\cpython\lib\test\multibytecodec_support.py", line 208, in 
test_incrementaldecoder
self.assertEqual(ostream.getvalue(), self.tstring[1])
AssertionError: b'\xe[334 
chars]\x80\n\xed\x9a\xa8\xec\x9c\xa8\xec\xa0\x81\xec[1668 chars]4.\n' != 
b'\xe[334 chars]\x80\r\n\xed\x9a\xa8\xec\x9c\xa8\xec\xa0\x81\x[1682 chars]\r\n'

I run into this problem during a sprint, with a machine that was also running 
Windows and cloned from the git repo.  Those bytes are read from txt files in 
the test/cjkencodings dir, and they are marked as binary files in .hgeol.  
Since git ignores .hgeol and treats them as text files, it also changes the 
newline to \r\n causing the failure.
The tests pass without problems after cloning with Mercurial.

--

___
Python tracker 

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



[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-03-12 Thread Anna Koroliuk

Anna Koroliuk added the comment:

Hi, all!

At Helsinki Python sprint I with the kind help of Ezio found two things. 

1) This code gives results which are attached in the file. I will just now show 
some interesting cases where isdigit() and isdecimal() give different results.

for c in map(chr, range(0x10)):
if unicodedata.digit(c, None) is not None: print(c, c.isdigit(), c.isdecimal())
... 

0 True True
1 True True
2 True True
² True False
³ True False
¹ True False
፩ True False
፪ True False
፫ True False
፬ True False
① True False
② True False
③ True False

So it's different commands, although for usual digits 0-9 in usual typewriting 
without those upper indexes etc they give same results. Full file 
command_comparison.txt is attached. 

2) Both commands isdigit() and isdecimal() are traced back that symbol is 
compared to a certain tables (masks), but masks are different. For isdigit() it 
is DIGIT_MASK = 0x04 and for isdecimal() is DECIMAL_MASK 0x02.

Here is how all the commands are traced to the mask. 

A) isdecimal()

./Objects/unicodeobject.c:{"isdecimal", (PyCFunction) unicode_isdecimal, 
METH_NOARGS, isdecimal__doc__},

./Objects/unicodeobject.c:
static PyObject*
unicode_isdecimal(PyObject *self)

if (length == 1)
return PyBool_FromLong(
Py_UNICODE_ISDECIMAL(PyUnicode_READ(kind, data, 0)));

./Include/unicodeobject.h:#define Py_UNICODE_ISDECIMAL(ch) 
_PyUnicode_IsDecimalDigit(ch)

./Objects/unicodectype.c:
int _PyUnicode_IsDecimalDigit(Py_UCS4 ch)
{
if (_PyUnicode_ToDecimalDigit(ch) < 0)
return 0;
return 1;
}

int _PyUnicode_ToDecimalDigit(Py_UCS4 ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);

return (ctype->flags & DECIMAL_MASK) ? ctype->decimal : -1;
}
./Objects/unicodectype.c:#define DECIMAL_MASK 0x02

B) isdigit()

./Objects/unicodeobject.c:{"isdigit", (PyCFunction) unicode_isdigit, 
METH_NOARGS, isdigit__doc__},

./Objects/unicodeobject.c: static PyObject*
unicode_isdigit(PyObject *self)
...
if (length == 1) {
const Py_UCS4 ch = PyUnicode_READ(kind, data, 0);
return PyBool_FromLong(Py_UNICODE_ISDIGIT(ch));
}

./Include/unicodeobject.h:#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch)

./Objects/unicodectype.c: int _PyUnicode_IsDigit(Py_UCS4 ch)
{
if (_PyUnicode_ToDigit(ch) < 0)
return 0;
return 1;
}

int _PyUnicode_ToDigit(Py_UCS4 ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);

return (ctype->flags & DIGIT_MASK) ? ctype->digit : -1;
}

./Tools/unicode/makeunicodedata.py:DIGIT_MASK = 0x04

BR,
Anna

--
nosy: +Anna Koroliuk
Added file: http://bugs.python.org/file42149/command_comparison.txt

___
Python tracker 

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



[issue26546] Provide translated french translation on docs.python.org

2016-03-12 Thread Julien

New submission from Julien:

Hi,

The [french translation of the Python 
documentation](https://github.com/afpy/python_doc_fr) just hit a 21% coverage 
in terms of pageviews (According to statistics [nicely provided by 
EWDurbin](https://github.com/AFPy/python_doc_fr/issues/32#issuecomment-195071379)).
 (It's 14% of the total strings to translate).

I think it may be a good time to push the translation to *docs.python.org*, so 
french speaking people will be able to find it naturally, and more translators 
will be aware of it, increasing the translation speed.

Also it will probably motivate other translations (http://docs.python.jp/3/, 
http://docs.python.org.ar/tutorial/3/index.html, others ?) to work in a more 
standardized ways, and make their translations more discoverable.

So there's two discussions to have: The URL, and the "how".

# URL

I think the only reasonable possibility is *docs.python.org/{country_code}/*

Having a CCTLD per translation is near impossible (a LOT or work and highly 
time consuming) as some domains are unavailable like python.fr and some other 
have high restrictions like having a physical presence in the country (like 
python.ca, python.pt.br) or having a commercial relation with a local company 
like for python.com.tr).

Also it allows localization via *docs.python.org/fr_FR/* even if I don't think 
we need it soon.

If you have other ideas, better than *docs.python.org/fr/*, that's why this 
issue is opened.

# How to

We have a 
[Makefile](https://github.com/AFPy/python_doc_fr/blob/master/Makefile) which 
like [docsbuild-scripts](https://github.com/python/docsbuild-scripts) delegates 
naturally most of its work to the sphinx Makefile in *Doc/Makefile*, and is 
capable of building french versions of 2.7, 3.3, 3.4, and 3.5 in a simple 
invocation of `make build_all MODE=autobuild-stable` (cloning itself from the 
github repository, applying various patches (typically to configure sphinx to 
generate french). 3.2 is also possible but not built by default (no 
autobuild-html in its sphinx Makefile). 

I think docsbuild-scripts may delegate the french generation by simply 
cloning/updating our repository and calling our makefile. A patch (attached) 
will be necessary in docsbuild-scripts to copy generated doc to /fr/ and send 
purges to the CDN.

Finally, once all this is running, we'll start a discussion about cross-linking 
both documentations, probably reopening 
https://github.com/sphinx-doc/sphinx/issues/1246.

--
assignee: docs@python
components: Documentation
files: build_doc_fr.patch
keywords: patch
messages: 261654
nosy: benjamin.peterson, docs@python, sizeof
priority: normal
severity: normal
status: open
title: Provide translated french translation on docs.python.org
type: enhancement
Added file: http://bugs.python.org/file42150/build_doc_fr.patch

___
Python tracker 

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



[issue26014] Guide users to the newer package install instructions

2016-03-12 Thread Susan Sun

Susan Sun added the comment:

Below two issues are fixed. 

* add See Also links to the modern docs from the legacy docs
* append the (Legacy) suffix in the 2.x docs

--
keywords: +patch
nosy: +Susan Sun, ezio.melotti
Added file: http://bugs.python.org/file42148/issue26014.diff

___
Python tracker 

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



[issue25638] Verify the etree_parse and etree_iterparse benchmarks are working appropriately

2016-03-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I am not able to find the cause of the slowdown.

I think this issue can be closed now. The etree_parse and etree_iterparse 
benchmarks are working appropriately and showing real regression in CPython 
3.x. The cause of the regression is not known.

--
assignee: serhiy.storchaka -> 

___
Python tracker 

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



[issue26176] EmailMessage example doesn't work

2016-03-12 Thread HyeSoo Park

HyeSoo Park added the comment:

Could you please specify which example of the Provisional API among 2 examples 
of the documentation and how does it not work? Thank you

--
nosy: +flyjwayur

___
Python tracker 

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



[issue26544] platform.libc_ver() returns incorrect version number

2016-03-12 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Adding other Python versions as well, since this is a bug.

--
versions: +Python 2.7, Python 3.4, Python 3.6

___
Python tracker 

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



[issue26544] platform.libc_ver() returns incorrect version number

2016-03-12 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

True. At the time the code was written, this was not an issue :-)

Is the libc version information documented somewhere ? If so, we could probably 
add a better parser for it.

--

___
Python tracker 

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



[issue18859] README.valgrind should mention --with-valgrind

2016-03-12 Thread Elena Oat

Changes by Elena Oat :


Added file: http://bugs.python.org/file42147/issue18859.diff

___
Python tracker 

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



[issue18859] README.valgrind should mention --with-valgrind

2016-03-12 Thread Elena Oat

Elena Oat added the comment:

I've combined the patch submitted by Sowmya and also added there clarifications 
from points 1, 2 mentioned by Martin Mokrejs.

--
nosy: +Elena.Oat

___
Python tracker 

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



[issue26250] no document for sqlite3.Cursor.connection

2016-03-12 Thread Varpu Rantala

Varpu Rantala added the comment:

The sentencing was complicated. I changed the formulation and added an example 
of connection.

--
nosy: +Varpu Rantala
Added file: http://bugs.python.org/file42146/issue26250.diff

___
Python tracker 

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



[issue26512] Vocabulary: Using "integral" in library/stdtypes.html

2016-03-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +jyasskin

___
Python tracker 

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



[issue25687] Error during test case and tearDown

2016-03-12 Thread HyeSoo Park

HyeSoo Park added the comment:

I added 'additional' and (thus increasing the total number of error counts.) to 
'teardown' explanation of the document to make it more clear.

--
keywords: +patch
nosy: +HyeSoo Park
Added file: http://bugs.python.org/file42145/issue25687.diff

___
Python tracker 

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



[issue26512] Vocabulary: Using "integral" in library/stdtypes.html

2016-03-12 Thread Julien

Julien added the comment:

Hi Martin, awesome work you've done here. I was meditating those past days 
about the subject and came to a similar yet not that good conclusion that the 
table should have the same definitions than those from 
[library/math.html](https://docs.python.org/3.5/library/math.html#number-theoretic-and-representation-functions).
 But your solution is better, copy-paste is wrong, let's just link to the right 
documentation, in which case, a simple list is enough, there is no need for a 
table.

The definitions in the *library/math.html* and *library/functions.html* (for 
round) are perfectly clear and understandable, and properly link to 
number.Integral each time it's used. For the record:

math.trunc(x)
Return the Real value x truncated to an Integral (usually an integer). 
Delegates to x.__trunc__().

math.ceil(x)
Return the ceiling of x, the smallest integer greater than or equal to x. 
If x is not a float, delegates to x.__ceil__(), which should return an Integral 
value.

math.floor(x)
Return the floor of x, the largest integer less than or equal to x. If x is 
not a float, delegates to x.__floor__(), which should return an Integral value.

round(number[, ndigits])
Return the floating point value number rounded to ndigits digits after the 
decimal point. If ndigits is omitted, it returns the nearest integer to its 
input. Delegates to number.__round__(ndigits).

For the built-in types supporting round(), values are rounded to the 
closest multiple of 10 to the power minus ndigits; if two multiples are equally 
close, rounding is done toward the even choice (so, for example, both 
round(0.5) and round(-0.5) are 0, and round(1.5) is 2). The return value is an 
integer if called with one argument, otherwise of the same type as number.

Note The behavior of round() for floats can be surprising: for example, 
round(2.675, 2) gives 2.67 instead of the expected 2.68. This is not a bug: 
it’s a result of the fact that most decimal fractions can’t be represented 
exactly as a float. See Floating Point Arithmetic: Issues and Limitations for 
more information.

About the docstrings not being the same as the documentation, is there a "best 
practice" on how it should be ? Should'nt them always be the same ?

Here's a first patch to replace the table with a simple list.

--
keywords: +patch
Added file: http://bugs.python.org/file42144/stdtypes.patch

___
Python tracker 

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



[issue26205] Inconsistency concerning nested scopes

2016-03-12 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
type:  -> enhancement

___
Python tracker 

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



[issue26226] Various test suite failures on Windows

2016-03-12 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
type:  -> behavior

___
Python tracker 

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



[issue23718] strptime() can produce invalid date with negative year day

2016-03-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Tamás for your contribution.

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



[issue23718] strptime() can produce invalid date with negative year day

2016-03-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f03da87a79fa by Serhiy Storchaka in branch '3.5':
Issue #23718: Fixed parsing time in week 0 before Jan 1.  Original patch by
https://hg.python.org/cpython/rev/f03da87a79fa

New changeset 4fb167ec3108 by Serhiy Storchaka in branch '2.7':
Issue #23718: Fixed parsing time in week 0 before Jan 1.  Original patch by
https://hg.python.org/cpython/rev/4fb167ec3108

New changeset a7093386efaf by Serhiy Storchaka in branch 'default':
Issue #23718: Fixed parsing time in week 0 before Jan 1.  Original patch by
https://hg.python.org/cpython/rev/a7093386efaf

--
nosy: +python-dev

___
Python tracker 

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