[issue24117] Wrong range checking in GB18030 decoder.

2016-01-02 Thread Ezio Melotti

Ezio Melotti added the comment:

Did you hear anything back from them?

--
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue24024] str.__doc__ needs an update

2016-01-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee:  -> docs@python
components: +Documentation
keywords: +easy
nosy: +docs@python
stage:  -> needs patch
type:  -> enhancement
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



[issue25959] tkinter - PhotoImage.zoom() causes segfault

2016-01-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think it is enough just to update a docstring. Adding comprehensive RST 
documentation for Tkinter widgets is different issue.

--
keywords: +patch
Added file: http://bugs.python.org/file41473/tkinter_photo_zoom_doc.patch

___
Python tracker 

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



[issue23315] tempfile.mkdtemp fails with non-ascii paths on Python 2

2016-01-02 Thread Richard PALO

Richard PALO added the comment:

curiously enough, I was able to test with python3.5.
The same errors result, and the same workaround seems to get over it.

--

___
Python tracker 

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



[issue13814] Document why generators don't support the context management protocol

2016-01-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage: needs patch -> patch review
versions: +Python 3.5, Python 3.6 -Python 3.4

___
Python tracker 

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



[issue24117] Wrong range checking in GB18030 decoder.

2016-01-02 Thread Ma Lin

Ma Lin added the comment:

I posted in a Taiwanese forum: https://groups.google.com/forum/#!forum/pythontw
no reply yet.

--

___
Python tracker 

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



[issue23315] tempfile.mkdtemp fails with non-ascii paths on Python 2

2016-01-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The similar problem in Python 3 was addressed in issue24230. But this was a new 
feature.

As for lxml tests, I suggest to use bytes names compatible with all Windows OEM 
encodings (consisting of ASCII + 
b'\xa9\xb0\xb2\xb3\xb4\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc8\xc9\xe6\xf0\xf1\xf3\xf4\xf5\xf6\xf7')
 and with UTF-8.

--
nosy: +gregory.p.smith, scoder, serhiy.storchaka

___
Python tracker 

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



[issue12606] Mutable Sequence Type works different for lists and bytearrays in slice[i:j:k]

2016-01-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Note that adding this new feature to list adds a pressure to add this feature 
to other mutable sequences (deque, ElementTree.Element, etc). This is a burden 
for maintainers.

array already supports this feature as well as bytearray. It may be a 
difference between arrays of unboxed values and general collections of Python 
objects.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25156] shutil.copyfile should internally use os.sendfile when possible

2016-01-02 Thread desbma

desbma added the comment:

Can this patch be merged, or is there something I can do to improve it?

--

___
Python tracker 

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



[issue23560] Group the docs of similar methods in stdtypes.rst

2016-01-02 Thread Ezio Melotti

Changes by Ezio Melotti :


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



[issue16927] Separate built-in types from functions and group similar functions in functions.rst

2016-01-02 Thread Ezio Melotti

Changes by Ezio Melotti :


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



[issue25993] Crashed when call time.time() after using _mm_xor_si64

2016-01-02 Thread Xiongzhi Gao

New submission from Xiongzhi Gao:

The version of windows is Windows 7 Service Pack 1.
The version of Python is 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) 
[MSC v.1500 32 bit (Intel)] on win32.
The version of compiler in visual studio 10 is 16.00.40219.01 for 80x86.

I try to use SWIG to port a function that use _mm_xor_si64 like this:

packed_sse.i

> %module packed_sse
> %{
> extern long long _packed_mm_xor_si64(long long m1, long long m2);
> %}
> extern long long _packed_mm_xor_si64(long long m1, long long m2);

packed_sse.c

