Antoine Pitrou | 30 Aug 00:24 2014

[issue22303] Write better test for SSLContext.load_verify_locations


New submission from Antoine Pitrou:

SSLContext.load_verify_locations() probably takes into account the SSL_CERT_FILE and SSL_CERT_DIR
environment variables, when set. This should allow us to write a better test than the existing, minimal one.

----------
components: Tests
messages: 226092
nosy: alex, christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou
priority: normal
severity: normal
status: open
title: Write better test for SSLContext.load_verify_locations
type: enhancement
versions: Python 3.5

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

Akima | 29 Aug 23:58 2014

[issue22302] Windows os.path.isabs UNC path bug


New submission from Akima:

A UNC path pointing to the root of a share is not being recognised as an absolute path when it should be.

See this interpreter session.

PythonWin 3.3.5 (v3.3.5:62cf4e77f785, Mar  9 2014, 10:35:05) [MSC v.1600 64 bit (AMD64)] on win32.
Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information.
>>> import os.path
>>> os.path.isabs(r"\\server")
True
>>> os.path.isabs(r"\\server\share")
False
>>> os.path.isabs(r"\\server\share\folder")
True
>>> os.path.isabs(r"\\server\share\folder\folder")
True
>>>

----------
components: Library (Lib), Windows
messages: 226091
nosy: akima
priority: normal
severity: normal
status: open
title: Windows os.path.isabs UNC path bug
versions: Python 3.3

(Continue reading)

Terry J. Reedy | 29 Aug 23:20 2014

[issue1481032] patch smtplib:when SMTPDataError, rset crashes with sslerror


Terry J. Reedy added the comment:

David, do you agree with either of the proposed changes?

----------
nosy: +terry.reedy
versions: +Python 3.4, Python 3.5 -Python 2.6, Python 3.1, Python 3.2

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

Michele Orrù | 29 Aug 22:33 2014

[issue22301] smtplib.SMTP.starttls' documentation is just confusing


New submission from Michele Orrù:

<maker> hello! In <https://docs.python.org/2/library/smtplib.html#smtplib.SMTP.starttls> I read::
<maker> "If keyfile and certfile are provided, these are passed to the socket module’s ssl() function."
<maker> socket.ssl() exists, though it is not documented (not even in /dev/library/socket)
<maker> and furthermore, the link on ssl() points to the ssl module, which is just confusing.
<bitdancer> maker: open an issue.

