[issue21356] Support LibreSSL (instead of OpenSSL): make RAND_egd optional

2014-05-23 Thread Tobias Oberstein

Changes by Tobias Oberstein :


--
nosy: +oberstet

___
Python tracker 

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



[issue21556] try to use hashtable in pickle

2014-05-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I'm saying attempt, because although it works correctly, some benchmarks are 
> actually slower.
> I didn't profile it, so I don't know if it's due to the hashtable 
> implementation, function call overheads, etc.

It probably shows that Python dicts (which the pickle hashtable is a rip-off 
of, module refcounting) are more optimized than the average hash table 
implementation :-)

But also, _Py_hashtable_hash_ptr is quite crude in that it doesn't even try to 
compensate for pointer alignment, so there will automatically be many 
collisions. Only one hash bucket every 8 or 16 will be used, at best.

And the straightforward collision resolution in hashtable.c is much less 
efficient at mitigating collisions than a Python dict's.

--
nosy: +tim.peters

___
Python tracker 

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



[issue21556] try to use hashtable in pickle

2014-05-23 Thread STINNER Victor

STINNER Victor added the comment:

"_Py_hashtable_hash_ptr is quite crude in that it doesn't even try to 
compensate for pointer alignment, so there will automatically be many 
collisions. Only one hash bucket every 8 or 16 will be used, at best."

I chose to use _Py_HashPointer() to drop (shift) lower bits. Do you mean that 
it's not enough? Python memory allocator uses an alignement on 8 bytes (2**3).

Py_uhash_t
_Py_hashtable_hash_ptr(const void *key)
{
return (Py_uhash_t)_Py_HashPointer((void *)key);
}

Py_hash_t
_Py_HashPointer(void *p)
{
Py_hash_t x;
size_t y = (size_t)p;
/* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid
   excessive hash collisions for dicts and sets */
y = (y >> 4) | (y << (8 * SIZEOF_VOID_P - 4));
x = (Py_hash_t)y;
if (x == -1)
x = -2;
return x;
}

--

___
Python tracker 

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



[issue21556] try to use hashtable in pickle

2014-05-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> "_Py_hashtable_hash_ptr is quite crude in that it doesn't even try to 
> compensate for pointer alignment, so there will automatically be many 
> collisions. Only one hash bucket every 8 or 16 will be used, at best."
> 
> I chose to use _Py_HashPointer() to drop (shift) lower bits. Do you
> mean that it's not enough? Python memory allocator uses an alignement
> on 8 bytes (2**3).

Ah, sorry, I just hadn't realized that.

--

___
Python tracker 

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



[issue21556] try to use hashtable in pickle

2014-05-23 Thread STINNER Victor

STINNER Victor added the comment:

> And the straightforward collision resolution in hashtable.c is much less 
> efficient at mitigating collisions than a Python dict's.

Modules/hashtable.c comes from http://sourceforge.net/projects/libcfu/ (cfuhash 
type). I adapted the code for my needs (the tracemalloc module), but I didn't 
try to make it fast. My main change was to store data directly in an entry of a 
table instead of using a second memory block for the data (and a pointer in the 
hash table entry).

I didn't want to use the Python dict type for tracemalloc because this type may 
use the Python memory allocator which would lead to reentrant calls to 
tracemalloc. It's also nice to have a function to compute exactly the memory 
usage of an hash table (table + data), it's exposed in 
tracemalloc.get_tracemalloc_memory().

It doesn't mean that I want hashtable.c to be slow :-) Feel free to modify it 
as you want. But trying to make it as fast as Python dict would be hard. The 
design is different. Python dict uses open addressing, whereas _Py_hashtable 
uses linked list to store entries. Python dict is well optimized.

--

___
Python tracker 

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



[issue21556] try to use hashtable in pickle

2014-05-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I didn't want to use the Python dict type for tracemalloc because this
> type may use the Python memory allocator which would lead to reentrant
> calls to tracemalloc.

Ah, so this means CF's patch will make the pickle memotable invisible to
tracemalloc?

> It doesn't mean that I want hashtable.c to be slow :-) Feel free to
> modify it as you want. But trying to make it as fast as Python dict
> would be hard. The design is different. Python dict uses open
> addressing, whereas _Py_hashtable uses linked list to store entries.
> Python dict is well optimized.

Yes, optimizing hashtable.c probably means converting it to the same
hashing scheme as dicts (or the current memotable in pickle.c).

--

___
Python tracker 

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



[issue21556] try to use hashtable in pickle

2014-05-23 Thread STINNER Victor

STINNER Victor added the comment:

"Ah, so this means CF's patch will make the pickle memotable invisible to 
tracemalloc?"

Currently, _Py_hashtabe uses PyMem_RawMalloc and PyMem_RawFree by default 
(realloc is not needed, we need to keep the previous buckets on rehash). Using 
_Py_hashtable_new_full, you can choose a different memory allocator.

Hum, wait. tracemalloc uses trace PyMem_RawMalloc and PyMem_RawFree. In fact, 
tracemalloc ignores reentrant calls to the memory allocator. So now I don't 
remember exactly why I chose a custom hash table implementation :-) Maybe 
because Python dict requires Python objects with reference counter, use the 
garbage collector, etc.

--

___
Python tracker 

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



[issue20584] On FreeBSD, signal.NSIG is smaller than biggest signal value

2014-05-23 Thread Jan-Philip Gehrcke

Jan-Philip Gehrcke added the comment:

We should match the unit test with the documentation for signal.NSIG. Either 
the code or the docs or both need to change.

