Tim Graham | 31 Oct 17:58 2014

[issue22775] SimpleCookie not picklable with HIGHEST_PROTOCOL


New submission from Tim Graham:

Expected:

>>> import pickle
>>> from http.cookies import SimpleCookie
>>> pickle.loads(pickle.dumps(SimpleCookie('hi=there'),2))
<SimpleCookie: hi='there'>
# Actual
<SimpleCookie: hi='Set-Cookie: hi=there'>

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

_______________________________________
(Continue reading)

Szieberth Ádám | 31 Oct 15:25 2014

[issue22774] Weird S.rstrip() result


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 <report <at> bugs.python.org>
<http://bugs.python.org/issue22774>
(Continue reading)

David Edelsohn | 31 Oct 15:01 2014

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


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 <report <at> bugs.python.org>
<http://bugs.python.org/issue22773>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-python-bugs-list%40m.gmane.org

Lorenz Quack | 31 Oct 13:02 2014

[issue22772] doc error in __ifloordiv__ and __itruediv__


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 <at> python
components: Documentation
files: inplace_div_doc.patch
keywords: patch
messages: 230337
nosy: docs <at> 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 <report <at> bugs.python.org>
<http://bugs.python.org/issue22772>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-python-bugs-list%40m.gmane.org
(Continue reading)

Georg Brandl | 31 Oct 09:54 2014

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


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 <report <at> bugs.python.org>
<http://bugs.python.org/issue22771>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-python-bugs-list%40m.gmane.org

Ned Deily | 31 Oct 00:05 2014

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


New submission from Ned Deily:

The changes to tkinter tests introduced by the changes for Issue22236 (2.7 32fdaf401e50, 3.4
dd1dffe6f0d2, and default/3.5 014060738f7f) may cause Python to crash due to a Tk segfault on OS X.  The
crash only shows up when using the -j option to regrtest and is dependent on other factors, e.g. 64-bit vs
32-bit and randomized address space allocations, so it is not 100% reproducible.  But it happens often
enough (to me) when running the Python test suite from an installed framework location with a current
Cocoa Tk 8.5.x or 8.6.x, for example, with an instance from a python.org binary installer:

    /usr/local/bin/python3.4 -m test -w -uall -j3

The reasons for the segfault are due to an arcane bug in Tk which shows up when Tcl interpreter instances are
destroyed and created within the execution of an OS X app bundle, behavior which now happens as a result of
the above changes when -j > 0 is used in an OS X framework build.  There is a more detailed analysis in the Tk bug
I've opened:

    https://core.tcl.tk/tk/tktview?name=c18c36f80c

The bug is not one that most Tk users would run into, I think, so it's certainly not a critical bug in Tk.  But it
is annoying to run into when running Python tests.  On the other hand, I'm not sure that it is worth trying to
work around the problem in the tests; I think the basic idea of the Issue22236 changes is sound.

There is a relatively easy workaround if one runs into the problem: exclude the two problematic Tk tests and
run them separately sequentially.

    pythonx.y -m test -w -uall -j3 -x test_tk test_ttk_guionly
    pythonx.y -m test -w -uall        test_tk test_ttk_guionly

(-m test.regrtest for Python 2.7.x)
(Continue reading)

David Durrett | 30 Oct 23:58 2014

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


New submission from David Durrett:

Have only tried this on Python 2.7

To reproduce:

~~~~~
from Tkinter import *
import ttk

root = Tk()
tree = ttk.Treeview(root)

id = tree.insert('' , 'end', text='foo', tag='bar')
print tree.tag_has('bar', item=id)
# ^ this works..
print tree.tag_has('baz', item=id)
# ^ .. and this..
print tree.tag_has('bar')
# ^ .. this doesn't.
~~~~~
...
    self.tk.call(self._w, "tag", "has", tagname, item))
TypeError: must be string, not tuple

Possibly introduced by Issue20072.

Removing the self.tk.getboolean() wrapper in tag_has() appears to fix things.

(Continue reading)

Mathieu Pasquet | 30 Oct 19:18 2014

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


New submission from Mathieu Pasquet:

Currently, the only workaround is to use transport._sock.getpeercert(True) on the Transport returned
by loop.create_connection(), which is not something to be encouraged. It is useful to get such
information, for example to perform a manual certificate check against a previously recorded
certificate or hash.

I attached a trivial patch adding an extra 'peercert_bin' info, but I do not know if this is the right
approach, as other issues of feature disparity might arise when more people try to switch to asyncio.
Exposing a proxy SSLSocket object for read-only functions might be more beneficial.

----------
components: asyncio
files: peercert_bin.patch
keywords: patch
messages: 230281
nosy: gvanrossum, haypo, mathieui, yselivanov
priority: normal
severity: normal
status: open
title: Add a way to get the peer certificate of a SSL Transport
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file37076/peercert_bin.patch

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue22768>
_______________________________________
(Continue reading)

Tom Christie | 30 Oct 17:35 2014

[issue22767] `separators` argument to json.dumps() behaves unexpectedly across 2.x vs 3.x


New submission from Tom Christie:

This is one of those behavioural issues that is a borderline bug.

The seperators argument to `json.dumps()` behaves differently across python 2 and 3.

* In python 2 it should be provided as a bytestring, and can cause a UnicodeDecodeError otherwise.
* In python 3 it should be provided as unicode,and can cause a TypeError otherwise.

Examples:

    Python 2.7.2
    >>> print json.dumps({'snowman': '☃'}, separators=(':', ','), ensure_ascii=False)
    {"snowman","☃"}
    >>> print json.dumps({'snowman': '☃'}, separators=(u':', u','), ensure_ascii=False)
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1: ordinal not in range(128)

And:

    Python 3.4.0
    >>> print(json.dumps({'snowman': '☃'}, separators=(':', ','), ensure_ascii=False))
    {"snowman","☃"}
    >>> print(json.dumps({'snowman': '☃'}, separators=(b':', b','), ensure_ascii=False))
    <...>
    TypeError: sequence item 2: expected str instance, bytes found

Technically this isn't out of line with the documentation - in both cases it uses `separators=(':', ',')`
which is indeed the correct type in both v2 and v3. However it's unexpected behaviour that it changes types
between versions, without being called out.
(Continue reading)

Joshua Chin | 30 Oct 16:06 2014

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


New submission from Joshua Chin:

Currently, in-place operations on 'collections.Counter' with unsupported types raises an 'AttributeError'.

Example:
>>> import collections
>>> counter = collections.Counter()
>>> counter += 1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File
"/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/collections/__init__.py",
line 709, in __iadd__
    for elem, count in other.items():
AttributeError: 'int' object has no attribute 'items'

Instead, it should return 'NotImplemented' if 'other' is not a 'collections.Counter'

----------
components: Library (Lib)
files: counter.patch
keywords: patch
messages: 230271
nosy: Joshua.Chin
priority: normal
severity: normal
status: open
title: collections.Counter's in-place operators should return NotImplemented for unsupported types
type: behavior
(Continue reading)

Bohuslav "Slavek" Kabrda | 30 Oct 12:51 2014

[issue22765] Fixes for test_gdb (first frame address, entry values)


New submission from Bohuslav "Slavek" Kabrda:

The attached patch fixes two test_gdb problems that can occur under some circumstances:

- With new GDB (I think version >= 7.4.0, but I'm not sure about the precise version), GDB sometimes prints
"entry-values" for variables, which can lead to failures like: "AssertionError: 'v <at> entry=()' !=
'()'". The cure for that is using "set print entry-values no" in GDB. I think this is also the root cause of
issue 17126.

- While building on ppc64 little endian for Fedora, we experienced GDB printing program counter for the
first frame, which breaks regular expressions matching in tests, e.g. instead of

#0 in PyObject_Print

the lines can look like

#0 0x00003fffb7dd1798 in PyObject_Print

I've talked to Fedora's GDB maintainer and I've been told that this can happen and it's not a GDB bug - GDB does
not guarantee this. Therefore the second part of the attached patch turns printing program counters for
*all* frames using "set print address off" to achieve same GDB output everywhere.

----------
components: Tests
files: test_gdb-ppc64le-and-entry-values-fix.patch
keywords: patch
messages: 230265
nosy: bkabrda
priority: normal
(Continue reading)


Gmane