STINNER Victor | 3 Sep 17:47 2015

[issue1103213] Adding the missing socket.recvall() method


STINNER Victor added the comment:

recvall.patch: implement socket.socket.recvall() in pure Python.

It raises a new socket.IncompleteReadError (copied from asyncio) exception if the connection is closed
before we got the expected number of bytes.

The patch has unit tests, document the new method and the new exception.

TODO: I don't like how the method handles timeout. The method must fail if it takes longer than
socket.gettimeout() seconds, whereas currently the timeout is reset each time we got data from the server.

If the idea of the new socket method is accepted, I will reimplement it in C. In C, it's more easy to implement
the timeout as I want.

In Python, the socket timeout cannot be changed temporary, because it would impact other threads which may
use the same socket.

I changed how socket.sendall() handle timeout in Python 3.5, it is now the maximum total duration to send
all data. The timeout is no more reset each time we send a packet. Related discussion:
https://mail.python.org/pipermail/python-dev/2015-April/139001.html

See also the issue #23236 which adds a timeout reset each time we get data to the asyncio read() method. It
will be complementary to the existing "wait(read(), timeout)" timeout method, it's for a different use case.

----------
Added file: http://bugs.python.org/file40344/recvall.patch

_______________________________________
(Continue reading)

Cameron Walker | 3 Sep 17:11 2015

[issue24994] Python 3.4.2 64-bit Installer error (Please insert the disk:)


New submission from Cameron Walker:

I had attempted to uninstall python 3.4.2 from the start menu in Windows 7, but it was still visible in my
Programs and features. I tried to uninstall it from there but it said it was missing some files. So I
re-downloaded the installer, but when it tried to install, the following error came up.

Please insert the disk:
with an Ok and Cancel prompt.
When I click on Ok it causes the same error to reappear, but clicking cancel causes it to abort.

Please help.

----------
components: Windows
messages: 249654
nosy: Cameron Walker, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python 3.4.2 64-bit Installer error (Please insert the disk:)
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue24994>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
(Continue reading)

STINNER Victor | 3 Sep 16:40 2015

[issue24993] The C function PyCodec_NameReplaceErrors doesn't handle PyCapsule_Import() failure


STINNER Victor added the comment:

Thanks for your review and your cool error handler.

----------

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue24993>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-python-bugs-list%40m.gmane.org

STINNER Victor | 3 Sep 12:49 2015

[issue24993] The C function PyCodec_NameReplaceErrors doesn't handle PyCapsule_Import() failure


New submission from STINNER Victor:

The namereplace error handler introduced in Python 3.5 doesn't handle correctly PyCapsule_Import()
failure. If the function raises an exception, the PyCodec_NameReplaceErrors() function must return NULL.

I see that the code correctly handle the case where PyCodec_NameReplaceErrors() failed, but it doesn't
clear the exception.

Attached patch changes PyCodec_NameReplaceErrors() to return immediatly NULL if
PyCodec_NameReplaceErrors() failed.

Or should we log the exception (PyErr_WriteUnraisable) and then clear it? PyErr_WriteUnraisable is
usually used in corner case when it's impossible to report bugs to the function caller.

----------
files: namereplace_errors.patch
keywords: patch
messages: 249628
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: The C function PyCodec_NameReplaceErrors doesn't handle PyCapsule_Import() failure
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40336/namereplace_errors.patch

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

STINNER Victor | 3 Sep 11:53 2015

[issue24992] collections.OrderedDict constructor (odict_new) doesn't handle PyDict_New() failure


New submission from STINNER Victor:

If PyDict_New() fails (ex: memory allocation failure), odict_new() returns a new OrderedDict with an
exception set. It's a bug. Attached patch fixes it.

odict_new() constructor also returns NULL without destroying the newly created object if
_odict_initialize() fails. My patch also fixes this.

My patch inlines _odict_initialize() into odict_new() and avoids useless initialization to 0.

----------
files: odict.patch
keywords: patch
messages: 249625
nosy: eric.snow, haypo
priority: normal
severity: normal
status: open
title: collections.OrderedDict constructor (odict_new) doesn't handle PyDict_New() failure
versions: Python 3.6
Added file: http://bugs.python.org/file40334/odict.patch

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue24992>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-python-bugs-list%40m.gmane.org
(Continue reading)

Nick Coghlan | 3 Sep 08:08 2015

[issue24991] Define instance mutability explicitly on type objects


New submission from Nick Coghlan:

Issue #24912 showed that the interpreter has historically assumed that all instances of non-heap types
are immutable when it comes to preventing __class__ reassignment, and changing this assumption caused
problems with genuinely immutable types that use implicit instance caching (like string interning and
the small integrer cache).

More generally, whether or not type instances are mutable or not has been defined somewhat informally -
decimal.Decimal instances, for example, are nominally immutable, but this immutability is only by
convention, rather than enforced by the interpreter.

