Brian Kearns | 19 Dec 18:53 2014

[issue23090] fix test_doctest relying on refcounting to close files


Changes by Brian Kearns <bdkearns <at> gmail.com>:

----------
files: fix_test_doctest.patch
keywords: patch
nosy: bdkearns
priority: normal
severity: normal
status: open
title: fix test_doctest relying on refcounting to close files
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file37508/fix_test_doctest.patch

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

Gustavo Temple | 19 Dec 17:07 2014

[issue23089] Update config files


New submission from Gustavo Temple:

Update config.guess and config.sub

----------
components: Installation
files: config.patch
keywords: patch
messages: 232937
nosy: gustavotemple
priority: normal
severity: normal
status: open
title: Update config files
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file37506/config.patch

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

Martin Panter | 19 Dec 05:42 2014

[issue23088] Document that PyUnicode_AsUTF8() returns a null-terminated string


New submission from Martin Panter:

As discussed in msg232863, and later confirmed in the code

----------
assignee: docs <at> python
components: Documentation
files: utf8-null.patch
keywords: patch
messages: 232925
nosy: docs <at> python, vadmium
priority: normal
severity: normal
status: open
title: Document that PyUnicode_AsUTF8() returns a null-terminated string
versions: Python 3.4
Added file: http://bugs.python.org/file37502/utf8-null.patch

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

Keith Chewning | 18 Dec 23:27 2014

[issue23087] Exec variable not found error


New submission from Keith Chewning:

If I %paste this code into an ipython shell the test passes. If this is saved to a file DictTest.py and run with
./DictTest.py -m the test fails. with the error

name 'keys' is not defined

If the variable keys is made global, as is suggested in the comment, the test passes with both methods of
execution. Is there a scoping issue with executing this as a script?

I am using version: '3.4.1 |Anaconda 2.1.0 (64-bit)| (default, Sep 10 2014, 17:10:18) \n[GCC 4.4.7
20120313 (Red Hat 4.4.7-1)]'

import unittest

class DictTest(unittest.TestCase):
    def test_dict_comprehension(self):
        code = """
d = {'a':1, 'b':2, 'c':3, 'd':4}
# global keys # UNCOMMENT FOR TEST TO PASS
keys = ['a', 'd']
items = d.items()
nd = {k: v for k, v in items if k in keys}
print('>>> ' + str(nd))
"""
        try:
            exec(code)
        except Exception as e:
            self.assertTrue(False, "Exec ERROR>>> %s" % e)
(Continue reading)

Raymond Hettinger | 18 Dec 21:41 2014

[issue23086] Add start and stop parameters to the Sequence.index() ABC mixin method


New submission from Raymond Hettinger:

Currently, the Sequence ABC doesn't support start and stop arguments for the index() method which limits
its usefulness in doing repeated searches (iterating over a target value) and which limits it
substitutablity for various concrete sequences such as tuples, lists, strings, bytes, bytearrays, etc.

>>> help(Sequence.index)
Help on method index in module _abcoll:

index(self, value) unbound _abcoll.Sequence method
    S.index(value) -> integer -- return first index of value.
    Raises ValueError if the value is not present.

>>> help(list.index)
Help on method_descriptor:

index(...)
    L.index(value, [start, [stop]]) -> integer -- return first index of value.
    Raises ValueError if the value is not present.

>>> help(str.index)
Help on method_descriptor:

index(...)
    S.index(sub [,start [,end]]) -> int

    Like S.find() but raise ValueError when the substring is not found.

>>> help(tuple.index)
(Continue reading)

Gustavo Temple | 18 Dec 18:13 2014

[issue23085] update internal libffi copy to 3.1


New submission from Gustavo Temple:

Link to the file:
https://github.com/gustavotemple/cpython/pull/2.diff

Link to the changes:
https://github.com/gustavotemple/cpython/pull/2/commits

----------
components: ctypes
files: libffi.patch
keywords: patch
messages: 232890
nosy: doko, gustavotemple, meador.inge
priority: normal
severity: normal
status: open
title: update internal libffi copy to 3.1
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file37496/libffi.patch

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

(Continue reading)

mdcb | 18 Dec 17:34 2014

[issue23084] nanosecond support