Currently the docs say that signal.NSIG is "One more than the number of the 
highest signal number." 
("https://docs.python.org/3.4/library/signal.html#signal.NSIG).

In case of FreeBSD's _SIG_MAXSIG (128) the documentation is still wrong: the 
highest signal value MAX is 126 (see 
http://bugs.python.org/issue20584#msg210892). According to the docs, NSIG 
should then be 127.

In signal_nsig_freebsd-2.patch the test `self.assertLess(max(signals), 
signal.NSIG)` tests for NSIG > MAX instead of for NSIG = MAX+1.

So, either 

- we count signals by ourselves and build our own value of NSIG, in which case 
we can guarantee that NSIG = MAX+1 or

- we rely on the platform header files for extracting NSIG, but must note in 
the docs that NSIG is not always MAX+1.

The current patch + a documentation change would implement the latter case.

What is the exact meaning of _SIG_MAXSIG, where is that meaning defined?

--

___
Python tracker 

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



[issue21523] quadratic-time compilation in the number of 'and' or 'or' expressions

2014-05-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cd62cc331572 by Antoine Pitrou in branch '3.4':
Issue #21523: Fix over-pessimistic computation of the stack effect of some 
opcodes in the compiler.
http://hg.python.org/cpython/rev/cd62cc331572

New changeset e61462e18112 by Antoine Pitrou in branch 'default':
Issue #21523: Fix over-pessimistic computation of the stack effect of some 
opcodes in the compiler.
http://hg.python.org/cpython/rev/e61462e18112

New changeset 49588a510ed4 by Antoine Pitrou in branch '2.7':
Issue #21523: Fix over-pessimistic computation of the stack effect of some 
opcodes in the compiler.
http://hg.python.org/cpython/rev/49588a510ed4

--
nosy: +python-dev

___
Python tracker 

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



[issue21523] quadratic-time compilation in the number of 'and' or 'or' expressions

2014-05-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This should be fixed now!

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



[issue21559] OverflowError should not happen for integer operations

2014-05-23 Thread theme

New submission from theme:

>From the documentation at 
>https://docs.python.org/3.4/library/exceptions.html#OverflowError all integer 
>operations should not throw OverflowError no matter what. However, there are 
>so many issues here that describe library functions and built-in functions 
>doing exactly that (just search this website for OverflowError).
This might cause an expected uncaught exception that the cause cannot be 
deduced after reading the documentation.
There are 2 ways to fix this: either change the documentation, or change 
something in the core of the interpreter.
Note: I don't know what versions of python this affects, but I have tested this 
on python 3.4.0 on windows. (the version that was downloadable from 
www.python.org/downloads/)

--
assignee: docs@python
components: Documentation, Interpreter Core
messages: 218957
nosy: docs@python, theme
priority: normal
severity: normal
status: open
title: OverflowError should not happen for integer operations
type: behavior
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



[issue21559] OverflowError should not happen for integer operations

2014-05-23 Thread theme

Changes by theme :


--
components: +Library (Lib)

___
Python tracker 

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



[issue20584] On FreeBSD, signal.NSIG is smaller than biggest signal value

2014-05-23 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso added the comment:

Salut!, amis français!  (Und auch sonst so, natürlich.)

POSIX has recently standardized a NSIG_MAX constant in  [1]:

  The value of {NSIG_MAX} shall be no greater than the number of signals that 
the sigset_t type (see [cross-ref to ]) is capable of representing, 
ignoring any restrictions imposed by sigfillset() or sigaddset().

I'm personally following an advise of Rich Felker in the meantime:

  #ifdef NSIG_MAX
  # undef NSIG
  # define NSIG   NSIG_MAX
  #elif !defined NSIG
  # define NSIG   ((sizeof(sigset_t) * 8) - 1)
  #endif

That is for "old" signals only, there; maybe reducing this to

  #undef NSIG
  #ifdef NSIG_MAX
  # define NSIG  NSIG_MAX
  #else
  # define NSIG  ((sizeof(sigset_t) * 8) - 1)
  #endif 

should do the trick for Python on any POSIX system?
Ciao from, eh, gray, Germany :)

[1] 

--

___
Python tracker 

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



[issue20635] Fix the grid geometry manager and add tests for geometry managers

2014-05-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9ab1225b6cc5 by Serhiy Storchaka in branch '2.7':
Issue #20635: Added tests for Tk geometry managers.
http://hg.python.org/cpython/rev/9ab1225b6cc5

--

___
Python tracker 

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



[issue21522] Add more tkinter tests

2014-05-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a7082e2898aa by Serhiy Storchaka in branch '2.7':
Issue #21522: Added Tkinter tests for Listbox.itemconfigure(),
http://hg.python.org/cpython/rev/a7082e2898aa

New changeset f7c012ff33cb by Serhiy Storchaka in branch '3.4':
Issue #21522: Added Tkinter tests for Listbox.itemconfigure(),
http://hg.python.org/cpython/rev/f7c012ff33cb

New changeset 4034c96a98a7 by Serhiy Storchaka in branch 'default':
Issue #21522: Added Tkinter tests for Listbox.itemconfigure(),
http://hg.python.org/cpython/rev/4034c96a98a7

--
nosy: +python-dev

___
Python tracker 

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



[issue21558] Fix a typo in the contextlib docs

2014-05-23 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue21560] gzip.write changes trailer ISIZE field before type checking - corrupted gz file after trying to write string

2014-05-23 Thread Wolfgang Maier

New submission from Wolfgang Maier:

I ran into this:

>>> gzout = gzip.open('test.gz','wb')
>>> gzout.write('abcdefgh') # write expects bytes not str
Traceback (most recent call last):
  File "", line 1, in 
gzout.write('abcdefgh')
  File "/usr/lib/python3.4/gzip.py", line 343, in write
self.crc = zlib.crc32(data, self.crc) & 0x
TypeError: 'str' does not support the buffer interface

>>> gzout.write(b'abcdefgh') # ok, use bytes instead
8
>>> gzout.close()

But now the file is not recognized as valid gzip format anymore (neither by the 
gzip module nor by external software):

>>> gzin = gzip.open('test.gz','rb')
>>> next(gzin)
Traceback (most recent call last):
  File "", line 1, in 
next(gzin)
  File "/usr/lib/python3.4/gzip.py", line 594, in readline
c = self.read(readsize)
  File "/usr/lib/python3.4/gzip.py", line 365, in read
if not self._read(readsize):
  File "/usr/lib/python3.4/gzip.py", line 465, in _read
self._read_eof()
  File "/usr/lib/python3.4/gzip.py", line 487, in _read_eof
raise OSError("Incorrect length of data produced")
OSError: Incorrect length of data produced

Turns out that gzip.write increased the ISIZE field value by 8 already during 
the failed call with the str object, so it is now 16 instead of 8:
>>> raw = open('test.gz','rb')
>>> [n for n in raw.read()] # ISIZE is the fourth last element
[31, 139, 8, 8, 51, 46, 127, 83, 2, 255, 116, 101, 115, 116, 0, 75, 76, 74, 78, 
73, 77, 75, 207, 0, 0, 80, 42, 239, 174, 16, 0, 0, 0]

in other words: gzip.GzipFile.write() leaps (and modifies) before it checks its 
input argument.

--
components: Library (Lib)
messages: 218961
nosy: wolma
priority: normal
severity: normal
status: open
title: gzip.write changes trailer ISIZE field before type checking - corrupted 
gz file after trying to write string
type: behavior
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



[issue7094] Add alternate float formatting styles to new-style formatting.

2014-05-23 Thread Stefan Krah