> #include 
> 
> __inline __m64 int64_to_m64 (const long long i) {
> union {
> long long i;
> __m64 v;
> } u;
> u.i = i;
> return u.v;
> }
> 
> __inline long long m64_to_int64 (const __m64 v) {
> union {
> long long i;
> __m64 v;
> } u;
> u.v = v;
> return u.i;
> }
> 
> long long _packed_mm_xor_si64(long long m1, long long m2) {
> __m64 m64_m1 = int64_to_m64(m1), m64_m2 = int64_to_m64(m2);
> __m64 m64_result = _mm_xor_si64(m64_m1, m64_m2);
> return m64_to_int64(m64_result);

I use swig and compiler to port C to Python.

I try to test like this, it works:

test_swig.py

> # -*- coding: utf-8 -*-
> # !/bin/env python2
> 
> import random
> 
> import packed_sse
> 
> 
> if __name__ == "__main__":
> for i in range(10):
> a, b = random.getrandbits(20), random.getrandbits(20)
> _ = packed_sse._packed_mm_xor_si64(
> a, b
> )
> assert a ^ b == _

But when I try to profile the function like this, the output of first `print 
time.time() - _beg` is `nan` and Python crashed when run into second `print 
time.time() - _beg`:

profile_swig.py

> # -*- coding: utf-8 -*-
> # !/bin/env python2
> 
> import random
> import time
> 
> import packed_sse
> 
> 
> if __name__ == "__main__":
> _beg = time.time()
> for i in range(10):
> _ = packed_sse._packed_mm_xor_si64(
> random.getrandbits(20), random.getrandbits(20)
> )
> print time.time() - _beg  # First
> _beg = time.time()
> for i in range(10):
> _ = random.getrandbits(20) ^ random.getrandbits(20)
> print time.time() - _beg  # Second

I try to use `gdb` on MingGW to debug it, it said:

> (gdb) stop
> (gdb) c
> Continuing.
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 7172.0xadc]
> 0x534fbe6c in python27!_Py_dg_dtoa () from C:\Windows\system32\python27.dll

--
components: Windows
messages: 257337
nosy: Xiongzhi Gao, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Crashed when call time.time() after using _mm_xor_si64
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue4709] Mingw-w64 and python on windows x64

2016-01-02 Thread Ralf Gommers

Ralf Gommers added the comment:

Hi all,

There is now a much more concrete plan for the static MinGW-w64 based 
toolchain, and the first funding has materialized.

Please see the announcement on the Numpy mailing list 
(http://article.gmane.org/gmane.comp.python.numeric.general/62207), the MingwPy 
site (http://mingwpy.github.io/) and in particular the "main milestones" in 
http://mingwpy.github.io/proposal_december2015.html

--

___
Python tracker 

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



[issue20008] Clean up/refactor/make discoverable test_decimal

2016-01-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added comments on Rietveld. The patch is slightly outdated, so I can't test it.

--

___
Python tracker 

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



[issue12606] Mutable Sequence Type works different for lists and bytearrays in slice[i:j:k]

2016-01-02 Thread Ezio Melotti

Changes by Ezio Melotti :


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



[issue12606] Mutable Sequence Type works different for lists and bytearrays in slice[i:j:k]

2016-01-02 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy:  -petri.lehtinen

___
Python tracker 

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



[issue25983] Add tests for multi-argument type()

2016-01-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is test_class, but it tests different things. There is test_metaclass, it 
contains doctests for class statements with metaclasses.

--

___
Python tracker 

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



[issue16544] Add external link to ast docs

2016-01-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee: docs@python -> ezio.melotti
versions: +Python 3.6 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue24036] GB2312 codec is using a wrong covert table

2016-01-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage:  -> patch review

___
Python tracker 

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



[issue23315] tempfile.mkdtemp fails with non-ascii paths on Python 2

2016-01-02 Thread Richard PALO

Richard PALO added the comment:

This turns out to be related to the locale environment set to 'C'.

A UTF-8 locale seems to get over the issue.

A fellow pkgsrc colleague filed an issue with lxml already relating to that 
fact for the test suite (https://bugs.launchpad.net/lxml/+bug/1522052)

cheers

--

___
Python tracker 

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



[issue25596] regular files handled as directories in the glob module

2016-01-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Avoid using private function glob.glob1() in msi module and tools

___
Python tracker 

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



[issue13305] datetime.strftime("%Y") not consistent for years < 1000

2016-01-02 Thread Alessandro Cucci

Changes by Alessandro Cucci :


Added file: http://bugs.python.org/file41476/doc.patch

___
Python tracker 

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



[issue16620] Avoid using private function glob.glob1() in msi module and tools

2016-01-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee: loewis -> serhiy.storchaka

___
Python tracker 

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



[issue16620] Avoid using private function glob.glob1() in msi module and tools

2016-01-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For now there is only one place left that uses glob1(). Here is a patch that 
inlines glob1() in that place.

--
components:  -Demos and Tools, Windows
stage: needs patch -> patch review
versions: +Python 3.6 -Python 3.5
Added file: http://bugs.python.org/file41475/msilib_no_glob1.patch

___
Python tracker 

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



[issue16620] Avoid using private function glob.glob1() in msi module and tools

2016-01-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch for issue25596 removes glob1(), so we should get rid of its usage.

--
priority: low -> normal

___
Python tracker 

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



[issue25596] regular files handled as directories in the glob module

2016-01-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In general the patch LGTM. It allows to speed up glob by 5-10% in warn test. 
But much more gain we can achieve by using os.scandir(). Here are results of 
microbenchmarks:

$ ./python -m timeit -s "from glob import glob" -- "glob('**/*', 
recursive=True)"
Unpatched:201 msec per loop
Using isdir():181 msec per loop
Using scandir():  65.2 msec per loop

$ ./python -m timeit -s "from glob import glob" -- "glob('/usr/lib*/**/*', 
recursive=True)"
Unpatched:2.06 sec per loop
Using isdir():1.92 sec per loop
Using scandir():  820 msec per loop