New submission from mdcb:

nanosecond support has been discussed at length on python-dev and issue 15443.
POSIX.1b defines a struct timespec that is commonly used in C, and seems a good candidate to add core
nanosecond support. kernel's time-related structs typically end up in the time module.

Attached patch defines a new type struct_timespec for the time module. A new capsule exports the type along
with to/from converters - opening a bridge for C, and for example the datetime module.

----------
components: Library (Lib)
files: time.struct_timespec.patch
hgrepos: 289
keywords: patch
messages: 232889
nosy: mdcb808 <at> gmail.com
priority: normal
severity: normal
status: open
title: nanosecond support
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file37495/time.struct_timespec.patch

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

Polux Moon | 18 Dec 16:06 2014

[issue23083] sys.exit with bool parameter


New submission from Polux Moon:

when using a bool as parameter implementation (2.7) behave like:
sys.exit(True) <=> sys.exit(1)
sys.exit(False) <=> sys.exit(0)

so the bool indicate if the termination is abnormal

following the doc it should be equivalent to sys.exit(1) in all cases
if we assume the implementation is right, the doc should describe the behavior for boolean input

----------
assignee: docs <at> python
components: Documentation
messages: 232883
nosy: Polux.Moon, docs <at> python
priority: normal
severity: normal
status: open
title: sys.exit with bool parameter
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

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

Chris Jerdonek | 18 Dec 14:37 2014

[issue23082] pathlib relative_to() can give confusing error message


New submission from Chris Jerdonek:

pathlib's relative_to(other) can give a confusing message when "other" is os.curdir.

For example--

    Python 3.4.2 (default, Nov 12 2014, 18:23:59) 
    [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import os
    >>> from pathlib import Path
    >>> Path("/foo").relative_to(os.curdir)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/pathlib.py",
line 806, in relative_to
        .format(str(self), str(formatted)))
    ValueError: '/foo' does not start with ''

I guess the error here is that the path must be relative when "other" is relative.

----------
components: Library (Lib)
messages: 232876
nosy: chris.jerdonek
priority: normal
severity: normal
status: open
(Continue reading)

Lars Buitinck | 18 Dec 14:15 2014

[issue23081] Document PySequence_List(o) as equivalent to list(o)


New submission from Lars Buitinck:

PySequence_List has accepted iterables since changeset 6c82277e77f3 of May 1, 2001 ("NEEDS DOC CHANGES"
:), but its documentation still only speaks of sequences. I suggest that it is changed to promise to handle
arbitrary iterables, just like PySequence_Tuple.

----------
assignee: docs <at> python
components: Documentation
files: PySequence_List-doc.patch
keywords: patch
messages: 232875
nosy: docs <at> python, larsmans
priority: normal
severity: normal
status: open
title: Document PySequence_List(o) as equivalent to list(o)
versions: Python 3.5
Added file: http://bugs.python.org/file37493/PySequence_List-doc.patch

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

(Continue reading)

Antony Lee | 18 Dec 13:56 2014

[issue23080] BoundArguments.arguments should be unordered


New submission from Antony Lee:

This patch makes BoundArguments.arguments an unordered dict.  As discussed on python-ideas, the
rationale for this is

1. The current ordering in ba.arguments is the one of the parameters in the signature (which is already
available via the ba.signature attribute), not the one in which the arguments are given (which will
always be unavailable as long as Python doesn't keep the order of keyword arguments), so no information is
lost by this patch.

2. The recipe in the docs for updating ba.arguments to also contain default argument values breaks that
ordering, making __eq__ behavior difficult to explain:

s = signature(lambda x=None, y=None: None)
ba0 = s.bind()
ba1 = s.bind(x=None)
ba2 = s.bind(y=None)
<add default values as suggested in the docs>

At that point, with the current implementation, we'll have ba0 == ba1 != ba2... why?

3. Implementing ba.arguments as a regular dict makes signature.bind much faster, which is important e.g.
if it is used in a decorating type-checker as suggested in PEP362.  (That specific issue could also be
improved by a C-implemented OrderedDict, but the other reasons remain valid.)

----------
components: Library (Lib)
files: unordered-boundarguments.patch
keywords: patch
(Continue reading)


Gmane