Stefan Krah added the comment:

This might be out of date: _decimal has never implemented alternate
formatting and so far there have been no reported issues.

Another data point: Go apparently implements alternate formatting
only for octal, hex and strings:

http://golang.org/pkg/fmt/


So I'm unsure if anyone is actually using alternate formatting.
I think complaints about 2-to-3 porting problems should have
surfaced by now.

--

___
Python tracker 

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



[issue20635] Fix the grid geometry manager and add tests for geometry managers

2014-05-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue21522] Add more tkinter tests

2014-05-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue21356] Support LibreSSL (instead of OpenSSL): make RAND_egd optional

2014-05-23 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox

___
Python tracker 

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



[issue21560] gzip.write changes trailer ISIZE field before type checking - corrupted gz file after trying to write string

2014-05-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +easy
stage:  -> needs patch
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



[issue21560] gzip.write changes trailer ISIZE field before type checking - corrupted gz file after trying to write string

2014-05-23 Thread Wolfgang Maier

Wolfgang Maier added the comment:

ok, this seems to be really easy:
patch attached

--
keywords: +patch
Added file: http://bugs.python.org/file35323/GzipFile_write.patch

___
Python tracker 

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



[issue21560] gzip.write changes trailer ISIZE field before type checking - corrupted gz file after trying to write string

2014-05-23 Thread Wolfgang Maier

Wolfgang Maier added the comment:

or not - my patch just causes a different error in my example :(

--

___
Python tracker 

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



[issue21560] gzip.write changes trailer ISIZE field before type checking - corrupted gz file after trying to write string

2014-05-23 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Moving `self.crc = zlib.crc32(data, self.crc) & 0x` before `self.size = 
self.size + len(data)` should be enough. Also, your patch needs a test.

--
nosy: +Claudiu.Popa

___
Python tracker 

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



[issue21560] gzip.write changes trailer ISIZE field before type checking - corrupted gz file after trying to write string

2014-05-23 Thread Wolfgang Maier

Wolfgang Maier added the comment:

isn't this exactly what I did in my patch ?

actually, it is working, I just had an error in my preliminary test script.

I may be able to work on an official test at some point, but definitely not 
over the next week

--

___
Python tracker 

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



[issue21555] gcmodule.c could use pytime.h

2014-05-23 Thread Geoffrey Spear

Changes by Geoffrey Spear :


--
nosy: +geoffreyspear

___
Python tracker 

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



[issue21545] Tutorial: examples and comment about mutation methods

2014-05-23 Thread David Harrigan

David Harrigan added the comment:

Thanks for the info, I've signed the agreement.

--

___
Python tracker 

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



[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f0452bc62cc3 by Serhiy Storchaka in branch '3.4':
Issue #21538: The plistlib module now supports loading of binary plist files
http://hg.python.org/cpython/rev/f0452bc62cc3

New changeset b2c5d0cba5fd by Serhiy Storchaka in branch 'default':
Issue #21538: The plistlib module now supports loading of binary plist files
http://hg.python.org/cpython/rev/b2c5d0cba5fd

--
nosy: +python-dev

___
Python tracker 

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



[issue21555] gcmodule.c could use pytime.h

2014-05-23 Thread Geoffrey Spear

Geoffrey Spear added the comment:

Attached patch replaces call to Python time.time() with _PyTime_gettimeofday() 
call.

--
keywords: +patch
Added file: http://bugs.python.org/file35324/issue21555.patch

___
Python tracker 

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



[issue16428] turtle with compound shape doesn't get clicks

2014-05-23 Thread ingrid

ingrid added the comment:

I tried the same script in Python 2.7 and Python 3.4.1 on OSX and had the same 
results.

--
nosy: +ingrid

___
Python tracker 

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



[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you John for your report.

--

___
Python tracker 

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



[issue21555] gcmodule.c could use pytime.h

2014-05-23 Thread Geoffrey Spear

Geoffrey Spear added the comment:

revised patch; thanks to berkerpeksag's code review.

--
Added file: http://bugs.python.org/file35325/issue21555-2.patch

___
Python tracker 

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



[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
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



[issue9253] argparse: optional subparsers

2014-05-23 Thread Sergey Vilgelm

Changes by Sergey Vilgelm :


--
nosy: +svilgelm

___
Python tracker 

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



[issue15809] 2.7 IDLE console uses incorrect encoding.

2014-05-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

When someone reads file in locale encoding (either as str or unicode in 2.7), 
he gets printable result. When someone lists directory, he gets printable 
result (str or unicode). When someone enter string literal (either str or 
unicode) in interactive mode, he gets printable result. This is expected 
behavior. And this means that default encoding for text files, filesystem 
encoding and encoding used in interactive Python (or IDLE console) should be 
the same, locale encoding.

> Irdb said "As a Windows user, currently I can't print u'йцук' in interactive 
> mode and get an "Unsupported characters in input" error because my default 
> system encoding (cp1256) can't encode Russian.)"

This is different issue. It would be better if IDLE will filter pasted text and 
replace unencodable characters or underscore them with wavy red line.

--

___
Python tracker 

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



[issue21513] speed up some ipaddress properties

2014-05-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

May be move implementations to parent class? In any case the patch LGTM.

--

___
Python tracker 

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



[issue20853] pdb "args" crashes when an arg is not printable

2014-05-23 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Commands that silently fail when an object is not printable: p, pp
Commands that crash when an object is not printable:
args, retval
Python 3: display
Python 2: on a 'return' trace event when the return value is not printable

The attached script illustrates all these cases.

--
Added file: http://bugs.python.org/file35326/safe_repr.py

___
Python tracker 

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



[issue14019] Unify tests for str.format and string.Formatter

2014-05-23 Thread Brett Cannon

Brett Cannon added the comment:

Set to "pending" while I wait to hear back from Francisco on the review 
comments.

--
status: open -> pending

___
Python tracker 

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



[issue21474] Idle: updata fixwordbreaks() for unicode identifiers

2014-05-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +easy
stage: test needed -> needs patch

___
Python tracker 

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



[issue14710] pkgutil.get_loader and find_loader fail when module is missing

2014-05-23 Thread Brett Cannon

Changes by Brett Cannon :


--
title: pkgutil.get_loader is broken -> pkgutil.get_loader and find_loader fail 
when module is missing

___
Python tracker 

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



[issue14710] pkgutil.get_loader and find_loader fail when module is missing

2014-05-23 Thread Brett Cannon

Changes by Brett Cannon :


--
versions:  -Python 2.7

___
Python tracker 

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



[issue14710] pkgutil.get_loader and find_loader fail when module is missing

2014-05-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 660c82192c69 by Brett Cannon in branch '3.4':
Issue #14710: Fix both pkgutil.find_loader() and get_loader() to not
http://hg.python.org/cpython/rev/660c82192c69

New changeset 1adc8eb362f0 by Brett Cannon in branch 'default':
Merge for issue #14710
http://hg.python.org/cpython/rev/1adc8eb362f0

--
nosy: +python-dev

___
Python tracker 

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



[issue14710] pkgutil.get_loader and find_loader fail when module is missing

2014-05-23 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for the bug report, Pavel. It turned out pkgutil.find_loader is broken 
as well as pkgutil.get_loader in different ways.

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



[issue21561] help() on enum34 enumeration class creates only a dummy documentation

2014-05-23 Thread Andy Maier

New submission from Andy Maier:

Using the enum34 backport of enums, the help() function on an enum class Colors 
displays only:


---
Help on class Colors in module __main__:

Colors = 
---

Source code to reproduce:
---
from enum import Enum # enum34 package

class Colors(Enum):
"""docstring for enumeration Colors"""
RED = 1
GREEN = "2"
BLUE = [3]

help(Colors)
---

Versions used:
  python 2.7.6
  enum34 1.0
Platform: Windows 7

I debugged the issue, found the place where it breaks down, and made a fix. 
However, it may well be that the fix is just a cure to a symptom, and that a 
better fix is possible.

Here is the fix:
In pydoc.py, class TextDoc, method docclass():
Change this code on line 1220+:
---
if thisclass is __builtin__.object:
attrs = inherited
continue
elif thisclass is object:
tag = "defined here"
else:
tag = "inherited from %s" % classname(thisclass,
  object.__module__)
---
to this, by adding the two lines marked with "added":
---
if thisclass is __builtin__.object:
attrs = inherited
continue
elif thisclass is object:
tag = "defined here"
elif thisclass is None:# <-- added
tag = "inherited from TBD" # <-- added
else:
tag = "inherited from %s" % classname(thisclass,
  object.__module__)
---

It breaks down during the last round through the 'while attrs' loop, where 
thisclass is None. I did not investigate why thisclass is None.

Without the fix, this causes an AttributeError to be raised by the classname() 
function, which then further on causes the dummy documentation to be generated.

With the fix, the help(Colors) output becomes:

---
Help on class Colors in module __main__:

class Colors(enum.Enum)
 |  docstring for enumeration Colors
 |
 |  Method resolution order:
 |  Colors
 |  enum.Enum
 |  __builtin__.object
 |
 |  Data and other attributes defined here:
 |
 |  BLUE = 
 |
 |  GREEN = 
 |
 |  RED = 
 |
 |  --
 |  Data and other attributes inherited from TBD:
 |
 |  __members__ = {'BLUE': , 'GREEN': http://bugs.python.org/file35327/bug1.py

___
Python tracker 

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



[issue21474] Idle: updata fixwordbreaks() for unicode identifiers

2014-05-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Deleting the function and calls to it would be easy. But my memory, which could 
be off, is that I left fixwordbreaks(root) in the test function now called 
_editor_window (at the end of the file) because the test did not work right 
without it. I willhave to recheck.

Beyond that, my first experiments were aimed at discovering the functions 
affected and therefor what would have to be tested with any changes.

To properly test this requires simulating keystrokes, like control-backspace, 
as opposed to inserting characters. Are there any tk/tkinter tests that do 
this, that I could use as a model?

--

___
Python tracker 

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



[issue21477] Idle: improve idle_test.htest

2014-05-23 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +jesstess

___
Python tracker 

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



[issue20383] Add a keyword-only spec argument to types.ModuleType

2014-05-23 Thread Eric Snow

Eric Snow added the comment:

@Brett: Did those last two messages (and the patch) get on the wrong issue.  
The issue of module_from_spec() or the like seems somewhat orthogonal to a spec 
argument to ModuleType.  Perhaps you meant issue #21436 or #21235?

Otherwise, I have a few comments. :)

--

___
Python tracker 

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



[issue21561] help() on enum34 enumeration class creates only a dummy documentation

2014-05-23 Thread Ethan Furman

Ethan Furman added the comment:

Good work.

This bug was fixed in 3.4 with the inclusion of enum.

It would definitely be good to fix in 2.7 as well.

--
nosy: +ethan.furman

___
Python tracker 

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



[issue17172] Add turtledemo to IDLE menu

2014-05-23 Thread Lita Cho

Lita Cho added the comment:

I tested the patch and it looks correct upon inspection. It looks like it 
applies cleanly and a straight forward solution. 

I made a slight change so that when the Demo exits, it has a better message. I 
also added the change to the NEWS.txt file. 

I also ran the IDLE tests, and everything passed. I didn't see new tests added, 
but I am not sure if that is needed, since we are just adding a menu binding.

I've attached my patch with the changes listed above. It should be ready for 
review.

--
nosy: +Lita.Cho, jesstess
Added file: http://bugs.python.org/file35328/issue.patch

___
Python tracker 

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



[issue20584] On FreeBSD, signal.NSIG is smaller than biggest signal value

2014-05-23 Thread Charles-François Natali

Charles-François Natali added the comment:

> Jan-Philip Gehrcke added the comment:
>
> Currently the docs say that signal.NSIG is "One more than the number of the 
> highest signal number." 
> ("https://docs.python.org/3.4/library/signal.html#signal.NSIG).
>
> In case of FreeBSD's _SIG_MAXSIG (128) the documentation is still wrong: the 
> highest signal value MAX is 126 (see 
> http://bugs.python.org/issue20584#msg210892). According to the docs, NSIG 
> should then be 127.

Yeah, but it doesn't matter.
We shouldn't be exposing this constant in the first place, all that
matters is that we accept all valid signals, and we don't crash whe
passing an invalid once (ssee below).

> Steffen Daode Nurpmeso added the comment:
>
>   #ifdef NSIG_MAX
>   # undef NSIG
>   # define NSIG   NSIG_MAX
>   #elif !defined NSIG
>   # define NSIG   ((sizeof(sigset_t) * 8) - 1)
>   #endif
>
> should do the trick for Python on any POSIX system?

This assumes that sigset_t is implemented as a raw bitmap, which isn't
documented (is could be implemented by an arbitrary  data structure).
On the other hand, it's really really likely, and should guarantee
that sigset & Co don't crash on too large values (or write to
arbitrary memory locations like fd_set when passed fd > FD_SETSIZE).

So I think we should go for the above patch (Steffen's), with a doc
update saying that "NSIG is a value larger than the largest signals".
If the OS headers don't provide it, it's not our business to try to
infer it.

--

___
Python tracker 

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



[issue3015] tkinter with wantobjects=False has been broken for some time

2014-05-23 Thread Lita Cho

Changes by Lita Cho :


--
nosy: +Lita.Cho, jesstess

___
Python tracker 

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



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2014-05-23 Thread Charles Merriam

Charles Merriam added the comment:

Some more information to just nail this thing that's been here forever.

1.  This has been an issue in Python since at least 2001.
2.  It is a duplicate of the item 441129 which was closed as won't fix.
3.  It is bug in curses implementations.
4.  This occurs whenever the lower-right character of a screen or window is 
written.  The writing, via addch() or addstr(), causes the cursor to advance 
outside the window and triggers the error.  It triggers the same error as 
attempting to write beyond the edge of the screen, window, or pad.   
5.  This occurs with the main windows, sub windows, and pads.
6.  There are two work-arounds for users:
a.   Don't do that.  Make your window bigger.
b.   Catch and ignore the error.  The library does the right thing but 
is trying to be too smart about raising errors.
7.  There are two good resolutions to the problem:
a.  Document it.  Add a note to addch() and addstr() to the effect:
"Writing outside the pad, window, or subwindow will cause a 
curses.error Exception.  Also, attempting to write the lower right corner of a 
pad, window, or sub window will cause an exception to be raised after the 
character is printed.  You may safely ignore the error in this case."
b.  Document it as above and add an example.
c.  Wrap it so it works on Python if no other curses implementation.  Many 
long discussions can be arguments before agreeing why this a bad idea.
 
This is an annoying, obscure bug that deserves a couple lines in the 
documentation.  If you need sample code, I can provide.

--
nosy: +Charles.Merriam

___
Python tracker 

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



[issue21562] curses getsxy() should be curses getxy() in https://docs.python.org/3/library/curses.html#curses.cursxy

2014-05-23 Thread Charles Merriam

New submission from Charles Merriam:

https://docs.python.org/3/library/curses.html#curses.cursxy

The symbol 'getsxy' does not exist in the curses library.  The correct symbol 
is 'getxy'.

--
assignee: docs@python
components: Documentation
messages: 218986
nosy: Charles.Merriam, docs@python
priority: normal
severity: normal
status: open
title: curses getsxy() should be curses getxy() in 
https://docs.python.org/3/library/curses.html#curses.cursxy
type: behavior
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



[issue15809] 2.7 IDLE console uses incorrect encoding.

2014-05-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I wonder if we should consider extracting the body of
if isinstance(source, types.UnicodeType):
as a function, call it ufix_latin1; add one or more alterntives, ufix_utf8, 
ufix_locale, ufix_irdb(?); keep ufix_latin1 as default; but switch to an 
alternative according to an Idle command line switch (or environmental 
variable?)?

--

___
Python tracker 

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



[issue21563] Segv during call to builtin_execfile in application embedding Python interpreter.

2014-05-23 Thread Robert Snoeberger

New submission from Robert Snoeberger:

While embedding the Python 2.7 interpreter in an application, I have 
encountered a crash when the built-in function 'execfile' is invoked with one 
argument.

A file is attached, execfile_invoke.c, that reproduces the crash. The 
reproduction steps on my machine are the following:

% gcc -o execfile_invoke execfile_invoke.c -I/usr/include/python2.7 -L/usr/lib 
-lpthread -ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic
% ./execfile_invoke
Call execfile with one argument...
Segmentation fault
% 

I am using the following version of Python.

Python 2.7.3 (default, Mar 13 2014, 11:03:55) 
[GCC 4.7.2] on linux2

The crash appears to occur because a call to PyEval_GetGlobals returns a NULL 
PyObject*,

globals = PyEval_GetGlobals();

and PyDict_GetItemString is called before a NULL check is performed.

In the Python 3 function builtin_exec, globals and locals are checked for NULL. 
If either is NULL, an exception with message "globals and locals cannot be 
NULL" is set.

if (!globals || !locals) {
 PyErr_SetString(PyExc_SystemError,
"globals and locals cannot be NULL");
   return NULL;
}

--
files: execfile_invoke.c
messages: 218988
nosy: snoeberger
priority: normal
severity: normal
status: open
title: Segv during call to builtin_execfile in application embedding Python 
interpreter.
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file35329/execfile_invoke.c

___
Python tracker 

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



[issue21522] Add more tkinter tests

2014-05-23 Thread Ned Deily

Ned Deily added the comment:

Failing tests with Tk 8.4 (Carbon Tk 8.4.20 on OS X):


==
ERROR: test_paneconfigure_hide 
(tkinter.test.test_tkinter.test_widgets.PanedWindowTest)
--
Traceback (most recent call last):
  File 
"/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.5/lib/python3.5/tkinter/test/test_tkinter/test_widgets.py",
 line 995, in test_paneconfigure_hide
self.check_paneconfigure(p, b, 'hide', False, 0)
  File 
"/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.5/lib/python3.5/tkinter/test/test_tkinter/test_widgets.py",
 line 967, in check_paneconfigure
p.paneconfigure(b, **{name: value})
  File 
"/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.5/lib/python3.5/tkinter/__init__.py",
 line 3818, in paneconfigure
self._options(cnf, kw))
_tkinter.TclError: unknown option "-hide"

==
ERROR: test_paneconfigure_stretch 
(tkinter.test.test_tkinter.test_widgets.PanedWindowTest)
--
Traceback (most recent call last):
  File 
"/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.5/lib/python3.5/tkinter/test/test_tkinter/test_widgets.py",
 line 1027, in test_paneconfigure_stretch
self.check_paneconfigure(p, b, 'stretch', 'alw', 'always')
  File 
"/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.5/lib/python3.5/tkinter/test/test_tkinter/test_widgets.py",
 line 967, in check_paneconfigure
p.paneconfigure(b, **{name: value})
  File 
"/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.5/lib/python3.5/tkinter/__init__.py",
 line 3818, in paneconfigure
self._options(cnf, kw))
_tkinter.TclError: unknown option "-stretch"

==
FAIL: test_paneconfigure_height 
(tkinter.test.test_tkinter.test_widgets.PanedWindowTest)
--
Traceback (most recent call last):
  File 
"/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.5/lib/python3.5/tkinter/test/test_tkinter/test_widgets.py",
 line 989, in test_paneconfigure_height
self.check_paneconfigure(p, b, 'height', 10, 10)
  File 
"/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.5/lib/python3.5/tkinter/test/test_tkinter/test_widgets.py",
 line 968, in check_paneconfigure
self.assertEqual(p.paneconfigure(b, name)[4], expected)
AssertionError:  != 10

==
FAIL: test_paneconfigure_width 
(tkinter.test.test_tkinter.test_widgets.PanedWindowTest)
--
Traceback (most recent call last):
  File 
"/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.5/lib/python3.5/tkinter/test/test_tkinter/test_widgets.py",
 line 1034, in test_paneconfigure_width
self.check_paneconfigure(p, b, 'width', 10, 10)
  File 
"/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.5/lib/python3.5/tkinter/test/test_tkinter/test_widgets.py",
 line 968, in check_paneconfigure
self.assertEqual(p.paneconfigure(b, name)[4], expected)
AssertionError:  != 10

--
nosy: +ned.deily
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue16428] turtle with compound shape doesn't get clicks

2014-05-23 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +gregorlingl

___
Python tracker 

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



[issue21561] help() on enum34 enumeration class creates only a dummy documentation

2014-05-23 Thread Ned Deily

Ned Deily added the comment:

If the problem reported here applies only to the 2.7 backport of enum, which is 
not part of the Python standard library, shouldn't this issue be closed?

--
nosy: +ned.deily

___
Python tracker 

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



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2014-05-23 Thread Ned Deily

Ned Deily added the comment:

FTR, the previous issue is Issue441429.  A documentation patch would be 
welcomed.

--
assignee:  -> docs@python
components: +Documentation
keywords: +easy
nosy: +docs@python, ned.deily
stage:  -> needs patch
versions: +Python 3.5 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue21562] curses getsxy() should be curses getxy() in https://docs.python.org/3/library/curses.html#curses.cursxy

2014-05-23 Thread Ned Deily

Changes by Ned Deily :


--
keywords: +easy
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



[issue21474] Idle: updata fixwordbreaks() for unicode identifiers

2014-05-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

word.tcl in Tcl library contains following lines:

if {$::tcl_platform(platform) eq "windows"} {
# Windows style - any but a unicode space char
set ::tcl_wordchars {\S}
set ::tcl_nonwordchars {\s}
} else {
# Motif style - any unicode word char (number, letter, or underscore)
set ::tcl_wordchars {\w}
set ::tcl_nonwordchars {\W}
}

So by default all works as expected in Motif style, but not in Windows style.

If you want to have same behavior in both styles, defines word chars as:

tk.call('set', 'tcl_wordchars', r'\w')
tk.call('set', 'tcl_nonwordchars', r'\W')

GUI tests are not needed, it is enough to test relevant Tcl commands: 
tcl_wordBreakAfter, tcl_wordBreakBefore, tcl_endOfWord, tcl_startOfNextWord, 
and tcl_startOfPreviousWord or TextSelectTo. It's interesting, there are no 
tests for these functions in Tcl test suite.

--

___
Python tracker 

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



[issue21561] help() on enum34 enumeration class creates only a dummy documentation

2014-05-23 Thread Ethan Furman

Ethan Furman added the comment:

The problem will affect anything that uses the same mechanism as enum.  It also 
affects (not verified) all versions of python up to 3.4 where it was fixed 
because enum exposed it.

Besides which, I did not think a bug had to affect stdlib code in order to be 
fixed -- or this just a 2.7 restriction since it's basically end-of-lifed?

--

___
Python tracker 

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



[issue21561] help() on enum34 enumeration class creates only a dummy documentation

2014-05-23 Thread Ned Deily

Ned Deily added the comment:

Sorry, I skimmed over the issue and didn't notice that the fix applied to 
pydoc.py, not enum.

--

___
Python tracker 

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



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2014-05-23 Thread Lita Cho

Changes by Lita Cho :


--
nosy: +Lita.Cho, jesstess

___
Python tracker 

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



[issue21533] built-in types dict docs - construct dict from iterable, not iterator

2014-05-23 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
assignee: docs@python -> terry.reedy
nosy: +terry.reedy
stage:  -> commit review
versions: +Python 2.7, 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



[issue21235] importlib's spec module create algorithm is not exposed

2014-05-23 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue21546] int('\0') gives wrong error message

2014-05-23 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> `int()`, `float()`, etc think python strings are null-terminated
type:  -> behavior

___
Python tracker 

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



[issue21564] Declaration of EVP_MD_CTX causes crash when switching between OpenSSL 0.9 and 1.0

2014-05-23 Thread Ryan Calhoun

New submission from Ryan Calhoun:

OpenSSL, specifically libcrypto, includes functions EVP_MD_CTX_create() and 
EVP_MD_CTX_destroy(), such that the application code only needs to forward 
declare the EVP_MD_CTX* pointer type.

Declaring the EVP_MD_CTX variable type directly requires compile-time knowledge 
of the size of the structure. This knowledge will be wrong when compiling with 
headers from OpenSSL 0.9.8 and dynamically linking at run time against OpenSSL 
1.0.1. Result is a SIGSEGV as follows:

(gdb) bt
#0  0x703b71a0 in EVP_PKEY_CTX_dup () from /usr/lib64/libcrypto.so
#1  0x703a90cd in EVP_MD_CTX_copy_ex () from /usr/lib64/libcrypto.so
#2  0x7110da8a in EVPnew (name_obj=0x77ef45a8, digest=0x0, 
initial_ctx=0x7130fbc0, cp=0x0, len=0)
at 
/home/ryan/vaas/python/2.7.6/build/src/Python-2.7.6/Modules/_hashopenssl.c:436
#3  0x7110de10 in EVP_new_md5 (self=, args=)
at 
/home/ryan/vaas/python/2.7.6/build/src/Python-2.7.6/Modules/_hashopenssl.c:540