$ ./python -m timeit -s "from glob import glob" -- "glob('/usr/lib*/**/', 
recursive=True)"
Unpatched:1.77 sec per loop
Using isdir():1.61 sec per loop
Using scandir():  431 msec per loop

Yet one benefit is that iglob() now yields path names without the delay for 
reading the full content of a directory (see issue22167).

--
nosy: +benhoyt, haypo
priority: low -> normal
Added file: http://bugs.python.org/file41474/glob_scandir.patch

___
Python tracker 

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



[issue25813] co_flags section of inspect module docs out of date

2016-01-02 Thread R. David Murray

R. David Murray added the comment:

Mark, please don't close the issue.  You raised a valid point, it got 
overlooked, but like I said I think Yuri will be interested in looking at it.  
This is a volunteer operation.

--

___
Python tracker 

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



[issue25813] co_flags section of inspect module docs out of date

2016-01-02 Thread Mark Lawrence

Mark Lawrence added the comment:

For the final time,  *I* am the OP and not one of you could be bothered before 
so this remains closed.

--

___
Python tracker 

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



[issue21815] imaplib truncates some untagged responses

2016-01-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 54b36229021a by R David Murray in branch 'default':
#21815: violate IMAP RFC to be compatible with, e.g., gmail
https://hg.python.org/cpython/rev/54b36229021a

--
nosy: +python-dev

___
Python tracker 

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



[issue25998] doctest crashes when accessing __wrapped__ fails other than AttributeError

2016-01-02 Thread Lasse Schuirmann

New submission from Lasse Schuirmann:

You can see this when importing the Flask `request` object in a file that is 
doctested. The `request` object will throw a RuntimeError when one tries to 
access any attribute. Doctest tries to `inspect.unwrap` all objects in the file 
in order to find out if they're doctestable functions - and apparently only 
catches the `AttributeError` exception. Thus it crashes :)

--
components: Tests
files: shell
messages: 257378
nosy: Lasse Schuirmann
priority: normal
severity: normal
status: open
title: doctest crashes when accessing __wrapped__ fails other than 
AttributeError
type: crash
versions: Python 3.5
Added file: http://bugs.python.org/file41477/shell

___
Python tracker 

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



[issue24104] Use after free in xmlparser_setevents (2)

2016-01-02 Thread Martin Panter

Martin Panter added the comment:

Serhiy, you mentioned your Issue 24103 patch also fixes this. Should we close 
this one now as well, or is there more to do?

--
nosy: +martin.panter

___
Python tracker 

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



[issue1753718] base64 "legacy" functions violate RFC 3548

2016-01-02 Thread Martin Panter

Martin Panter added the comment:

I was waiting for you to finish here to avoid any new merge conflicts. Now that 
you have committed your patch, I will try and work on mine in the next few 
days, and I am happy to update the doc strings at the same time.