(I'm noising ap and chris because afaik they were working on the latest ssl security stuff)

----------
assignee: docs <at> python
components: Documentation, Library (Lib), email
messages: 226074
nosy: barry, christian.heimes, docs <at> python, maker, pitrou, r.david.murray
priority: normal
severity: normal
status: open
title: smtplib.SMTP.starttls' documentation is just confusing
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue22301>
_______________________________________
_______________________________________________
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 | 29 Aug 16:08 2014

[issue22300] PEP 446 What's New Updates for 2.7.9


New submission from Nick Coghlan:

The Python 2.7 What's New now has a section recording the feature updates in maintenance releases.

Because of the live docs updates, these need to be added on the day of the release, rather than being able to be
done in advance.

----------
assignee: benjamin.peterson
files: pep466_whats_new_py279.diff
keywords: patch
messages: 226063
nosy: benjamin.peterson, ncoghlan
priority: release blocker
severity: normal
stage: commit review
status: open
title: PEP 446 What's New Updates for 2.7.9
type: enhancement
versions: Python 2.7
Added file: http://bugs.python.org/file36503/pep466_whats_new_py279.diff

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

Kevin Norris | 29 Aug 15:17 2014

[issue22299] resolve() on Windows makes some pathological paths unusable


New submission from Kevin Norris:

Run Python as an administrator:

    >>> import pathlib 
    >>> pth = pathlib.Path('//?/C:/foo.')
    >>> pth.mkdir()
    >>> pth.resolve().rmdir()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "C:\Python34\lib\pathlib.py", line 1141, in rmdir
        self._accessor.rmdir(self)
      File "C:\Python34\lib\pathlib.py", line 323, in wrapped
        return strfunc(str(pathobj), *args)
    FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\foo.'
    >>> pth.rmdir()

You do not need to be an administrator so long as you can create a directory in the requested location, but the
\\?\ prefix only works with absolute paths so it's easier to demonstrate in the root of the drive.

----------
components: Library (Lib), Windows
messages: 226060
nosy: Kevin.Norris
priority: normal
severity: normal
status: open
title: resolve() on Windows makes some pathological paths unusable
type: behavior
(Continue reading)

Julius Lehmann-Richter | 29 Aug 14:29 2014

[issue22298] Lib/warnings.py _show_warning does not protect against being called with a file like object which is closed


New submission from Julius Lehmann-Richter:

In Lib/warnings.py the _show_warning function catches IOError with the commented intention to ward
against an "invalid file":

def _show_warning(message, category, filename, lineno, file=None, line=None):
    """Hook to write a warning to a file; replace if you like."""
    if file is None:
        file = sys.stderr
    try:
        file.write(formatwarning(message, category, filename, lineno, line))
    except IOError:
        pass # the file (probably stderr) is invalid - this warning gets lost.

If for some reason the file like object, and in the default case stderr, is closed, a calling program is faced
with a ValueError, which is not being caught.

It seems to me, and correct me if I am wrong, that a file object which has been closed is a case of an "invalid
file" and that the warning subsystem should in that case behave in the same manner as in the case of the IOError.

This behavior is the same for python 3.2 with the function renamed to showwarning and can be reproduced with
for example

from sys import stderr                      
from warnings import warn

stderr.close()
try:
    warn("foo")
(Continue reading)

Edward O | 29 Aug 13:00 2014

[issue22297] json encoding broken for


New submission from Edward O:

_make_iterencode in python2.7/json/encoder.py encodes custom enum types incorrectly (the label will
be printed without '"') because of these lines (line 320 in 2.7.6):
    elif isinstance(value, (int, long)):
        yield buf + str(value)

in constract, _make_iterencode in python 3 explicitly supports the enum types:

    elif isinstance(value, int):
        # Subclasses of int/float may override __str__, but we still
        # want to encode them as integers/floats in JSON. One example
        # within the standard library is IntEnum.
        yield buf + str(int(value))

----------
components: Library (Lib)
messages: 226057
nosy: eddygeek
priority: normal
severity: normal
status: open
title: json encoding broken for
type: behavior
versions: Python 2.7

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

Rebecka | 29 Aug 12:00 2014

[issue22296] cookielib uses time.time(), making incorrect checks of expiration times in cookies


New submission from Rebecka:

The cookielib module uses time.time(), which produces a timestamp in the local timezone (as read from the
system time?), as the timestamp against which expiration dates in cookies are compared.

However, typical usage of HTTP cookies would be specifying the expiration date in UTC. This assumption
seems to be supported for example by the inclusion of cookielib.http2time, which (only) supports UTC timestamps.

This behaviour is also included in e.g. MozillaCookieJar, which (erroneously) excludes cookies from
being saved/loaded based on the local timestamp from time.time().

See the attached file for a small example where the check if a cookie is expired against a UTC time is correct
but the check against local time fails (simulating the behaviour of the cookielib module).

----------
components: Library (Lib)
files: cookie_timestamp_test.py
messages: 226056
nosy: regu0004
priority: normal
severity: normal
status: open
title: cookielib uses time.time(), making incorrect checks of expiration times in cookies
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file36502/cookie_timestamp_test.py

_______________________________________
Python tracker <report <at> bugs.python.org>
(Continue reading)

Nick Coghlan | 28 Aug 22:49 2014

[issue22295] Clarify available commands for package installation


New submission from Nick Coghlan:

https://docs.python.org/3/installing/index.html is too subtle in pointing out the command in a source
build or system Python on POSIX is "pip3" or "pip3.4" rather than the unadorned "pip".

At least one example should show pip3, and it's likely worth having an explanation in the last section on
building from source.

----------
assignee: ncoghlan
components: Devguide, Documentation
messages: 226042
nosy: ezio.melotti, ncoghlan
priority: normal
severity: normal
status: open
title: Clarify available commands for package installation
type: enhancement

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

Edward O | 28 Aug 13:43 2014

[issue22294] 2to3 consuming_calls: len, min, max, zip, map, reduce, filter, dict, xrange


New submission from Edward O:

This is a patch for issues similar to #16573
With this patch, the following new tests are now unchanged:

r = dict(zip(s, range(len(s))), **d)
r = len(filter(attrgetter('t'), self.a))
r = min(map(methodcaller('f'), self.a))
max(map(node.id, self.nodes)) + 1 if self.nodes else 0
reduce(set.union, map(f, self.a))

Note that as part of the patch, the range transformation now calls the generic in_special_context in
addition to the customized one (which. I guess, should be removed, but I didn't dare).

All existing tests pass, but the patterns used may not be strict enough, though I tried to stick to how it was
done for other consuming calls.

M Lib/lib2to3/fixer_util.py
M Lib/lib2to3/fixes/fix_xrange.py
M Lib/lib2to3/tests/test_fixers.py

----------
components: 2to3 (2.x to 3.x conversion tool)
files: 2to3_more_consuming_calls.diff
hgrepos: 271
keywords: patch
messages: 226019
nosy: eddygeek
priority: normal
(Continue reading)


Gmane