The attached patch updates all declarations in _hashopenssl.c to be pointers 
initialized by calling EVP_MD_CTX_create(). The patch is done against source 
version 3.4.1. I have a similar patch for version 2.7.6, but can only attach 
one file here?

--
components: Extension Modules
files: EVP_MD_CTX-python3.4.patch
keywords: patch
messages: 218995
nosy: Ryan.Calhoun
priority: normal
severity: normal
status: open
title: Declaration of EVP_MD_CTX causes crash when switching between OpenSSL 
0.9 and 1.0
type: crash
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file35330/EVP_MD_CTX-python3.4.patch

___
Python tracker 

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



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2014-05-23 Thread Charles Merriam

Charles Merriam added the comment:

My typo.  Documentation verbiage was included in the bug report.
Submitting a patch to the documentation is a harder than just
rewriting the library.  I speak English, MarkDown, HTML, JavaScript,
and even RST.  I don't speak Sphinx, DocBook, or TeX.

On Fri, May 23, 2014 at 12:32 PM, Ned Deily  wrote:
>
> Ned Deily added the comment:
>
> FTR, the previous issue is Issue441429.  A documentation patch would be 
> welcomed.
>
> --
> assignee:  -> docs@python
> components: +Documentation
> keywords: +easy
> nosy: +docs@python, ned.deily
> stage:  -> needs patch
> versions: +Python 3.5 -Python 3.2, Python 3.3
>
> ___
> Python tracker 
> 
> ___