--

___
Python tracker 

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



[issue21075] fileinput should use stdin.buffer for "rb" mode

2016-01-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ded1336bff49 by R David Murray in branch '3.5':
#22709: Use stdin as-is if it does not have a buffer attribute.
https://hg.python.org/cpython/rev/ded1336bff49

--

___
Python tracker 

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



[issue25813] co_flags section of inspect module docs out of date

2016-01-02 Thread R. David Murray

R. David Murray added the comment:

I think Yuri might be interested.

--
assignee: docs@python -> yselivanov
nosy: +r.david.murray, yselivanov
stage: needs patch -> 
status: closed -> open
type: enhancement -> 

___
Python tracker 

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



[issue25813] co_flags section of inspect module docs out of date

2016-01-02 Thread R. David Murray

R. David Murray added the comment:

I'll leave it closed, but I don't think that is best for the community.

--
assignee: yselivanov -> 

___
Python tracker 

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



[issue25996] Add support of file descriptor in os.scandir()

2016-01-02 Thread STINNER Victor

STINNER Victor added the comment:

Supporting file descriptor was also discussed when pathlib.Path was designed, 
but there was similar questions on the lifetime of the file descriptor. (Who is 
able to close it? When? Is it ok to close it using os.close? etc.)

--

___
Python tracker 

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



[issue13305] datetime.strftime("%Y") not consistent for years < 1000

2016-01-02 Thread Martin Panter

Martin Panter added the comment:

At the bottom of  
it suggests that this four-digit field width specifier is not portable. Does 
that also hold for the datetime version? It seems like a bad idea to recommend 
an unportable workaround for a portability problem.

Also, in the patch it is not clear if you are referring to strptime(), 
strftime(), or both. On Linux, datetime.strptime(..., "%4Y") fails for me.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25637] Move non-collections-related ABCs out of collections.abc

2016-01-02 Thread Yury Selivanov

Yury Selivanov added the comment:

> Did anyone consider moving these near the “types” module, either directly 
> inside, or as a “types.abc” submodule? In my mind, these ABCs would fit 
> reasonably well there. They are related to built-in types, but do not have 
> built-in names.

Big -1.  Let's avoid nesting 'abc' modules throughout the standard library.  
One of the good practices in Python is to import modules, not classes from 
modules.  With 'types.abc' I'll have to import 'from types import abc', and 
then, in the code, I won't be so sure which 'abc' is it -- 'abc', 'types.abc', 
'collections.abc' etc.

Putting ABCs in the 'types' module directly also doesn't feel right and can 
confuse users.  'types' already contains things like 'GeneratorType', 
'CoroutineType' etc, which are actual types (not ABCs).

--

___
Python tracker 

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



[issue25944] Type confusion in partial_setstate and partial_repr leads to control flow hijack

2016-01-02 Thread Martin Panter

Martin Panter added the comment:

I presume you meant Issue 25945, also about partial_setstate(). Issue  25943 is 
about the bsddb module.

--
nosy: +martin.panter
superseder: Integer overflow in _bsddb leads to heap corruption -> Type 
confusion in partial_setstate and partial_call leads to memory corruption

___
Python tracker 

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



[issue24024] str.__doc__ needs an update

2016-01-02 Thread Martin Panter

Martin Panter added the comment:

Slightly easier to read version:

>>> pprint(str.__doc__)
("str(object='') -> str\n"
 'str(bytes_or_buffer[, encoding[, errors]]) -> str\n'
 '\n'
 'Create a new string object from the given object. If encoding or\n'
 'errors is specified, then the object must expose a data buffer\n'
 'that will be decoded using the given encoding and error handler.\n'
 'Otherwise, returns the result of object.__str__() (if defined)\n'
 'or repr(object).\n'
 'encoding defaults to sys.getdefaultencoding().\n'
 "errors defaults to 'strict'.")

I don’t exactly understand your complaint.

Do you want to say encoding directly defaults to UTF-8, bypassing the 
getdefaultencoding() reference?

Do you want to explicitly point out that bytes() and bytearray() expose a data 
buffer and can therefore be decoded? This is already hinted in the name 
bytes_or_buffer.

