[issue22770] test_ttk_guionly and test_tk can cause Tk segfaults on OS X when run with regrtest -j option

2014-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What if add root.update_idletasks() before root.destroy() in 
Lib/test/support/__init__.py? Does this fix the problem?

--
assignee:  -> ned.deily
type:  -> crash

___
Python tracker 

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



[issue22770] test_ttk_guionly and test_tk can cause Tk segfaults on OS X when run with regrtest -j option

2014-10-31 Thread Ned Deily

Ned Deily added the comment:

Adding root.update_idletasks() before root.destroy() doesn't help by itself.  
As I noted in the Tk issue, to avoid the crash without changing Tk and while 
still destroying and creating roots/Tcl instances, it is necessary to get the 
"open application" Apple event from OS X to Tk to trigger while the initial Tcl 
interpreter instance is still valid.  As far as I can tell, the way to do that 
is to ensure that the initial Tcl interpreter actually draws something on the 
screen, not just create a test button object.  The drawing triggers the 
promotion of the bundle process to a full GUI process and that (I believe) 
causes the "open application" event to be sent.  As long as that event (which 
contains the unchecked pointer to the Tcl interpreter instance) is processed by 
the interpreter that created it, there is no problem.  Once the first root is 
destroyed (in each process) without having received the "open application" 
event, when the event does arrive the interp address will be invalid a
 nd a segfault can result.

--
assignee: ned.deily -> 

___
Python tracker 

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



[issue22539] Table formatting errors in pydoc

2014-10-31 Thread Georg Brandl

Georg Brandl added the comment:

Couldn't reproduce in 3.4.2.

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



[issue22771] shutil.make_archive() doesn't use its "verbose" argument

2014-10-31 Thread Georg Brandl

New submission from Georg Brandl:

It seems like "verbose" should be passed to the archival function, but it isn't.

--
components: Library (Lib)
messages: 230324
nosy: georg.brandl
priority: normal
severity: normal
status: open
title: shutil.make_archive() doesn't use its "verbose" argument
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



[issue22770] test_ttk_guionly and test_tk can cause Tk segfaults on OS X when run with regrtest -j option

2014-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, this code doesn't run on Mac OS at all (see issue18604).

Does this patch fixes the problem? May be just root.update() would be enough.

--
keywords: +patch
Added file: http://bugs.python.org/file37082/issue22770.patch

___
Python tracker 

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



[issue22613] Several minor doc issues

2014-10-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f72271f05ea4 by Georg Brandl in branch '3.4':
#22613: fix several factual errors in builtin docs (thanks Jacques Ducasse)
https://hg.python.org/cpython/rev/f72271f05ea4

New changeset 5faee3db42a7 by Georg Brandl in branch '3.4':
#22613: explain what "buffer" is in the struct documentation (thanks Jacques 
Ducasse)
https://hg.python.org/cpython/rev/5faee3db42a7

New changeset 7d40eff70601 by Georg Brandl in branch '3.4':
#22613: elaborate on arguments of shutil archival functions (thanks Jacques 
Ducasse)
https://hg.python.org/cpython/rev/7d40eff70601

New changeset 307fd58b9694 by Georg Brandl in branch '3.4':
#22613: fix heading levels in tracemalloc docs (thanks Jacques Ducasse)
https://hg.python.org/cpython/rev/307fd58b9694

New changeset 0a217d3d581c by Georg Brandl in branch '3.4':
#22613: document Cmd.cmdqueue (thanks Jacques Ducasse)
https://hg.python.org/cpython/rev/0a217d3d581c

New changeset 4089047475c5 by Georg Brandl in branch '3.4':
#22613: minor other fixes in library docs (thanks Jacques Ducasse)
https://hg.python.org/cpython/rev/4089047475c5

New changeset 53048571de47 by Georg Brandl in branch '3.4':
#22613: remaining corrections in extending/reference docs (thanks Jacques 
Ducasse)
https://hg.python.org/cpython/rev/53048571de47

--

___
Python tracker 

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



[issue22613] Several minor doc issues

2014-10-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 60c6dc1b316f by Georg Brandl in branch '2.7':
#22613: document Cmd.cmdqueue (thanks Jacques Ducasse)
https://hg.python.org/cpython/rev/60c6dc1b316f

New changeset d3fd218ef2cf by Georg Brandl in branch '2.7':
#22613: minor other fixes in library docs (thanks Jacques Ducasse)
https://hg.python.org/cpython/rev/d3fd218ef2cf

New changeset 9e57654dfdcc by Georg Brandl in branch '2.7':
#22613: fix several factual errors in builtin docs (thanks Jacques Ducasse)
https://hg.python.org/cpython/rev/9e57654dfdcc

--

___
Python tracker 

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



[issue22613] Several minor doc issues

2014-10-31 Thread Georg Brandl

Georg Brandl added the comment:

All remaining points have been fixed.

--
nosy: +georg.brandl
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



[issue22771] shutil.make_archive() doesn't use its "verbose" argument

2014-10-31 Thread Berker Peksag

Berker Peksag added the comment:

"verbose" was used by _call_external_zip() (see 
https://hg.python.org/cpython/rev/a1d078b88247#l3.143), and 
_call_external_zip() was removed in issue 20744 (see 
https://hg.python.org/cpython/rev/681e20f8b717).

Perhaps we can deprecate "version" arguments of make_archive and _make_* 
functions.

--
nosy: +akuchling, berker.peksag

___
Python tracker 

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



[issue22613] Several minor doc issues

2014-10-31 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: needs patch -> resolved

___
Python tracker 

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



[issue22771] shutil.make_archive() doesn't use its "verbose" argument

2014-10-31 Thread Georg Brandl

Georg Brandl added the comment:

That makes sense.

--

___
Python tracker 

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



[issue22771] shutil.make_archive() doesn't use its "verbose" argument

2014-10-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 335ff0c6d879 by Georg Brandl in branch '3.4':
Closes #22771: "verbose" is unused; deprecate it.
https://hg.python.org/cpython/rev/335ff0c6d879

--
nosy: +python-dev
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



[issue17381] IGNORECASE breaks unicode literal range matching

2014-10-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6f52a3d0f548 by Serhiy Storchaka in branch 'default':
Issue #17381: Fixed handling of case-insensitive ranges in regular expressions.
https://hg.python.org/cpython/rev/6f52a3d0f548

New changeset 7981cb1556cf by Serhiy Storchaka in branch '3.4':
Issue #17381: Fixed handling of case-insensitive ranges in regular expressions.
https://hg.python.org/cpython/rev/7981cb1556cf

--
nosy: +python-dev

___
Python tracker 

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



[issue22768] Add a way to get the peer certificate of a SSL Transport

2014-10-31 Thread Mathieu Pasquet

Mathieu Pasquet added the comment:

>Maybe
>transport.get_extra_info('socket').getpeercert(True)
>would be okay, no patch needed?

Thanks, that indeed works; I don't know why I missed it while reading the 
source. Maybe the docs could use some clarification, though? (users are not 
supposed to know that _SelectorTransport is subclassed by 
_SelectorSslTransport, which thus gets the extra info of both)

--

___
Python tracker 

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



[issue22768] Add a way to get the peer certificate of a SSL Transport

2014-10-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Maybe
> transport.get_extra_info('socket').getpeercert(True)
> would be okay, no patch needed?

That will be problematic with issue22560. The clear-text socket object and the 
SSL object become unrelated, and it would be logical for 
get_extra_info('socket') to return the clear-text socket, so either a 
get_extra_info('ssl') would be needed, or we should expose the SSL properties 
directly as extra info members.

--

___
Python tracker 

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



[issue19329] Faster compiling of charset regexpes

2014-10-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ebd48b4f650d by Serhiy Storchaka in branch '2.7':
Backported the optimization of compiling charsets in regular expressions
https://hg.python.org/cpython/rev/ebd48b4f650d

--

___
Python tracker 

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



[issue17381] IGNORECASE breaks unicode literal range matching

2014-10-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ebd48b4f650d by Serhiy Storchaka in branch '2.7':
Backported the optimization of compiling charsets in regular expressions
https://hg.python.org/cpython/rev/ebd48b4f650d

New changeset 6cd4b9827755 by Serhiy Storchaka in branch '2.7':
Issue #17381: Fixed ranges handling in case-insensitive regular expressions.
https://hg.python.org/cpython/rev/6cd4b9827755

--

___
Python tracker 

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



[issue22772] doc error in __ifloordiv__ and __itruediv__

2014-10-31 Thread Lorenz Quack

New submission from Lorenz Quack:

the doc string of __itruediv__ and __ifloordiv__ represent the operator as x/y 
and x//y respectively.
This is obviously false and should be x/=y and x//=y

patch attached

--
assignee: docs@python
components: Documentation
files: inplace_div_doc.patch
keywords: patch
messages: 230337
nosy: docs@python, donlorenzo
priority: normal
severity: normal
status: open
title: doc error in __ifloordiv__ and __itruediv__
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file37083/inplace_div_doc.patch

___
Python tracker 

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



[issue22772] doc error in __ifloordiv__ and __itruediv__

2014-10-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 147518a95b60 by Georg Brandl in branch '3.4':
Closes #22772: fix __ifloordiv__ and __itruediv__ docstring.
https://hg.python.org/cpython/rev/147518a95b60

--
nosy: +python-dev
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



[issue22772] doc error in __ifloordiv__ and __itruediv__

2014-10-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3f13f1620d70 by Georg Brandl in branch '2.7':
Closes #22772: fix __ifloordiv__ and __itruediv__ docstring.
https://hg.python.org/cpython/rev/3f13f1620d70

--

___
Python tracker 

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread David Edelsohn

New submission from David Edelsohn:

The patch for Issue19884 to set enable-meta-key to "off" does not work when 
readline-devel package is libreadline5, which includes SLES 11.

--
components: Extension Modules
messages: 230340
nosy: David.Edelsohn, haypo, pitrou
priority: normal
severity: normal
status: open
title: Export Readline version and expect ANSI sequence for version < 0x6000

___
Python tracker 

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread David Edelsohn

David Edelsohn added the comment:

Patch attached to export version and skip test if version less than 0x600.

--
type:  -> behavior
Added file: http://bugs.python.org/file37084/Issue22773.txt

___
Python tracker 

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread David Edelsohn

David Edelsohn added the comment:

Revised patch with leading underscores to make version objects private.

--
Added file: http://bugs.python.org/file37085/Issue22773.txt

___
Python tracker 

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



[issue22774] Weird S.rstrip() result

2014-10-31 Thread Szieberth Ádám

New submission from Szieberth Ádám:

I just faced the following bug (v3.4.2):

>>> t1 = '#5 amarg (Concession)'
>>> t2 = '#6 ironman (Concession)'
>>> s = ' (Concession)'
>>> t1.rstrip(s)
'#5 amarg'
>>> t2.rstrip(s)
'#6 ironma'
>>> t1[:-len(s)]
'#5 amarg'
>>> t2[:-len(s)]
'#6 ironman'

--
messages: 230343
nosy: SzieberthAdam
priority: normal
severity: normal
status: open
title: Weird S.rstrip() result
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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread STINNER Victor

STINNER Victor added the comment:

I would prefer to see the bug fixed instead of being skipped :-/ Is there a way 
to fix the issue, but differently on readline < 6.0?

--

___
Python tracker 

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



[issue19884] Importing readline produces erroneous output

2014-10-31 Thread David Edelsohn

David Edelsohn added the comment:

Issue22773 provides a patch to export Readline version and skip the test for 
earlier releases of libreadline where turning off enable-meta-key does not work.

--
nosy: +David.Edelsohn

___
Python tracker 

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread David Edelsohn

David Edelsohn added the comment:

The portion of the patch to skip the test is necessary because, as mentioned in 
Issue19884, setting enable-meta-key does not work in older releases of 
libreadline. The particular combination of default TERM and libreadline is rare 
in old OS versions and can be worked around by setting TERM=dummy.

--

___
Python tracker 

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

+1 for the patch.

--
stage:  -> patch 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



[issue22774] Weird S.rstrip() result

2014-10-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

It may be unexpected, but it's not a bug. From the documentation:

"""Return a copy of the string with trailing characters removed. The chars 
argument is a string specifying the set of characters to be removed. If omitted 
or None, the chars argument defaults to removing whitespace. **The chars 
argument is not a suffix; rather, all combinations of its values are 
stripped**.""" (emphasis mine)

https://docs.python.org/3/library/stdtypes.html#str.rstrip

(if you wonder why that is, think about e.g. the use case of stripping certain 
whitespace characters: s.rstrip(" \t"))

--
nosy: +pitrou
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



[issue12728] Python re lib fails case insensitive matches on Unicode data

2014-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here are complete patch and script used to generate equivalence table.

--
Added file: http://bugs.python.org/file37086/re_ignore_case_2.patch
Added file: http://bugs.python.org/file37087/re_cases.py

___
Python tracker 

___diff -r 79eb4ab497b1 Lib/sre_compile.py
--- a/Lib/sre_compile.pyFri Oct 31 12:40:11 2014 +0200
+++ b/Lib/sre_compile.pyFri Oct 31 17:59:04 2014 +0200
@@ -27,6 +27,46 @@ else:
 _SUCCESS_CODES = set([SUCCESS, FAILURE])
 _ASSERT_CODES = set([ASSERT, ASSERT_NOT])
 
+# Sets of characters which have the same uppercase but different lowercase.
+_equivalences = (
+# LATIN SMALL LETTER I, LATIN SMALL LETTER DOTLESS I
+(0x69, 0x131), # iı
+# LATIN SMALL LETTER S, LATIN SMALL LETTER LONG S
+(0x73, 0x17f), # sſ
+# MICRO SIGN, GREEK SMALL LETTER MU
+(0xb5, 0x3bc), # µμ
+# COMBINING GREEK YPOGEGRAMMENI, GREEK SMALL LETTER IOTA, GREEK 
PROSGEGRAMMENI
+(0x345, 0x3b9, 0x1fbe), # \u0345ιι
+# GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, GREEK SMALL LETTER 
IOTA WITH DIALYTIKA AND OXIA
+(0x390, 0x1fd3), # ΐΐ
+# GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, GREEK SMALL LETTER 
UPSILON WITH DIALYTIKA AND OXIA
+(0x3b0, 0x1fe3), # ΰΰ
+# GREEK SMALL LETTER BETA, GREEK BETA SYMBOL
+(0x3b2, 0x3d0), # βϐ
+# GREEK SMALL LETTER EPSILON, GREEK LUNATE EPSILON SYMBOL
+(0x3b5, 0x3f5), # εϵ
+# GREEK SMALL LETTER THETA, GREEK THETA SYMBOL
+(0x3b8, 0x3d1), # θϑ
+# GREEK SMALL LETTER KAPPA, GREEK KAPPA SYMBOL
+(0x3ba, 0x3f0), # κϰ
+# GREEK SMALL LETTER PI, GREEK PI SYMBOL
+(0x3c0, 0x3d6), # πϖ
+# GREEK SMALL LETTER RHO, GREEK RHO SYMBOL
+(0x3c1, 0x3f1), # ρϱ
+# GREEK SMALL LETTER FINAL SIGMA, GREEK SMALL LETTER SIGMA
+(0x3c2, 0x3c3), # ςσ
+# GREEK SMALL LETTER PHI, GREEK PHI SYMBOL
+(0x3c6, 0x3d5), # φϕ
+# LATIN SMALL LETTER S WITH DOT ABOVE, LATIN SMALL LETTER LONG S WITH DOT 
ABOVE
+(0x1e61, 0x1e9b), # ṡẛ
+# LATIN SMALL LIGATURE LONG S T, LATIN SMALL LIGATURE ST
+(0xfb05, 0xfb06), # ſtst
+)
+
+# Mapping from lowercase code to lowercase codes which have the same uppercase.
+_ignorecase_fixes = {i: tuple(j for j in t if i != j)
+ for t in _equivalences for i in t}
+
 def _compile(code, pattern, flags):
 # internal: compile a (sub)pattern
 emit = code.append
@@ -35,11 +75,29 @@ def _compile(code, pattern, flags):
 REPEATING_CODES = _REPEATING_CODES
 SUCCESS_CODES = _SUCCESS_CODES
 ASSERT_CODES = _ASSERT_CODES
+if (flags & SRE_FLAG_IGNORECASE and
+not (flags & SRE_FLAG_LOCALE) and
+flags & SRE_FLAG_UNICODE):
+fixes = _ignorecase_fixes
+else:
+fixes = None
 for op, av in pattern:
 if op in LITERAL_CODES:
 if flags & SRE_FLAG_IGNORECASE:
-emit(OPCODES[OP_IGNORE[op]])
-emit(_sre.getlower(av, flags))
+lo = _sre.getlower(av, flags)
+if fixes and lo in fixes:
+emit(OPCODES[IN_IGNORE])
+skip = _len(code); emit(0)
+if op is NOT_LITERAL:
+emit(OPCODES[NEGATE])
+for k in (lo,) + fixes[lo]:
+emit(OPCODES[LITERAL])
+emit(k)
+emit(OPCODES[FAILURE])
+code[skip] = _len(code) - skip
+else:
+emit(OPCODES[OP_IGNORE[op]])
+emit(lo)
 else:
 emit(OPCODES[op])
 emit(av)
@@ -52,7 +110,7 @@ def _compile(code, pattern, flags):
 emit(OPCODES[op])
 fixup = None
 skip = _len(code); emit(0)
-_compile_charset(av, flags, code, fixup)
+_compile_charset(av, flags, code, fixup, fixes)
 code[skip] = _len(code) - skip
 elif op is ANY:
 if flags & SRE_FLAG_DOTALL:
@@ -166,10 +224,10 @@ def _compile(code, pattern, flags):
 else:
 raise ValueError("unsupported operand type", op)
 
-def _compile_charset(charset, flags, code, fixup=None):
+def _compile_charset(charset, flags, code, fixup=None, fixes=None):
 # compile charset subprogram
 emit = code.append
-for op, av in _optimize_charset(charset, fixup):
+for op, av in _optimize_charset(charset, fixup, fixes):
 emit(OPCODES[op])
 if op is NEGATE:
 pass
@@ -193,7 +251,7 @@ def _compile_charset(charset, flags, cod
 raise error("internal: unsupported set operator")
 emit(OPCODES[FAILURE])
 
-def _optimize_charset(charset, fixup):
+def _optimize_charset(charset, fixup, fixes):
 # internal: optimize character set
 out = []
 tail = []
@

[issue17381] IGNORECASE breaks unicode literal range matching

2014-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Antoine for your review.

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



[issue9179] Lookback with group references incorrect (two issues?)

2014-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If there are no objections I'm going to commit the patch soon.

--

___
Python tracker 

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



[issue17717] Set up nasm from external.bat

2014-10-31 Thread Zachary Ware

Zachary Ware added the comment:

Ok, I've imported nasm-2.11.06 to:

   http://svn.python.org/projects/external/nasm-2.11.06

I'll work on a patch for default and see what (if anything) will need to change 
in the openssl checkout.

--

___
Python tracker 

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



[issue22153] Documentation of TestCase.runTest is incorrect and confusing

2014-10-31 Thread Ezio Melotti

Ezio Melotti added the comment:

> Oh, one thought - in testtools we split out 'docs for test writers' and
> 'docs for framework folk'. That would facilitate getting runTest out of
> test writers face while still documenting it appropriately.

This has already been discussed in the past, and IIRC there was consensus about 
giving unittest docs the same treatment.  I don't remember if there was an 
issue for this.

--

___
Python tracker 

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



[issue22775] SimpleCookie not picklable with HIGHEST_PROTOCOL

2014-10-31 Thread Tim Graham

New submission from Tim Graham:

Expected:

>>> import pickle
>>> from http.cookies import SimpleCookie
>>> pickle.loads(pickle.dumps(SimpleCookie('hi=there'),2))

# Actual


Patch is based on the suggestion from Georg Brandl in #22758 (I added the 
"else" as the fix did not work without it).

--
components: Library (Lib)
files: cookie-pickle-highest.diff
keywords: patch
messages: 230354
nosy: Tim.Graham, berker.peksag, georg.brandl
priority: normal
severity: normal
status: open
title: SimpleCookie not picklable with HIGHEST_PROTOCOL
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file37088/cookie-pickle-highest.diff

___
Python tracker 

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



[issue22775] SimpleCookie not picklable with HIGHEST_PROTOCOL

2014-10-31 Thread Tim Graham

Tim Graham added the comment:

By the way, this is my first patch for Python and I submitted a CLA 2 days ago.

--

___
Python tracker 

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



[issue22143] rlcompleter.Completer has duplicate matches

2014-10-31 Thread Ezio Melotti

Ezio Melotti added the comment:

+return list(set(matches))

Shouldn't this be sorted before being returned?

--

___
Python tracker 

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



[issue22769] Tttk tag_has() throws TypeError when called without item

2014-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank your for your report David.

Here is a patch which fixes the bug and adds tests for Treeview.tag_has().

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



[issue11957] re.sub confusion between count and flags args

2014-10-31 Thread Ezio Melotti

Ezio Melotti added the comment:

I agree about 767fd62b59a9, there should be tests for args passed both by 
position and as keyword args.

Serhiy, do you think the enum solution is worth pursuing, or is it better to 
just turn those args to keyword-only (after a proper deprecation process)?

--

___
Python tracker 

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



[issue17717] Set up nasm from external.bat

2014-10-31 Thread Zachary Ware

Zachary Ware added the comment:

Fairly simple patch for default.

--
keywords: +patch
Added file: http://bugs.python.org/file37089/issue17717-default.diff

___
Python tracker 

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



[issue17717] Set up nasm from external.bat

2014-10-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I can't say anything about the patch, but thank you for automating this! One 
less manual step :-)

--

___
Python tracker 

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



[issue22706] Idle extension configuration and key bindings

2014-10-31 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar :


--
nosy: +sahutd

___
Python tracker 

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



[issue22746] cgitb html: wrong encoding for utf-8

2014-10-31 Thread Ezio Melotti

Ezio Melotti added the comment:

> In normal HTML utf-8 works fine, doesn't it?

It does, in fact as long as the encoding used by the browser matches the one 
used in the file, no charrefs needs to be used (except > < and ").  
Of course, if non-Unicode encodings are used, the range of available characters 
that can go directly in the HTML will be more limited, but this can be solved 
by using charrefs -- the browser will display the corresponding character no 
matter what is the encoding.  This also means that if charrefs are used for all 
non-ASCII characters, then the browser will be able to display the page no 
matter what encoding is being used (as long as it's ASCII-compatible, and most 
encoding are).  The downside is that it will make the source less readable and 
possible longer, especially if there are lot of non-ASCII characters, but if 
most of the characters are expected to be ASCII, using charrefs might be ok.

--

___
Python tracker 

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



[issue22751] Fix test___all__ warning about modified environment

2014-10-31 Thread Ezio Melotti

Ezio Melotti added the comment:

Are there cases where "import locale" might fail?
If so, it should maybe be moved in the try, otherwise the patch LGTM.

--
assignee:  -> ezio.melotti
nosy: +serhiy.storchaka, zach.ware
stage:  -> patch review

___
Python tracker 

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



[issue22758] Regression in Python 3.2 cookie parsing

2014-10-31 Thread Tim Graham

Tim Graham added the comment:

FYI, I created #22775 and submitted a patch for the issue that SimpleCookie 
doesn't pickle properly with HIGHEST_PROTOCOL.

--

___
Python tracker 

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



[issue22776] SyslogHandler's record formatting during emit(..) not covered by try-except block

2014-10-31 Thread Yoel

New submission from Yoel:

Not all exceptions occurring during SyslogHandler's emit(..) method are caught 
and handled since the try-except block only covers the latter part of the 
method.
Thus, since handleError is not invoked, such exceptions might cause the whole 
program to crash, even though logging.raiseExceptions is unset.

Execution example:

In [1]: import sys

In [2]: sys.version
Out[2]: '2.7.6 (default, Mar 22 2014, 22:59:56) \n[GCC 4.8.2]'

In [3]: import logging.handlers

In [4]: logging.raiseExceptions = 0

In [5]: syslogHandler = logging.handlers.SysLogHandler()

In [6]: logger = logging.getLogger()

In [7]: logger.addHandler(syslogHandler)

In [8]: logger.critical('1', '1')
---
TypeError Traceback (most recent call last)
 in ()
> 1 logger.critical('1', '1')

/usr/lib/python2.7/logging/__init__.pyc in critical(self, msg, *args, **kwargs)
   1195 """
   1196 if self.isEnabledFor(CRITICAL):
-> 1197 self._log(CRITICAL, msg, args, **kwargs)
   1198 
   1199 fatal = critical

/usr/lib/python2.7/logging/__init__.pyc in _log(self, level, msg, args, 
exc_info, extra)
   1269 exc_info = sys.exc_info()
   1270 record = self.makeRecord(self.name, level, fn, lno, msg, args, 
exc_info, func, extra)
-> 1271 self.handle(record)
   1272 
   1273 def handle(self, record):

/usr/lib/python2.7/logging/__init__.pyc in handle(self, record)
   1279 """
   1280 if (not self.disabled) and self.filter(record):
-> 1281 self.callHandlers(record)
   1282 
   1283 def addHandler(self, hdlr):

/usr/lib/python2.7/logging/__init__.pyc in callHandlers(self, record)
   1319 found = found + 1
   1320 if record.levelno >= hdlr.level:
-> 1321 hdlr.handle(record)
   1322 if not c.propagate:
   1323 c = None#break out

/usr/lib/python2.7/logging/__init__.pyc in handle(self, record)
747 self.acquire()
748 try:
--> 749 self.emit(record)
750 finally:
751 self.release()

/usr/lib/python2.7/logging/handlers.pyc in emit(self, record)
840 exception information is present, it is NOT sent to the server.
841 """
--> 842 msg = self.format(record) + '\000'
843 """
844 We need to convert record level to lowercase, maybe this will

/usr/lib/python2.7/logging/__init__.pyc in format(self, record)
722 else:
723 fmt = _defaultFormatter
--> 724 return fmt.format(record)
725 
726 def emit(self, record):

/usr/lib/python2.7/logging/__init__.pyc in format(self, record)
462 it is formatted using formatException() and appended to the 
message.
463 """
--> 464 record.message = record.getMessage()
465 if self.usesTime():
466 record.asctime = self.formatTime(record, self.datefmt)

/usr/lib/python2.7/logging/__init__.pyc in getMessage(self)
326 msg = self.msg  #Defer encoding till later
327 if self.args:
--> 328 msg = msg % self.args
329 return msg
330 

TypeError: not all arguments converted during string formatting

In [9]: 

Executing similar code via StreamHandler for example, doesn't raise the 
TypeError exception.

--
components: Library (Lib)
messages: 230364
nosy: Yoel, vinay.sajip
priority: normal
severity: normal
status: open
title: SyslogHandler's record formatting during emit(..) not covered by 
try-except block
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



[issue22776] SyslogHandler's record formatting during emit(..) not covered by try-except block

2014-10-31 Thread Yoel

Changes by Yoel :


--
type:  -> behavior

___
Python tracker 

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



[issue22775] SimpleCookie not picklable with HIGHEST_PROTOCOL

2014-10-31 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



[issue22758] Regression in Python 3.2 cookie parsing

2014-10-31 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



[issue22751] Fix test___all__ warning about modified environment

2014-10-31 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



[issue22701] Write unescaped unicode characters (Japanese, Chinese, etc) in JSON module when "ensure_ascii=False"

2014-10-31 Thread Ezio Melotti

Ezio Melotti added the comment:

The example works for me with both python 2 and 3.  I'm going to close this in 
a while if OP doesn't reply.

$ python2 -c "import json; json.dump({'name': '港区'}, open('py2.json', 'w'), 
indent=4, separators=(',', ': '), ensure_ascii=False)" && cat py2.json
{
"name": "港区"
}
$ python3 -c "import json; json.dump({'name': '港区'}, open('py3.json', 'w'), 
indent=4, separators=(',', ': '), ensure_ascii=False)" && cat py3.json
{
"name": "港区"
}

--
resolution:  -> works for me
status: open -> pending

___
Python tracker 

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

Naming it _READLINE_BUILDTIME_VERSION instead of _READLINE_VERSION would avoid 
ambiguity.

--
nosy: +Arfrever

___
Python tracker 

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



[issue19884] Importing readline produces erroneous output

2014-10-31 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



[issue22680] unittest discovery is fragile

2014-10-31 Thread Ezio Melotti

Ezio Melotti added the comment:

Does removing "from unittest import *" from somewhere fix the issue?
Is this a bug in your code, or did that import reveal a bug in unittest?

--

___
Python tracker 

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



[issue22680] unittest discovery is fragile

2014-10-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Does removing "from unittest import *" from somewhere fix the issue?

Yes.

> Is this a bug in your code, or did that import reveal a bug in unittest?

Your choice :-)

--

___
Python tracker 

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread David Edelsohn

David Edelsohn added the comment:

I am trying to follow the precedent of zlibmodule with the naming so that users 
of Python modules have as consistent an experience and user interface as 
possible.

--

___
Python tracker 

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



[issue22680] unittest discovery is fragile

2014-10-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

btw, in case that's not clear from the traceback, discover was mistaking 
FunctionTestCase as one of my test classes (while it was just there because of 
the "import *").

--

___
Python tracker 

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Indeed, I think there's no ambiguity here. Victor, are you ok with the patch?

--

___
Python tracker 

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



[issue22680] unittest discovery is fragile

2014-10-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Or perhaps everything that has as a __module__ something which has the 
attribute __unittest = True?

(the attribute is there for a reason, right?)

--

___
Python tracker 

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



[issue22680] unittest discovery is fragile

2014-10-31 Thread Michael Foord

Michael Foord added the comment:

Ah. Test discovery is discovering FunctionTestCase and attempting to 
instantiate it as a test. And failing.

Maybe discovery should special case that class and not treat it as a normal 
TestCase.

--

___
Python tracker 

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



[issue22680] unittest discovery is fragile

2014-10-31 Thread Ethan Furman

Ethan Furman added the comment:

Michael Foord opined:
-
> Maybe discovery should special case that class and not treat it as a normal 
> TestCase.

Not a bad idea.  On the other hand, I don't believe unittest is advertised as 
supporting 'from ... import *', which *is* usually advised to be a bad idea.

--

___
Python tracker 

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



[issue22680] unittest discovery is fragile

2014-10-31 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



[issue11957] re.sub confusion between count and flags args

2014-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think that the enum solution is worth pursuing, and that we need general 
class which represents the set of specified named flags. I'm working on 
implementation of enum.IntFlags.

--

___
Python tracker 

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



[issue22581] Other mentions of the buffer protocol

2014-10-31 Thread Ezio Melotti

Changes by Ezio Melotti :


--
type:  -> enhancement
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



[issue22678] An OSError subclass for "no space left on device" would be nice: NoSpaceError

2014-10-31 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



[issue22143] rlcompleter.Completer has duplicate matches

2014-10-31 Thread Lorenz Quack

Lorenz Quack added the comment:

I couldn't find anything concerning order in the docs so I didn't see any 
reason the have them sorted.
I'm not opposed to sorting them. I guess you could call me +0 on returning 
sorted(set(matches))

--

___
Python tracker 

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



[issue10712] 2to3 fixer for deprecated unittest method names

2014-10-31 Thread Ezio Melotti

Ezio Melotti added the comment:

Thanks!

--

___
Python tracker 

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



[issue22751] Fix test___all__ warning about modified environment

2014-10-31 Thread Zachary Ware

Zachary Ware added the comment:

It doesn't look like "import locale" can fail ("import _locale" can, but 
locale.py has emulation that would work with this patch).

LGTM.

--
stage: patch review -> commit review
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



[issue12458] Tracebacks should contain the first line of continuation lines

2014-10-31 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue21278] Running the test suite with -v makes the test_ctypes and the test_zipimport erroneously reported as failed

2014-10-31 Thread Ezio Melotti

Ezio Melotti added the comment:

> If no one is able to reproduce it, I guess we can close it.

OK

> you all receive updates even if the bug is closed, right? 

Yes.

--
resolution: works for me -> out of date
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



[issue16518] add "buffer protocol" to glossary

2014-10-31 Thread Ezio Melotti

Ezio Melotti added the comment:

See #22581.

--

___
Python tracker 

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



[issue13884] IDLE: Remove tear-off menu feature

2014-10-31 Thread Ezio Melotti

Ezio Melotti added the comment:

I haven't seen any other program using it, so I wouldn't mind if they were 
removed.  People with disabilities probably have better ways to deal with 
menus, but if adding the option is trivial it's probably better to add it.

--

___
Python tracker 

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



[issue22775] SimpleCookie not picklable with HIGHEST_PROTOCOL

2014-10-31 Thread Berker Peksag

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread Ned Deily

Ned Deily added the comment:

The patch doesn't take into account that the readline module may be linked with 
BSD libedit (as is the default on OS X and is preferred by some third-party 
distributors) rather than GNU readline.  The patch causes the test to be 
incorrectly skipped on those platforms.

>>> readline._READLINE_VERSION
1026

The documented way of differentiating the two cases is by checking the __doc__ 
string for "readline" or "libedit":

>>> readline.__doc__
'Importing this module enables command line editing using libedit readline.'

vs.

>>> readline.__doc__
'Importing this module enables command line editing using GNU readline.'

--
nosy: +ned.deily

___
Python tracker 

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread Ned Deily

Ned Deily added the comment:

Make that: The documented way of differentiating the two cases is by checking 
the __doc__ string for "libedit".

--

___
Python tracker 

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread STINNER Victor

STINNER Victor added the comment:

In the past, I added sys.thread_info to be able to skip tests on some old 
platforms. Maybe we need something similar: an object with runtime version, 
build version, implementation name, etc.

--

___
Python tracker 

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



[issue22747] Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined

2014-10-31 Thread Matt Frank

Matt Frank added the comment:

My platform is the Android command-line shell.  Essentially it is like an 
embedded linux platform with a very quirky partially implemented libc (not 
glibc).  It has no langinfo.h and while it has locale.h, the implementations of 
setlocale() and localeconv() do nothing (and return null).  The wcstombs() and 
mbstowcs() functions are both mapped to strncpy().

As was the original intent of utf-8, since the Linux kernel (and most supported 
file systems) store filenames as null-terminated byte strings, utf-8 encoded 
file names "work" with software that assumes that the encoding is utf-8 (for 
example the xterm program that I'm using to "ssh" into the machine) (for 
another example, the Dalvik JVM that runs user-apps.)

My intent with this tracker is to make it slightly easier for people who have 
libc like Android where the locale support is completely broken and really only 
8-bit "ascii" is supported to get something reasonable to compile and run, 
while simultaneously not breaking the supported platforms.

If you look at what Kivy and Py4A have done, they basically have patches all 
over the main interpreter that, once applied, make the interpreter not work on 
any supported platform.  I'm trying to avoid that approach.  Two possibilities 
for this particular part of the interpreter are to implement option (3) above, 
or to implement option (4) above.  Option (3) is preferable in the long run, 
but option(4) is a much smaller change (as long as it does consistently with 
the decision of tracker 8610.)

--

___
Python tracker 

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread David Edelsohn

David Edelsohn added the comment:

@ned.deily Can you offer a suggestion of how you you like the skipIf test 
modified to check __doc__ for "libedit"?

--

___
Python tracker 

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread Ned Deily

Ned Deily added the comment:

Something like:

@unittest.skipIf(("libedit" not in readline.__doc__)
 and (readline._READLINE_VERSION < 0x6000),
 "not supported in this library version")

should work.

--

___
Python tracker 

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread David Edelsohn

David Edelsohn added the comment:

Okay, grouping was wrong in my initial attempt.  New patch attached.

--
Added file: http://bugs.python.org/file37090/Issue22773.txt

___
Python tracker 

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



[issue22766] collections.Counter's in-place operators should return NotImplemented for unsupported types

2014-10-31 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Here is what other mutable types do:

>>> s = []
>>> s.__iadd__(1)
Traceback (most recent call last):
  File "", line 1, in 
s.__iadd__(1)
TypeError: 'int' object is not iterable

>>> s = set()
>>> s.__ior__(1)
NotImplemented

>>> from collections import deque
>>> s = deque()
>>> s.__iadd__(1)
Traceback (most recent call last):
  File "", line 1, in 
s.__iadd__(1)
TypeError: 'int' object is not iterable

>>> from array import array
>>> s = array('i')
>>> s.__iadd__(1)
Traceback (most recent call last):
  File "", line 1, in 
s.__iadd__(1)
TypeError: can only extend array with array (not "int")

>>> s = bytearray()
>>> s.__iadd__(1)
Traceback (most recent call last):
  File "", line 1, in 
s.__iadd__(1)
TypeError: can't concat int to bytearray

--
priority: normal -> low

___
Python tracker 

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



[issue22683] bisect index out of bounds issue

2014-10-31 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> treat the hi in the precondition in the same way as the lo parameter

Originally, there was no special test for lo.  The test was added only because 
negative lo value failed in an unfortunate way (with an infinite loop).  No 
change to hi was made because (it succeeded in some cases and existing code 
might be relying on that or it failed in clear-cut way by raising an 
IndexError).

> That being said, from my point of view this ticket can be closed.

I concur.  When there isn't a clear case for change, it is usually better to 
favor stability over potential disruption.

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

___
Python tracker 

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



[issue22747] Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined

2014-10-31 Thread Stefan Krah

Stefan Krah added the comment:

Has anyone made an effort to get this fixed in Android?  I find it strange that 
hundreds of projects now work around Android bugs instead of putting (friendly) 
pressure on the Android maintainers.

Minimal langinfo.h and locale.h support should be trivial to implement.

--
nosy: +skrah

___
Python tracker 

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread Ned Deily

Ned Deily added the comment:

The test works OK with libedit now, thanks.  But are you sure about the 
readline version test?  Testing with a GNU readline 6.3:

>>> print('%x' % readline._READLINE_RUNTIME_VERSION)
603

so the test_readline check:

   readline._READLINE_VERSION < 0x6000

causes the test to be incorrectly skipped.  What does _READLINE_RUNTIME_VERSION 
look like for an older version of readline?

--

___
Python tracker 

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



[issue22747] Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined

2014-10-31 Thread Matt Frank

Matt Frank added the comment:

I am working on using my resources at Intel to put some pressure on Google to 
fix some of the (many) problems in the Bionic libc.

I have a sort of "polyfill" library that implements locale.h, langinfo.h, as 
well as the structure definitions for wchar.h, and it borrows the utf8 
mbs*towcs() and wcs*tombs() implementations from FreeBSD.  It implements a 
setlocale() and nl_langinfo() that starts in locale "C", fakes it as though the 
user's envvars are set to "C.UTF-8" (so if you call setlocale(LC_ALL, "") the 
encoding is changed to UTF-8).

But Bionic has been broken for many years, and it will most likely take many 
more years before I (or somebody) can arrange the right set of things to get it 
fixed.  It is not really in Google's interest to have people writing non-JVM 
code, so they seem to only grudgingly support it, their JVM APIs are the 
"walled garden" that keeps apps sticky to their platform, while allowing them 
to quickly switch to new processor architectures if they need to.

But all of that is not really germane to this bug.  The fact is that cpython, 
when compiled for a system with no langinfo.h creates an executable that does 
nothing but crash.

What other systems (other than Android) have no langinfo.h?  (Alternatively, 
why has this feature-test been in configure.ac for many years?)  If the 
solution for Android is "it's android's bug and they should fix it" then 
shouldn't we remove all the #ifdef HAVE_LANGINFO_H tests from the code and just 
let compilation fail on systems that don't have langinfo.h?  That is option (1) 
or (2) that I suggested above.

--

___
Python tracker 

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



[issue22747] Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined

2014-10-31 Thread Stefan Krah

Stefan Krah added the comment:

To expand a little, here ...

   https://code.google.com/p/android/issues/list

... I cannot find either a localeconv() or an nl_langinfo() issue.


Perhaps the maintainers would be willing to add minimal versions?

--

___
Python tracker 

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



[issue22777] Test pickling with all protocols

2014-10-31 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Some pickling tests use only default protocol. Other tests use only lower 
protocols (0, 1, and may be 2). Proposed match makes all pickling tests using 
all existing protocols from 0 to HIGHEST_PROTOCOL inclusive. Also fixed some 
minor bugs.

--
components: Tests
files: tests_pickling.patch
keywords: patch
messages: 230395
nosy: pitrou, rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Test pickling with all protocols
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file37091/tests_pickling.patch

___
Python tracker 

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



[issue22778] list's in-place add doesn't return NotImplemented when appropriate

2014-10-31 Thread Ethan Furman

New submission from Ethan Furman:

--> s = []
--> s += 1
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'int' object is not iterable

For comparison, when NotImplemented is appropriately returned the message looks 
like this:

--> s -= 1
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported operand type(s) for -=: 'list' and 'int'

Which is certainly more helpful than " object is not iterable"

--
messages: 230396
nosy: ethan.furman
priority: normal
severity: normal
status: open
title: list's in-place add doesn't return NotImplemented when appropriate
type: behavior
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



[issue22779] deque in-place addition does not return NotImplemented when appropriate

2014-10-31 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Please don't replicate the same variant of the issue multiple times.

--

___
Python tracker 

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



[issue22766] collections.Counter's in-place operators should return NotImplemented for unsupported types

2014-10-31 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Note, the += operation is conceptually similar to update() methods with are 
usually duck typeable:

>>> d = {}
>>> d.update(1)
Traceback (most recent call last):
  File "", line 1, in 
d.update(1)
TypeError: 'int' object is not iterable

>>> s = set()
>>> s.update(1)
Traceback (most recent call last):
  File "", line 1, in 
s.update(1)
TypeError: 'int' object is not iterable

>>> dict(1)
Traceback (most recent call last):
  File "", line 1, in 
dict(1)
TypeError: 'int' object is not iterable

--

___
Python tracker 

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



[issue22766] collections.Counter's in-place operators should return NotImplemented for unsupported types

2014-10-31 Thread Ethan Furman

Ethan Furman added the comment:

The behavior exhibited by set() is correct, and the behavior for array and 
bytearray are fine, as the error message is even more helpful.

Issues opened for list (issue22778) and deque (issue22779).

--

___
Python tracker 

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



[issue22779] deque in-place addition does not return NotImplemented when appropriate

2014-10-31 Thread Ethan Furman

New submission from Ethan Furman:

--> from collections import deque
--> d = deque()
--> d += 1
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'int' object is not iterable

deque should be returning NotImplemented, which would generate a more 
appropriate error message:

TypeError: unsupported operand type(s) for -=: 'collections.deque' and 'int'

which is what happens with -=, *=, /=, |=, at which point I stopped testing.

--
assignee: rhettinger
messages: 230397
nosy: ethan.furman, rhettinger
priority: low
severity: normal
stage: needs patch
status: open
title: deque in-place addition does not return NotImplemented when appropriate
type: behavior
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



[issue22778] list's in-place add doesn't return NotImplemented when appropriate

2014-10-31 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Please don't replicate existing issues.

Also, this behavior for lists is long-standing, tested, and designed by Guido.  
More than a little code relies on this behavior.

--
assignee:  -> rhettinger
nosy: +rhettinger
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



[issue22766] collections.Counter's in-place operators should return NotImplemented for unsupported types

2014-10-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I think I've changed my mind on this. The important distinction is not between 
"ducktyping" or "cooperating". It's that this is an in-place mutating 
operation. A mutating operation should always be the responsibility of the 
receiver, and so it sounds wrong to be able to delegate it to the read-only 
operand.

For example, when calling list.extend(op), the list object doesn't allow `op` 
to take over the operation's semantics. So I think TypeError is the right 
outcome here.

--

___
Python tracker 

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



[issue22779] deque in-place addition does not return NotImplemented when appropriate

2014-10-31 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This behavior was intended.  It was modeled after the behavior for lists.

Any change here would break code such as:

   d = deque()
   d += 'abc' # This is specially allowed (note, we have a test for it)

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



[issue22773] Export Readline version and expect ANSI sequence for version < 0x6000

2014-10-31 Thread David Edelsohn

David Edelsohn added the comment:

The test should be 0x0600.

--
Added file: http://bugs.python.org/file37092/Issue22773.txt

___
Python tracker 

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



[issue22766] collections.Counter's in-place operators should return NotImplemented for unsupported types

2014-10-31 Thread Ethan Furman

Ethan Furman added the comment:

https://docs.python.org/2/reference/datamodel.html#object.__iadd__
--
[...] These methods should attempt to do the operation in-place (modifying 
self) and return the result (which could be, but does not have to be, self). If 
a specific method is not defined, the augmented assignment falls back to the 
normal methods. For instance, to execute the statement x += y, where x is an 
instance of a class that has an __iadd__() method, x.__iadd__(y) is called. If 
x is an instance of a class that does not define a __iadd__() method, 
x.__add__(y) and y.__radd__(x) are considered, as with the evaluation of x + y.

---

Returning NotImplemented still allows a TypeError to be raised, is subclass 
friendly, and is the way Python is designed.

--

___
Python tracker 

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



[issue22766] collections.Counter's in-place operators should return NotImplemented for unsupported types

2014-10-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

You misread that paragraph:

""" For instance, to execute the statement x += y, where x is an instance of a 
class that has an __iadd__() method, x.__iadd__(y) is called."""

This is the present case, and the case of most mutable containers.

"""If x is an instance of a class that does not define a __iadd__() method, 
x.__add__(y) and y.__radd__(x) are considered, as with the evaluation of x + 
y."""

This is not the present case.

--

___
Python tracker 

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



[issue22747] Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined

2014-10-31 Thread STINNER Victor

STINNER Victor added the comment:

If the platform doesn't provide anything, we can maybe adopt the same
approach than Mac OS X: force the encoding to UTF-8 and just don't use
the C library.

--

___
Python tracker 

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



[issue22778] list's in-place add doesn't return NotImplemented when appropriate

2014-10-31 Thread Ethan Furman

Ethan Furman added the comment:

My understanding was that if a different patch will be needed, it is not the 
same issue.  Is that not correct?

Here's the test:

def test_iadd(self):
...
self.assertRaises(TypeError, u.__iadd__, None)

It would still pass, as returning NotImplemented will still result in a 
TypeError, just with a friendlier message.

If any code is depending on this, it is depending on the error message text, 
which is explicitly not guaranteed

--

___
Python tracker 

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



  1   2   >