--
nosy: +CharlesMerriam

___
Python tracker 

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



[issue21522] Add more tkinter tests

2014-05-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c7ee46ed2d70 by Serhiy Storchaka in branch '2.7':
Fixed new Tkinter tests added in issue #21522 with Tk 8.4.
http://hg.python.org/cpython/rev/c7ee46ed2d70

New changeset 854404294f34 by Serhiy Storchaka in branch '3.4':
Fixed new Tkinter tests added in issue #21522 with Tk 8.4.
http://hg.python.org/cpython/rev/854404294f34

New changeset 1079772e7309 by Serhiy Storchaka in branch 'default':
Fixed new Tkinter tests added in issue #21522 with Tk 8.4.
http://hg.python.org/cpython/rev/1079772e7309

--

___
Python tracker 

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



[issue21548] pydoc -k IndexError on empty docstring

2014-05-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Replacing 2061 with the following should work for all versions.
desc = module.__doc__.splitlines()[0] if module.__doc__ else ''

--
nosy: +terry.reedy
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



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2014-05-23 Thread Lita Cho

Changes by Lita Cho :


___
Python tracker 

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



[issue21558] Fix a typo in the contextlib docs

2014-05-23 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +terry.reedy

___
Python tracker 

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



[issue21513] speed up some ipaddress properties