Do you want to clarify that the Otherwise sentence applies when encoding and 
errors are not specified, rather than when the object does not expose a buffer?

Maybe another thing to change could be fixing the second signature, to show 
that an explicit encoding can be omitted, and bytes_or_buffer is not a valid 
keyword name:

str(object, encoding="utf-8", errors="strict")

--
nosy: +martin.panter

___
Python tracker 

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



[issue25813] co_flags section of inspect module docs out of date

2016-01-02 Thread Berker Peksag

Changes by Berker Peksag :


--
stage:  -> needs patch
status: closed -> open
type:  -> enhancement
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



[issue25813] co_flags section of inspect module docs out of date

2016-01-02 Thread Mark Lawrence

Mark Lawrence added the comment:

I am the OP, this stays closed.  If you couldn't be bothered to reply before 
please raise a new issue.

--
status: open -> closed

___
Python tracker 

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



[issue25998] doctest crashes when accessing __wrapped__ fails other than AttributeError

2016-01-02 Thread Steven D'Aprano

Steven D'Aprano added the comment:

doctest doesn't crash -- it is a regular exception, not a crash. "Crash" means 
"Hard crashes of the Python interpreter – possibly with a core dump or a 
Windows error box." In other words, a segmentation fault or other low-level 
crash, not an exception.

I'm not convinced that this is a problem with doctest, it looks to me like a 
broken-by-design flaw in requests. If you try to access an attribute that 
doesn't exist, you should get AttributeError, not RuntimeError. I don't 
understand the justification given on the requests tracker for why the 
attribute access fails, but I would expect that any exception other than 
AttributeError, or a subclass of such, is a clear bug in requests.

I don't think it is doctest's responsibility to have special handling for an 
ill-designed proxy class, but I'll hold off closing the ticket for a few days 
in case anyone makes a good argument for why this is a doctest bug.

--
nosy: +steven.daprano
type: crash -> behavior

___
Python tracker 

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



[issue25813] co_flags section of inspect module docs out of date

2016-01-02 Thread Mark Lawrence

Mark Lawrence added the comment:

Clearly nobody is interested so closing.

--
status: open -> closed
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



[issue25609] Add a ContextManager ABC and type

2016-01-02 Thread Martin Panter

Martin Panter added the comment:

What would your context manager base class do? I presume you supply a default 
__enter__() that does nothing, or perhaps just returns self.

You mentioned having a default __exit__() but I am having trouble seeing how it 
would be useful. A context manager is only really useful if it does something 
interesting in __exit__(), and for that, the programmer has to write their own 
version and remember its signature.

One option to simplify __exit__() that I used to use is a base class that 
defers to an abstract close() method with no parameters. But since ExitStack is 
now available, I am finding that is good enough instead.

--
nosy: +martin.panter

___
Python tracker 

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



[issue21815] imaplib truncates some untagged responses

2016-01-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 53271aa4d84c by R David Murray in branch 'default':
#21815: Make the doc change match what I actually did.
https://hg.python.org/cpython/rev/53271aa4d84c

--

___
Python tracker 

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



[issue10757] zipfile.write, arcname should be allowed to be a byte string

2016-01-02 Thread Patrik Dufresne

Patrik Dufresne added the comment:

This bug is very old, any development on the subject. This issue is hitting me 
trying to port my project (rdiffweb) to python3. It received a lot of broken 
filename with invalid encoding and I need to create a meaningful Zip archive 
with it. Currently, it just fail because zipfile doesn't accept arcname as 
bytes.

--
nosy: +Patrik Dufresne

___
Python tracker 

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



[issue25637] Move non-collections-related ABCs out of collections.abc

2016-01-02 Thread Martin Panter

Martin Panter added the comment:

Did anyone consider moving these near the “types” module, either directly 
inside, or as a “types.abc” submodule? In my mind, these ABCs would fit 
reasonably well there. They are related to built-in types, but do not have 
built-in names.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25994] File descriptor leaks in os.scandir()

2016-01-02 Thread STINNER Victor

STINNER Victor added the comment:

Hi,

If I recall correctly, this issue was discussed in the long review of 
os.scandir(): issue #22524.


"os.scandir() opens a file descriptor and closes it only in its destructor."