It may be desirable to be able to explicitly declare instances of a type as mutable or immutable (both from
Python and from C), rather than having that property be inferred from other characteristics in a
situational way.

----------
messages: 249605
nosy: ncoghlan, njs
priority: normal
severity: normal
status: open
title: Define instance mutability explicitly on type objects
versions: Python 3.6

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

Al Sweigart | 3 Sep 01:55 2015

[issue24990] Foreign language support in turtle module


New submission from Al Sweigart:

I'd like to propose adding foreign language names for the names in the turtle module. This would
effectively take this code:

    import turtle
    t = turtle.Pen()
    t.pencolor('green')
    t.forward(100)

...and have this code in French be completely equivalent:

    import turtle
    t = turtle.Plume()
    t.couleurplume('vert')
    t.avant(100)

(Pardon my google-translate French.)

This would be built into the turtle module (the "turtle" name itself would be unchanged). They would be
available no matter what the OS's localization settings were set to.

This, of course, is terrible way for a software module to implement internationalization, which usually
does not apply to the source code names itself. But I'd like to explain why the turtle module is different.

The turtle module is not used for professional software development, but instead as a teaching tool for
children. While professional developers are expected to obtain proficiency with English, the same does
not apply to school kids who are just taking a small computer programming unit. Having the turtle module
available in their native language would remove a large barrier and let them focus on the core programming
(Continue reading)

John Leitch | 3 Sep 01:40 2015

[issue24989] scan_eol() Buffer Over-read


New submission from John Leitch:

Python 3.5 suffers from a vulnerability caused by the behavior of the scan_eol() function. When called,
the function gets a line from the buffer of a BytesIO object by searching for a newline character starting
at the position in the buffer.

However, if the position is set to a value that is larger than the buffer, this logic will result in a call to
memchr that reads off the end of the buffer:

    /* Move to the end of the line, up to the end of the string, s. */
    start = PyBytes_AS_STRING(self->buf) + self->pos;
    maxlen = self->string_size - self->pos;
    if (len < 0 || len > maxlen)
        len = maxlen;

    if (len) {
        n = memchr(start, '\n', len);

In some applications, it may be possible to exploit this behavior to disclose the contents of adjacent
memory. The buffer over-read can be observed by running the following script:

import tempfile
a = tempfile.SpooledTemporaryFile()
a.seek(0b1)
a.readlines()

Which, depending on the arrangement of memory, may produce an exception such as this:

0:000> g
(Continue reading)

Mark Roseman | 3 Sep 01:10 2015

[issue24988] IDLE: debugger context menus not working on Mac


New submission from Mark Roseman:

Right menu button to invoke context menu (as well as alternative control-click) not set up correctly for
Mac in the debugger. Patch attached.

----------
components: IDLE
files: debug-mac-context-menu.patch
keywords: patch
messages: 249582
nosy: kbk, markroseman, roger.serwy, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: debugger context menus not working on Mac
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40325/debug-mac-context-menu.patch

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue24988>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-python-bugs-list%40m.gmane.org

asduj | 2 Sep 23:57 2015

[issue24987] subprocess.Popen with shell=True doesn't create socket


New submission from asduj:

I want to run the next command

subprocess.Popen("soffice --accept='socket,host=localhost,port=8100;urp;'", shell=True)

to make soffice listen localhost:8100. It is work in python 2.7.9, but doesn't in python 3.4.3. I control it by

netstat -a | grep 8100

----------
components: Library (Lib)
messages: 249576
nosy: asduj
priority: normal
severity: normal
status: open
title: subprocess.Popen with shell=True doesn't create socket
versions: Python 3.4

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue24987>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-python-bugs-list%40m.gmane.org

(Continue reading)

Zachary Ware | 2 Sep 22:30 2015

[issue24986] It should be possible to build successfully without external libraries


New submission from Zachary Ware:

We do have the option of leaving out all extension modules ("/p:IncludeExtensions=false"), but it would
be nice to be able to build everything that doesn't require external libs.

This also be adds an option to skip only Tkinter (analogous to "/p:IncludeSSL=false"), as that's what I
actually need at the moment :).  I'm not adding options for every external project individually, as most of
them are not a big deal, but OpenSSL, Tcl/Tk/Tix, and (on 2.7) bsddb take a long time to compile and might be
nice to leave out when they're not needed (so I also added the ability to leave out bsddb on 2.7).

Leaving out 3.4 as its project files are not amenable to this kind of change, and 3.4's days are numbered anyway.

----------
assignee: zach.ware
components: Build, Windows
files: 2.7_external_build_handling.diff
keywords: patch
messages: 249567
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: patch review
status: open
title: It should be possible to build successfully without external libraries
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40322/2.7_external_build_handling.diff

_______________________________________
(Continue reading)


Gmane