2014-05-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> May be move implementations to parent class?

Docstrings are different, though.

--

___
Python tracker 

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



[issue21522] Add more tkinter tests

2014-05-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Ned. My fault.

--

___
Python tracker 

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



[issue21513] speed up some ipaddress properties

2014-05-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7a28ab8f012f by Antoine Pitrou in branch 'default':
Issue #21513: Speedup some properties of IP addresses (IPv4Address, 
IPv6Address) such as .is_private or .is_multicast.
http://hg.python.org/cpython/rev/7a28ab8f012f

--
nosy: +python-dev

___
Python tracker 

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



[issue21513] speed up some ipaddress properties

2014-05-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Committed, thanks.

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



[issue21564] Declaration of EVP_MD_CTX causes crash when switching between OpenSSL 0.9 and 1.0

2014-05-23 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +christian.heimes, gregory.p.smith

___
Python tracker 

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



[issue21565] multiprocessing: use contex-manager protocol for synchronization primitives

2014-05-23 Thread Charles-François Natali

New submission from Charles-François Natali:

This patch updates multiprocessing to use context-manager for locks, 
conditions, etc.

--
components: Library (Lib)
files: multiprocessing_context_manager.diff
keywords: needs review, patch
messages: 219003
nosy: neologix, sbt
priority: normal
severity: normal
stage: patch review
status: open
title: multiprocessing: use contex-manager protocol for synchronization 
primitives
type: enhancement
versions: Python 3.5
Added file: 
http://bugs.python.org/file35331/multiprocessing_context_manager.diff

___
Python tracker 

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



[issue21559] OverflowError should not happen for integer operations

2014-05-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

In 2.7, it was only *long integers* that could not overflow. In both python 2 
and 3, the comment only applys to operations on integers and not to integers 
converted to floats. Perhaps that could be clarified. If have any example from 
running Python where (long) integer operations raising OverflowError and there 
is no issue about the bug, please open one. If there are any issues that 
describe such exceptions as not bugs, please list them also.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue21566] make use of the new default socket.listen() backlog argument

2014-05-23 Thread Charles-François Natali

New submission from Charles-François Natali:

Follow-up to issue #21455: we can now update the stdlib to rely on the default 
socket listen backlog, instead of having a bazillion different values (which 
range from 1 to 100!).

--
components: Library (Lib)
files: use_socket_listen_backlog.diff
keywords: needs review, patch
messages: 219005
nosy: haypo, neologix, pitrou, sbt
priority: normal
severity: normal
stage: patch review
status: open
title: make use of the new default socket.listen() backlog argument
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file35332/use_socket_listen_backlog.diff

___
Python tracker 

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



[issue21566] make use of the new default socket.listen() backlog argument

2014-05-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This looks fine to me.

--

___
Python tracker 

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



[issue21566] make use of the new default socket.listen() backlog argument

2014-05-23 Thread STINNER Victor

STINNER Victor added the comment:

Maybe we should keep listen(1) in some cases.

For socketpair() of asyncio.windows_utils, it makes sense to use sock.listen(1) 
since we expect exactly one request from one client. The listening socket is 
closed just after sock.accept().

--

___
Python tracker 

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



[issue21566] make use of the new default socket.listen() backlog argument

2014-05-23 Thread Charles-François Natali

Charles-François Natali added the comment:

> Maybe we should keep listen(1) in some cases.
>
> For socketpair() of asyncio.windows_utils, it makes sense to use 
> sock.listen(1) since we expect exactly one request from one client. The 
> listening socket is closed just after sock.accept().

Yeah, I thought about that, but almost all operating systems don't
strictly respect the backlog, they always increase it a bit, so this
wouldn't change much.

--

___
Python tracker 

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



[issue21567] cannot create multipart alternative message with us-ascii charset

2014-05-23 Thread Viktor Szépe

New submission from Viktor Szépe:

Python 2.7.6 (default, May 22 2014, 00:19:36)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from email.mime.multipart import MIMEMultipart
>>> new_msg = MIMEMultipart('alternative')
>>> new_msg.set_charset('us-ascii')
Traceback (most recent call last):
  File "", line 1, in 
  File "/opt/python/lib/python2.7/email/message.py", line 268, in set_charset
cte(self)
  File "/opt/python/lib/python2.7/email/encoders.py", line 73, in encode_7or8bit
orig.encode('ascii')
AttributeError: 'list' object has no attribute 'encode'
>>>


I know it is not necessary.
How come that
new_msg.set_charset('us-ascii')
works?