Hopefully, it's incorrect: it's closed when the iterator is exhausted. See how 
ScandirIterator_close() is used.


"This can causes file descriptor leaks in Python implementations without 
reference counting"

Destructors are part of the Python language. Are you aware of a Python 
implementation *never* calls destructors? I know that PyPy can call destructors 
"later", not necessary when the last reference to the object is removed. Do you 
think that we may reach the file descriptor limit because of that?


"We need to add the close() method to the scandir iterator (as in files and 
generators)."

Is it part of the iterator protocol? Or do you mean to explicitly call close()?


"It would be useful also to make it a context manager."

If we decide to add a close() method, it like the idea of also supporting the 
context manager protocol.


"In 3.5 we have to add a warning about this behavior."

Yeah, maybe we can elaborate the doc to explain how the file descriptor / 
Windows handle is used.

--

___
Python tracker 

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



[issue21815] imaplib truncates some untagged responses

2016-01-02 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> fixed
stage: commit 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



[issue21815] imaplib truncates some untagged responses

2016-01-02 Thread R. David Murray

R. David Murray added the comment:

I rewrote the comments, and I changed the name of the test helper class from 
GmailHandler to BracketFlagHandler, since this is not gmail specific.  (There 
was a review comment about that that was missed, I guess).

I've applied this only to 3.6 because there is a backward compatibility 
concern, as I mention in the revised comments: if a server includes a ']' in 
the text portion, the new regex will parse it incorrectly.  (Which is why the 
rfc restriction exists in the first place.)  I'm hoping that this is very 
unlikely, but because it would be a nasty bug if it happens, I only feel 
comfortable applying it to 3.6.

Thanks Lita, and everyone who reviewed.

--

___
Python tracker 

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



[issue25998] doctest crashes when accessing __wrapped__ fails other than AttributeError

2016-01-02 Thread Lasse Schuirmann

Lasse Schuirmann added the comment:

(Closed) issue at the flask repository of this: 
https://github.com/mitsuhiko/flask/issues/1680

Also IIRC this worked back with Python 3.4 but do not consider this a fact yet. 
(At least the tests ran on Fedora...)

--

___
Python tracker 

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



[issue25997] Tarfile.add with bytes path is failing

2016-01-02 Thread Patrik Dufresne

Patrik Dufresne added the comment:

> Is the tarfile module designed to support bytes for file names in general? 
> The documentation doesn’t seem to mention bytes anywhere relevant. This seems 
> more like a new feature rather than a bug to me.

I'm using bytes in Unix to represent a path. From `os.path` docs : The path 
parameters can be passed as either strings, or bytes. Applications are 
encouraged to represent file names as (Unicode) character strings. 
Unfortunately, some file names may not be representable as strings on Unix, so 
applications that need to support arbitrary file names on Unix should use bytes 
objects to represent path names. Vice versa, using bytes objects cannot 
represent all file names on Windows (in the standard mbcs encoding), hence 
Windows applications should use string objects to access all files.

As such, I'm expecting to use bytes to represent a path with tarfile.

Also, tar file format doesn't define any specific encoding for filename. I'me 
xpecting to but any kind of bytes data for a given filename... since this was 
wokring in tarfile with py2.

> Does using a surrogateescape encoded filename work?  (You won't get the error 
> you report...my question is, does that do the right thing when building the 
> archive?)

I will need to have further look into surrogateescape. I read somewhere it was 
an experimental feature, so I didn't try it.


Thanks both for your quick feedback in this holidays.

--

___
Python tracker 

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



[issue22709] restore accepting detached stdin in fileinput binary mode

2016-01-02 Thread R. David Murray

R. David Murray added the comment:

Hopefully 'better late than never' applies to this.  Sigh.

--
resolution:  -> fixed
stage: commit 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



[issue25813] co_flags section of inspect module docs out of date

2016-01-02 Thread Mark Lawrence

Changes by Mark Lawrence :


--
status: open -> closed

___
Python tracker 

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



[issue6500] urllib2 maximum recursion depth exceeded

2016-01-02 Thread Berker Peksag

Berker Peksag added the comment:

Thank you Ezio, I'll commit this tomorrow.

--
assignee: jhylton -> berker.peksag

___
Python tracker 

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



[issue25996] Add support of file descriptor in os.scandir()

2016-01-02 Thread STINNER Victor

STINNER Victor added the comment:

Yeah, it was discussed when the PEP 471 was designed, but it was already hard 
to design os.scandir() without supporting fd as os.scandir() parameter.

It's more complex because we have to handle the lifetime of the file descriptor 
especially if it's exposed in a public attribute.

--

___
Python tracker 

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



[issue25997] Tarfile.add with bytes path is failing

2016-01-02 Thread Martin Panter

Martin Panter added the comment:

Is the tarfile module designed to support bytes for file names in general? The 
documentation doesn’t seem to mention bytes anywhere relevant. This seems more 
like a new feature rather than a bug to me.

--
nosy: +martin.panter
title: Tarfile.add with bytes path is failling -> Tarfile.add with bytes path 
is failing

___
Python tracker 

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



[issue25997] Tarfile.add with bytes path is failing

2016-01-02 Thread Martin Panter

Martin Panter added the comment:

It looks like surrogate-escaped bytes should be supported thanks to Issue 8390, 
although this is not so useful if you use the “pax” format (which always uses 
UTF-8 internally).

To generate a surrogate-escaped string, you can “decode” it with the following 
error handler:

>>> b"non-as\xA9ii".decode("ascii", "surrogateescape")
'non-as\udca9ii'

--

___
Python tracker 

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



[issue25994] File descriptor leaks in os.scandir()

2016-01-02 Thread Ben Hoyt

Ben Hoyt added the comment:

I'm not sure this is actually a leak, because (looking at the code) 
ScandirIterator_close() is called not just in the destructor, but also at the 
end of iterating, just before raising StopIteration. Is the issue that if an 
exception is raised or you stop iterating before the end, then it's less 
determined when the destructor/close is called?

I think we could fairly easily add an explicit close method to the iterator and 
make it a context manager (add __enter__ and __exit__ methods to the iterator). 
Is this what you're thinking of:

# manual close
it = scandir.scandir(path)
first_entry = next(it)
it.close()

with scandir.scandir(path) as it:
first_entry = next(it)

--

___
Python tracker 

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



[issue21592] Make statistics.median run in linear time

2016-01-02 Thread Upendra Kumar

Upendra Kumar added the comment:

This is my first attempt to contribute. I have used the Median of Medians with 
n/5 groups of 5 elements each. It has linear time complexity. But, still I am 
not sure about it, because constants may be high. Therefore, if anyone can 
please benchmark it with other methods or check that can this method be a 
viable solution to finding median more efficiently?

I will like it to be checked before I make attempts to convert it into a patch.

--
nosy: +upendra-k14
Added file: http://bugs.python.org/file41479/effmedian.py

___
Python tracker 

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



[issue25994] File descriptor leaks in os.scandir()

2016-01-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, it's what I mean. Add methods close, __enter__ and __exit__ to the 
iterator. The scandir iterator is not just iterator, it is like file object.

And as in file object, we perhaps have to emit a ResourceWarning in the 
destructor if close() or __exit__() were not called.

--

___
Python tracker 

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



[issue23942] Explain naming of the patch files in the bug tracker

2016-01-02 Thread Ezio Melotti

Ezio Melotti added the comment:

FWIW I use e.g. issue1234.diff and if further patches are needed I add an 
increasing suffix: issue1234-2.diff, issue1234-3.diff, etc.
Since the name doesn't matter too much, I'm not sure it's worth documenting 
and/or enforcing a specific convention.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue25348] Update pgo_build.bat to use --pgo flag for regrtest

2016-01-02 Thread Zachary Ware

Zachary Ware added the comment:

Here's a patch that folds PGO into PCbuild\build.bat (removing 
PCbuild\build_pgo.bat) and defaults to using "python -m test --pgo" for 
training.  This should apply to all branches, but will need some slight 
adjustment for 2.7 (namely, s/-m test/-m test.regrtest/).  It might also be 
nice to leave a stub build_pgo.bat on 2.7 and 3.5 in case anyone actually uses 
it.