--
components: email
messages: 219009
nosy: Viktor.Szépe, barry, r.david.murray
priority: normal
severity: normal
status: open
title: cannot create multipart alternative message with us-ascii charset
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue21567] cannot create multipart alternative message with us-ascii charset

2014-05-23 Thread Viktor Szépe

Viktor Szépe added the comment:

Sorry!

How come that
new_msg.set_charset('utf-8')
works?

--

___
Python tracker 

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



[issue14019] Unify tests for str.format and string.Formatter

2014-05-23 Thread Francisco Freire

Francisco Freire added the comment:

Hi, I signed the contributor agreement. Thank you for your review comments. I 
did these tests about one year ago and right now I don't have much time to look 
at it again. I hope to do so in the next months.

--
status: pending -> open

___
Python tracker 

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



[issue3015] tkinter with wantobjects=False has been broken for some time

2014-05-23 Thread Lita Cho

Lita Cho added the comment:

I am in the process of reviewing this patch, but I don't know what 
"wantobjects" does. I can make a guess, I think it is a hack to make tcl 
objects work in Python. I am guessing this is less needed in Python 3.4, but 
still has some dependencies. 

If we can add in the documentation of what "wantobjects" is and why it is being 
depreciated somewhere, that would be great. I would do it myself, but I do need 
some direction.

I ran the tests, and it seems to run fine. The patch didn't have any new tests. 
We should add one that checks if the depreciation is working.

--

___
Python tracker 

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



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2014-05-23 Thread Lita Cho

Lita Cho added the comment:

I was looking at this more, and from my understanding, the turtle code is 
continuing to run even when the TK window is destroyed. Thus the crash.

It looks like the drawing functions are being made on the fly with the 
following method:

for methodname in _tg_turtle_functions:
pl1, pl2 = getmethparlist(eval('Turtle.' + methodname))
if pl1 == "":
print(">>", pl1, pl2)
continue
defstr = ("def %(key)s%(pl1)s: return _getpen().%(key)s%(pl2)s" %
   {'key':methodname, 'pl1':pl1, 'pl2':pl2})
exec(defstr)
eval(methodname).__doc__ = 
_turtle_docrevise(eval('Turtle.'+methodname).__doc__)

So while all the methods are being generated, I am going to add in a check to 
see if the window was destroyed before running the pen code. If it was, then I 
exit gratefully. The check will be duplicated for each pen method, but I feel 
it is the best way to contain the check within the turtle.py module. The other 
option would be to make the user check for it, which is not a good option.

--

___
Python tracker 

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



[issue21558] Fix a typo in the contextlib docs

2014-05-23 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Berker, feel free to assign all these micro-doc fixes to me.   Also, if you 
want to combine a number of clear-cut, non-controversial fixes into just one 
patch and tracker item, that might save us both some time.

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



[issue13355] random.triangular error when low = high=mode

2014-05-23 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Attaching patch

--
Added file: http://bugs.python.org/file35333/fix_triangular.diff

___
Python tracker 

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



[issue17172] Add turtledemo to IDLE menu

2014-05-23 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +terry.reedy

___
Python tracker 

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



[issue7094] Add alternate float formatting styles to new-style formatting.

2014-05-23 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> So I'm unsure if anyone is actually using alternate formatting.

That makes sense.  Any further effort should wait until there is known demand.  
Otherwise, we risk growing the API with codes that aren't used.

--
resolution:  -> later
versions: +Python 3.5 -Python 3.2

___
Python tracker 

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



[issue21386] ipaddress.IPv4Address.is_global not implemented

2014-05-23 Thread Berker Peksag

Berker Peksag added the comment:

+@property
+def is_global(self):
+return (not self in IPv4Network('100.64.0.0/10') and

Can IPv4Network('100.64.0.0/10') moved to the _IPv4Constants class (e.g. 
_IPv4Constants._global_network = IPv4Network('100.64.0.0/10')) after 
http://hg.python.org/cpython/rev/e5d963cb6afc (see also issue 21513)

+not self.is_private)

--
nosy: +berker.peksag
stage:  -> patch review
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



[issue21568] Win32 pip doesn't use relative path to found site-packages.

2014-05-23 Thread 勇刚 罗

New submission from 勇刚 罗:

I want to directly copy python as a portable version.
But the pip always point to the place where it installed,
So I am asking pip use relative to found site-packages under win32.

--
messages: 219018
nosy: 勇刚.罗
priority: normal
severity: normal
status: open
title: Win32 pip doesn't use relative path to found site-packages.
versions: 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



[issue13355] random.triangular error when low = high=mode

2014-05-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

So now triangular(10, 10, 20) will always return 10?

--

___
Python tracker 

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



[issue18604] Consolidate gui available checks in test.support

2014-05-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fef11a65a5e5 by Ned Deily in branch '2.7':
Issue #18604: Skip the Tk instantiation test on OS X because it can
http://hg.python.org/cpython/rev/fef11a65a5e5

--

___
Python tracker 

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



[issue21477] Idle: improve idle_test.htest

2014-05-23 Thread Saimadhav Heblikar

Saimadhav Heblikar added the comment:

Posting a cumulative patch of all htest written so far.

They include IOBinding, Tooltips, MultiStatusbar, tabbedpages, objectbrowser,
scrolledlist, dynOptionWidget, treewidget, widgetredirector,
colordelegator, calltip and multicall, besides aboutDialog, ClassBrowser, 
PathBrowser, textView and configHelpSourceEdit already posted before.
This patch is named week1.diff

*Improving run/runall - (run-runall.diff)
This patch concerns more with the way run/runall are executed. The only 
modification for this occurs in the file htest.py
I have streamlined run/runall into a single function. The behavior is same as 
the current htest.py, except for the reuse of a single root window and the 
addition of a "next" button.

The logic behind it is contained in line 206 to line 223 of htest.py when 
run-runall.diff is applied.
In short, a list of tuple containing(spec, kwds and callable object) is used to 
store the required information. Global variables maintain the above information 
only for the current test. Once a user finishes a test, the values of the 
global variables are updated to reflect the values for the next test. The 
"next" button is disabled for the case when a) it is the last test 2) when 
run() is called from a module

If this approach is desired, please say so. I will work on improving the 
responsiveness of the root window(Constant size of root dialog, ensuring 
buttons, labels etc stay in the "same place" and dont "jump" around).

--
Added file: http://bugs.python.org/file35334/week1.diff

___
Python tracker 

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



[issue21477] Idle: improve idle_test.htest

2014-05-23 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar :


Added file: http://bugs.python.org/file35335/run-runall.diff

___
Python tracker 

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



  1   2   >