This patch also switches the default build environment to 'amd64' rather than 
'x86_amd64' for -p x64 when it looks like it's running on a 64 bit OS.  PGO 
requires 'amd64' for 64 bit builds, and if x86_amd64 is available, 'amd64' 
should be as well.  'x86_amd64' is still used for non-PGO builds when -p x64 is 
specified and it looks like a 32 bit OS.  I considered switching the default 
platform target to x64 when running on 64 bit, but that's a separate issue.  It 
uses "%ProgramFiles(x86)"=="" to detect 32-bit, and gives a helpful message in 
the case of a false positive on that check.

--
keywords: +patch
stage:  -> patch review
versions: +Python 2.7, Python 3.5
Added file: http://bugs.python.org/file41478/windows_pgo.diff

___
Python tracker 

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



[issue23951] Update devguide style to use a similar theme as Docs

2016-01-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +georg.brandl

___
Python tracker 

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



[issue22623] Port Python to 3DS: micro kernel, homebrew, newlib (Missing guards for some POSIX functions)

2016-01-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
status: open -> pending
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue21592] Make statistics.median run in linear time

2016-01-02 Thread Upendra Kumar

Upendra Kumar added the comment:

This method can also be further used to implement multiselect functionality 
with slight changes in the nth-order function.

--

___
Python tracker 

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



[issue24104] Use after free in xmlparser_setevents (2)

2016-01-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Use after free in xmlparser_setevents (1)

___
Python tracker 

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



[issue23890] assertRaises increases reference counter

2016-01-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
stage:  -> needs patch
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



[issue13305] datetime.strftime("%Y") not consistent for years < 1000

2016-01-02 Thread Ezio Melotti

Ezio Melotti added the comment:

> Also, using %4Y seems to consistently produce zero-padded values across
> different platforms.

Actually I was wrong.  Based on some more testing I did on Linux and Windows 8 
and the previous comments in this thread, it seems that, with 1 as year:
* '%4Y' does produces '0001' on Linux but gives a value error on Windows and 
'4Y' on OS X;
* '%Y' produces '1' on Linux and '0001' on Windows and OS X;

So the problem is only on Linux and only with years <1000, where to have a 
zero-padded value %4Y can be used instead.
I don't know if these results are true for all versions of Linux/Win/OSX, so 
the note could just say that:
1) some platforms (e.g. Linux) don't zero-pad years <1000;
2) some platforms (e.g. Linux) support %4Y to add padding, but this doesn't 
work on other platforms.

--

___
Python tracker 

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



[issue22831] Use "with" to avoid possible fd leaks

2016-01-02 Thread Ezio Melotti

Ezio Melotti added the comment:

Serhiy, what's the status of this?

--

___
Python tracker 

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



[issue25992] test_gdb fails

2016-01-02 Thread Ned Deily

Ned Deily added the comment:

As you may know, GNU gcc and gdb have not been included in the standard 
development tools shipped with Apple as part of Xcode and the Command Line 
Tools for a number of releases, in favor of llvm/clang and lldb.  So test_gdb 
is typically automatically skipped on current OS X releases.  That said, if you 
install gcc and gdb from a third-party and build a current Python with it, it 
would be good if test_gdb passed.  However, the log file you attached hints 
that gdb may not be functional, at least with the Homebrew Python you appear to 
be using (built with Clang); note the'Unable to find Mach task port' message.  
Can you verify that the gdb you are using does or does not work with the Python 
in question, perhaps by trying some of the examples in the Developer's Guide 
(https://docs.python.org/devguide/gdb.html)?

--

___
Python tracker 

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



[issue25944] Type confusion in partial_setstate and partial_repr leads to control flow hijack

2016-01-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, thank you Martin.

--

___
Python tracker 

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



[issue22831] Use "with" to avoid possible fd leaks

2016-01-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Only the most important patch for the stdlib was committed.

Patches for distutils, tests and tools are not committed still.

fd_leaks_distutils.patch
fd_leaks_tools1_2.patch
fd_leaks_tools2_2.patch
fd_leaks_tests1_2.patch
fd_leaks_tests2_2.patch

--
Added file: http://bugs.python.org/file41480/fd_leaks_tests2_2.patch

___
Python tracker 

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