[issue30061] Check if PyObject_Size() raised an error

2017-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Raymond, could you please look at the change in Objects/setobject.c? It makes 
the code slightly faster (by avoiding few function calls: PyObject_Size(), 
PySequence_Size()/PyMapping_Size() and sq_length/mp_length), but the main 
purpose is making clear that no error check is needed after calling 
PyObject_Size(). I'm not going to include this change in backports.

Xiang suggests larger change that allows to gets rid of one 
PyDict_CheckExact(). What do you prefer?

--
nosy: +rhettinger

___
Python tracker 

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



[issue30068] missing iter(self) in _io._IOBase.readlines

2017-04-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +benjamin.peterson, serhiy.storchaka, stutzbach

___
Python tracker 

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



[issue11913] sdist refuses README.rst

2017-04-14 Thread STINNER Victor

STINNER Victor added the comment:


New changeset f9f87f0934ca570293ba7194bed3448a7f9bf39c by Victor Stinner (Ryan 
Gonzalez) in branch 'master':
bpo-11913: Add README.rst to the distutils standard READMEs list (#563)
https://github.com/python/cpython/commit/f9f87f0934ca570293ba7194bed3448a7f9bf39c


--
nosy: +haypo

___
Python tracker 

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



[issue30069] External library behave differently when loaded by Python (maybe thread issue)

2017-04-14 Thread sylgar

New submission from sylgar:

Hello, 

I have libsylvain.so which has just one function (sylvain_display()) which 
displays an hello world windows through QT libraries.

I have this one program `sylvain' which is a single line program which calls 
sylvain_display from libsylvain.so.

When I run `sylvain', I have some debug output from QT on the console, and the 
hello world window is displayed on my TV (I am running this on a Raspberry Pi 
with FreeBSD).

Now, when I run python2.7 or python3.6, and load libsylvain.so either through 
the ctypes module or through a C extension module, and call the 
sylvain_display() function from python, I have the console log output from QT 
as with the `sylvain' program, but I don't have the window on my TV!

I guess the rendering to the TV is done on a separate thread and this one is 
not called or locked?

I came up with this simple test program to isolate the issue because both PyQT 
and PySide now don't work as expected, I have console log but no actual TV 
output.

This used to work one year ago, I don't know what has changed in Python. 

Hope you guys will figure this out.

libsylvain.cpp: http://dev.sylvaingarrigues.com/libsylvain.cpp
sylvain.cpp (test program for libsylvain): 
http://dev.sylvaingarrigues.com/sylvain.cpp 
sylvain-ctypes.py (load libsylvain): 
http://dev.sylvaingarrigues.com/sylvain-ctypes.py

Also tried with a C extension to rule out ctypes bug, same issue:
sylvainmodule.cpp (python module wrapper): 
http://dev.sylvaingarrigues.com/sylvainmodule.cpp
sylvain-next.pu (load sylvainmodule and sylvain_display): 
http://dev.sylvaingarrigues.com/sylvain-cext.py

build script: http://dev.sylvaingarrigues.com/build.sh

--
components: Extension Modules, FreeBSD, ctypes
messages: 291644
nosy: koobs, sylgar
priority: normal
severity: normal
status: open
title: External library behave differently when loaded by Python (maybe thread 
issue)
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue30070] Fix errors handling in the parser module

2017-04-14 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch fixes miscellaneous errors in errors handling in the parser 
module. This errors can cause leaking references, raising wrong exceptions, and 
even crashing.

--
components: Extension Modules
messages: 291645
nosy: benjamin.peterson, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Fix errors handling in the parser module
type: crash
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29861] multiprocessing Pool keeps objects (tasks, args, results) alive too long

2017-04-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:


New changeset 685cdb9acc3fca04a9897d88b89771ddfd50e772 by Antoine Pitrou in 
branch 'master':
Relax test timing (bpo-29861) to avoid sporadic failures (#1120)
https://github.com/python/cpython/commit/685cdb9acc3fca04a9897d88b89771ddfd50e772


--

___
Python tracker 

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



[issue30070] Fix errors handling in the parser module

2017-04-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1265

___
Python tracker 

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



[issue29861] multiprocessing Pool keeps objects (tasks, args, results) alive too long

2017-04-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
pull_requests: +1266

___
Python tracker 

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



[issue29861] multiprocessing Pool keeps objects (tasks, args, results) alive too long

2017-04-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
pull_requests: +1267

___
Python tracker 

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



[issue30067] _osx_support.py: misplaced flags in re.sub()

2017-04-14 Thread Xiang Zhang

Changes by Xiang Zhang :


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



[issue30071] Duck-typing inspect.isfunction()

2017-04-14 Thread Jeroen Demeyer

New submission from Jeroen Demeyer:

Python is supposed to encourage duck-typing, but the "inspect" module doesn't 
follow this advice. A particular problem is that Cython functions are not 
recognized by the inspect module to be functions: 
http://cython.readthedocs.io/en/latest/src/userguide/limitations.html#inspect-support

--
components: Library (Lib)
messages: 291647
nosy: jdemeyer, scoder
priority: normal
severity: normal
status: open
title: Duck-typing inspect.isfunction()
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29861] multiprocessing Pool keeps objects (tasks, args, results) alive too long

2017-04-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:


New changeset 413a8913aee255d0635e4ddbb9c343d9e5e76fea by Antoine Pitrou in 
branch '3.6':
Relax test timing (bpo-29861) to avoid sporadic failures (#1120) (#1132)
https://github.com/python/cpython/commit/413a8913aee255d0635e4ddbb9c343d9e5e76fea


--

___
Python tracker 

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



[issue30071] Duck-typing inspect.isfunction()

2017-04-14 Thread Jeroen Demeyer

Changes by Jeroen Demeyer :


--
keywords: +patch
Added file: http://bugs.python.org/file46803/isfunction.patch

___
Python tracker 

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



[issue29861] multiprocessing Pool keeps objects (tasks, args, results) alive too long

2017-04-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:


New changeset 47f24a018f6a9c3ed996d2b83a7ebd0d1f905827 by Antoine Pitrou in 
branch '3.5':
Relax test timing (bpo-29861) to avoid sporadic failures (#1120) (#1133)
https://github.com/python/cpython/commit/47f24a018f6a9c3ed996d2b83a7ebd0d1f905827


--

___
Python tracker 

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



[issue30067] _osx_support.py: misplaced flags in re.sub()

2017-04-14 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +1268

___
Python tracker 

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



[issue30067] _osx_support.py: misplaced flags in re.sub()

2017-04-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage: needs patch -> backport needed

___
Python tracker 

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



[issue30072] re function: convert count and flags parameters to keyword-only?

2017-04-14 Thread STINNER Victor

New submission from STINNER Victor:

The re API seems commonly misused. Example passing a re flag to re.sub():

>>> re.sub("A", "B", "ahah", re.I)
'ahah'

No error, no warning, but it doesn't work. Oh, sub has 5 paramters, no 4...

I suggest to convert count and flags to keyword-only parameters. To not break 
the world, especially legit code passing the count parameter as a position 
argument, an option is to have a deprecation period if these two parameters are 
passed a positional-only parameter.

--

Another option would be to rely on the fact that re flags are now enums instead 
of raw integers, and so add basic type check...

Is there are risk of applications using re flags serialized by pickle from 
Pyhon < 3.6 and so getting integers?

Maybe the check should only be done if flags are passing as positional-only 
argument... but the implementation of such check seems may be overkill for such 
simple and performance-critical function, no?

See issue #30067 for a recent bug in the Python stdlib!

--
components: Library (Lib)
messages: 291650
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: re function: convert count and flags parameters to keyword-only?
versions: Python 3.7

___
Python tracker 

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



[issue30067] _osx_support.py: misplaced flags in re.sub()

2017-04-14 Thread STINNER Victor

STINNER Victor added the comment:

I created the issue #30072: "re functions: convert count and flags parameters 
to keyword-only?".

--
nosy: +haypo

___
Python tracker 

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



[issue30072] re functions: convert count and flags parameters to keyword-only?

2017-04-14 Thread STINNER Victor

Changes by STINNER Victor :


--
title: re function: convert count and flags parameters to keyword-only? -> re 
functions: convert count and flags parameters to keyword-only?

___
Python tracker 

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



[issue30067] _osx_support.py: misplaced flags in re.sub()

2017-04-14 Thread Jack McCracken

Jack McCracken added the comment:

Resolved in GitHub https://github.com/python/cpython/pull/1134.

In 2.7, the flag re.ASCII is not passed due to 2.7's default ASCII strings.

Backporting to 3.5 and 3.6.

--
nosy: +Jack.McCracken

___
Python tracker 

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



[issue30067] _osx_support.py: misplaced flags in re.sub()

2017-04-14 Thread Jack McCracken

Changes by Jack McCracken :


--
pull_requests: +1269

___
Python tracker 

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



[issue30067] _osx_support.py: misplaced flags in re.sub()

2017-04-14 Thread Jack McCracken

Changes by Jack McCracken :


--
pull_requests: +1270

___
Python tracker 

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



[issue30072] re functions: convert count and flags parameters to keyword-only?

2017-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a duplicate of issue11957.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> re.sub confusion between count and flags args

___
Python tracker 

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



[issue30067] _osx_support.py: misplaced flags in re.sub()

2017-04-14 Thread Jack McCracken

Changes by Jack McCracken :


--
pull_requests: +1271

___
Python tracker 

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



[issue30067] _osx_support.py: misplaced flags in re.sub()

2017-04-14 Thread Jack McCracken

Jack McCracken added the comment:

https://github.com/python/cpython/pull/1135 and 
https://github.com/python/cpython/pull/1137 backport it to 3.5 and 3.6, 
respectively.

--

___
Python tracker 

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



[issue11957] re.sub confusion between count and flags args

2017-04-14 Thread STINNER Victor

STINNER Victor added the comment:

My issue #30072 has been marked as a duplicate of this one. Copy of my 
msg291650:

The re API seems commonly misused. Example passing a re flag to re.sub():

>>> re.sub("A", "B", "ahah", re.I)
'ahah'

No error, no warning, but it doesn't work. Oh, sub has 5 paramters, no 4...

I suggest to convert count and flags to keyword-only parameters. To not break 
the world, especially legit code passing the count parameter as a position 
argument, an option is to have a deprecation period if these two parameters are 
passed a positional-only parameter.

--

Another option would be to rely on the fact that re flags are now enums instead 
of raw integers, and so add basic type check...

Is there are risk of applications using re flags serialized by pickle from 
Pyhon < 3.6 and so getting integers?

Maybe the check should only be done if flags are passing as positional-only 
argument... but the implementation of such check seems may be overkill for such 
simple and performance-critical function, no?

See issue #30067 for a recent bug in the Python stdlib!

--

___
Python tracker 

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



[issue30067] _osx_support.py: misplaced flags in re.sub()

2017-04-14 Thread Xiang Zhang

Xiang Zhang added the comment:

My fault.

--
nosy: +xiang.zhang
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



[issue30030] Simplify _RandomNameSequence

2017-04-14 Thread STINNER Victor

STINNER Victor added the comment:

The following builbot failure is probably related:

http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Non-Debug%203.x/builds/623/steps/test/logs/stdio

==
FAIL: test_main (test.test_threadedtempfile.ThreadedTempFileTest)
--
Traceback (most recent call last):
  File 
"D:\buildarea\3.x.ware-win81-release\build\lib\test\test_threadedtempfile.py", 
line 58, in test_main
self.assertEqual(errors, [], msg)
AssertionError: Lists differ: ['Thread-813Traceback (most recent call la[2133 
chars]g\n'] != []

First list contains 4 additional elements.
First extra element 0:
'Thread-813Traceback (most recent call last):\n  File 
"D:\\buildarea\\3.x.ware-win81-release\\build\\lib\\test\\test_threadedtempfile.py",
 line 38, in run\nf = tempfile.TemporaryFile("w+b")\n  File 
"D:\\buildarea\\3.x.ware-win81-release\\build\\lib\\tempfile.py", line 538, in 
NamedTemporaryFile\n(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, 
output_type)\n  File 
"D:\\buildarea\\3.x.ware-win81-release\\build\\lib\\tempfile.py", line 246, in 
_mkstemp_inner\nname = next(names)\nValueError: generator already 
executing\n'

Diff is 2461 characters long. Set self.maxDiff to None to see it. : Errors: 
errors 4 ok 996
Thread-813Traceback (most recent call last):
  File 
"D:\buildarea\3.x.ware-win81-release\build\lib\test\test_threadedtempfile.py", 
line 38, in run
f = tempfile.TemporaryFile("w+b")
  File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 538, 
in NamedTemporaryFile
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 246, 
in _mkstemp_inner
name = next(names)
ValueError: generator already executing

Thread-814Traceback (most recent call last):
  File 
"D:\buildarea\3.x.ware-win81-release\build\lib\test\test_threadedtempfile.py", 
line 38, in run
f = tempfile.TemporaryFile("w+b")
  File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 538, 
in NamedTemporaryFile
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 246, 
in _mkstemp_inner
name = next(names)
ValueError: generator already executing

Thread-819Traceback (most recent call last):
  File 
"D:\buildarea\3.x.ware-win81-release\build\lib\test\test_threadedtempfile.py", 
line 38, in run
f = tempfile.TemporaryFile("w+b")
  File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 538, 
in NamedTemporaryFile
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 246, 
in _mkstemp_inner
name = next(names)
ValueError: generator already executing

Thread-823Traceback (most recent call last):
  File 
"D:\buildarea\3.x.ware-win81-release\build\lib\test\test_threadedtempfile.py", 
line 38, in run
f = tempfile.TemporaryFile("w+b")
  File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 538, 
in NamedTemporaryFile
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 246, 
in _mkstemp_inner
name = next(names)
ValueError: generator already executing

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue30030] Simplify _RandomNameSequence

2017-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, it is related. :(

If there is no easy way to make a generator working in multithread environment 
we need to revert this change.

--

___
Python tracker 

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



[issue11957] re.sub confusion between count and flags args

2017-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Victor, I borrowed Guido's time machine and wrote patches implementing both 
your suggestions a half year ago.

--

___
Python tracker 

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



[issue30030] Simplify _RandomNameSequence

2017-04-14 Thread STINNER Victor

STINNER Victor added the comment:

Why does _get_candidate_names() need a lock? Can't we produce enough entropy to 
reduce the risk of duplicate names in two threads? Maybe we should use 
SystemRandom instead, which would also avoid the need to testing if the pid 
changed.

With one generator per thread, it would prevent the bug no?

--

___
Python tracker 

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



[issue30073] binary compressed file reading corrupts newlines (lzma, gzip, bz2)

2017-04-14 Thread Julian Taylor

New submission from Julian Taylor:

Probably a case of 'don't do that' but reading lines in a compressed files in 
binary mode produces bytes with invalid newlines in encodings that where '\n' 
is encoded as something else:

with lzma.open("test.xz", "wt", encoding="UTF-32-LE") as f:
f.write('0 1 2\n3 4 5');

lzma.open("test.xz", "rb").readlines()[0].decode('UTF-32-LE')

Fails with:
UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x0a in position 20: 
truncated data

as readlines() produces:
b'0\x00\x00\x00 \x00\x00\x001\x00\x00\x00 \x00\x00\x002\x00\x00\x00\n'
The last newline should be '\n'.encode('UTF-32-LE') == b'\n\x00\x00\x00'

--
components: Library (Lib)
messages: 291661
nosy: jtaylor
priority: normal
severity: normal
status: open
title: binary compressed file reading corrupts newlines (lzma, gzip, bz2)

___
Python tracker 

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



[issue30071] Duck-typing inspect.isfunction()

2017-04-14 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Duck typing is not something that "Python" does, it is a style of programming 
done by Python programmers. You wouldn't expect isinstance() to try to "duck 
type", and likewise the inspect module should be precise about what it is 
inspecting. If inspect reports something is a duck, it should be an actual 
duck, not just something that quacks.

I'm not sure that the CPython inspect module should care about Cython objects. 
I don't think that Cython functions should count as Python functions, I think 
they are different kinds of callables.

But even if we decide that Cython function should be recognised by 
inspect.isfunction(), I don't think your patch is the right way to deal with 
it. Not every object with a __code__ attribute is a function.

py> from types import SimpleNamespace
py> x = SimpleNamespace(__code__=1, spam=2)
py> '__code__' in dir(x)
True

Your patch would wrongly detect x as a function when it isn't even callable.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue30073] binary compressed file reading corrupts newlines (lzma, gzip, bz2)

2017-04-14 Thread Julian Taylor

Julian Taylor added the comment:

on second though not really worth an issue as it is a general problem of 
readline on binary streams. Sorry for the noise.

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



[issue30073] binary compressed file reading corrupts newlines (lzma, gzip, bz2)

2017-04-14 Thread Julian Taylor

Julian Taylor added the comment:

see also http://bugs.python.org/issue17083

--

___
Python tracker 

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



[issue30071] Duck-typing inspect.isfunction()

2017-04-14 Thread Jeroen Demeyer

Jeroen Demeyer added the comment:

> If inspect reports something is a duck, it should be an actual duck, not just 
> something that quacks.

The problem is that some Python packages (Sphinx and IPython for example) 
really need to know whether it quacks. And the only tool they have is 
inspect.isfunction(), so they use that. It's silly that every single package 
using inspect.isfunction() should be fixed. Better just fix 
inspect.isfunction().

>>> from types import SimpleNamespace
>>> x = SimpleNamespace(__code__=1, spam=2)
>>> '__code__' in dir(x)

Of course, you can always break stuff. User code is not supposed to invent new 
__dunder__ special names.

--

___
Python tracker 

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



[issue30067] _osx_support.py: misplaced flags in re.sub()

2017-04-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
resolution:  -> fixed
stage: backport needed -> 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



[issue30071] Duck-typing inspect.isfunction()

2017-04-14 Thread R. David Murray

R. David Murray added the comment:

The python standard library makes extensive use of duck typing.  Duck typing is 
a pretty fundamental part of the design of Python, IMO.  Even the ABC module 
does a bunch of duck typing, rather than requiring strict subclassing or 
registration.

I think the request is valid, and it is mostly a matter of agreeing on the best 
way to identify function ducks.  (I agree that Steven's example is 
intentionally trying to quack like a duck and so is not, IMO, a valid counter 
argument against using __code__).  I doubt we would make such a change in 
anything except a feature release, though. 

Let's see what other devs besides Steven and I think.

--
nosy: +r.david.murray
type:  -> enhancement
versions:  -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue30071] Duck-typing inspect.isfunction()

2017-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

__code__ is not enough for quacking as a function. Different code can expect 
other function attributes (for example __name__, __qualname__ and __module__).

See also issue8488. inspect.isroutine() and inspect.ismethoddescriptor() return 
True for some descriptors, but they don't quack good enough for pydoc.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30071] Duck-typing inspect.isfunction()

2017-04-14 Thread Jeroen Demeyer

Jeroen Demeyer added the comment:

At the very least, the inspect module should use more duck-typing internally. 
For example, consider this code from "getfile":

if ismethod(object):
object = object.__func__
if isfunction(object):
object = object.__code__
if istraceback(object):
object = object.tb_frame
if isframe(object):
object = object.f_code
if iscode(object):
return object.co_filename

--

___
Python tracker 

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



[issue22702] to improve documentation for join() (str method)

2017-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

A reference to the iterable term was added in issue7116 when str.join() started 
accepting arbitrary iterables rather than just sequences.

--

___
Python tracker 

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



[issue25794] __setattr__ does not always overload operators

2017-04-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
versions: +Python 3.7

___
Python tracker 

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



[issue23787] sum() function docstring lists arguments incorrectly

2017-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Raymond, could you open a pull request?

--
keywords: +easy
nosy: +serhiy.storchaka
priority: normal -> low
status: open -> pending

___
Python tracker 

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



[issue30063] DeprecationWarning in json/encoder.py

2017-04-14 Thread Paul Durack

Paul Durack added the comment:

@r.david.murray, rather than just closing this issue (which appears to be 
occurring intermittently for other users), is there a doc that you can point to 
that describes why there is a DeprecationWarning being printed - and what 
change has occurred (and when) that has led to my issue.

It seems that jupyter notebooks are suffering the same problem, so I agree it's 
a non-standard lib issue, however some further assistance in resolving this 
issue by suggesting where to look would be helpful

--

___
Python tracker 

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



[issue30063] DeprecationWarning in json/encoder.py

2017-04-14 Thread Paul Durack

Paul Durack added the comment:

I also wonder whether the fact that the warnings library doesn't seems to be 
catching these errors when

In [2]: import warnings
   ...: warnings.filterwarnings('ignore', category=DeprecationWarning)
In [3]: import vcs
/home/user/anaconda2/envs/cdatcmornclnco/lib/python2.7/json/encoder.py:207: 
DeprecationWarning: Interpreting naive datetime as local 2017-04-12 
19:45:31.251897. Please add timezone info to timestamps.
  chunks = self.iterencode(o, _one_shot=True)

Is being used is a similar issue - it seems something is falling through the 
cracks here

--

___
Python tracker 

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



[issue25794] __setattr__ does not always overload operators

2017-04-14 Thread Louie Lu

Changes by Louie Lu :


--
nosy: +louielu

___
Python tracker 

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



[issue29990] Range checking in GB18030 decoder

2017-04-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage: patch review -> needs patch

___
Python tracker 

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



[issue30018] multiprocessing.Pool garbles call stack for __new__

2017-04-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> 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



[issue30063] DeprecationWarning in json/encoder.py

2017-04-14 Thread R. David Murray

R. David Murray added the comment:

I don't believe that warning message is generated by the python standard 
library.  I can't find it in the codebase, and I can't think of any context in 
which we'd have a reason to generate that message.

--

___
Python tracker 

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



[issue30063] DeprecationWarning in json/encoder.py

2017-04-14 Thread R. David Murray

R. David Murray added the comment:

As for the filterwarnings, If you can come up with a demonstration of a problem 
that does not involve third party code, please open a new issue with the 
reproducer.

--

___
Python tracker 

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



[issue30063] DeprecationWarning in json/encoder.py

2017-04-14 Thread Paul Durack

Paul Durack added the comment:

@r.david.murray, is this not the stdlib?

https://github.com/python/cpython/blob/master/Lib/json/encoder.py#L182-L202

The error message appears to be pointing back to this, how (and why) it gets 
there (and what has changed recently so that this DeprecationWarning is being 
triggered) is the question that I am seeking answers..

--

___
Python tracker 

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



[issue30011] HTMLParser class is not thread safe

2017-04-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1272

___
Python tracker 

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



[issue30035] [RFC] PyMemberDef.name should be const char *

2017-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

PyMemberDef.name already is "const char *" in 3.7 (see issue28761).

Adding the const qualifier in other branches can break existing code that 
assigns PyMemberDef.name to a variable of type "char *". This is not 
appropriate for bugfix releases.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30044] shutil.copystat should (allow to) copy ownership, and other attributes

2017-04-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue11957] re.sub confusion between count and flags args

2017-04-14 Thread Jakub Wilk

Changes by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

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



[issue11957] re.sub confusion between count and flags args

2017-04-14 Thread Jakub Wilk

Jakub Wilk added the comment:

+raise TypeError("sub() takes from 2 to 4 positional arguments "
+"but %d were given" % (4 + len(args)))

It's actually 3 to 5 for sub() and subn().

--

___
Python tracker 

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



[issue30063] DeprecationWarning in json/encoder.py

2017-04-14 Thread R. David Murray

R. David Murray added the comment:

Yes, but the way deprecation warnings work is that there is a stacklevel 
specified, and the line reported in the error is that number of steps back up 
the call stack from where the warning was actually issued.  The json module 
doesn't natively handle datetime, so there *must* be third party code that is 
doing the datetime encoding.  It is that code that is triggering the 
Deprecation warning, and the stacklevel on that deprecation warning must skip 
the third party code and go up another level to land in the encode.py file.  
(self.iterencode can result in a call out to user code.)  This may or may not 
be a bug in the third party DeprecationWarning...it is sometimes hard to get 
stacklevel right for all cases, especially if the code in question is usually 
called from a nested function inside the library.

--

___
Python tracker 

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



[issue30059] No documentation for C type Py_Ellipsis

2017-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 0dc5c3169dcd4853612d11ed8c92b12fa210c07f by Serhiy Storchaka 
(Michael Seifert) in branch 'master':
bpo-30059: Include Py_Ellipsis in C API documentation (#1018)
https://github.com/python/cpython/commit/0dc5c3169dcd4853612d11ed8c92b12fa210c07f


--

___
Python tracker 

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



[issue30063] DeprecationWarning in json/encoder.py

2017-04-14 Thread Paul Durack

Paul Durack added the comment:

@r.david.murray fair enough, so it's an external lib that is the problem.. 

It does appear that similar issues have been appearing fairly recently across 
the github-o-sphere, some of these instances are listed at 
https://github.com/jupyter/jupyter/issues/253#issue-221849527

I've managed to solve my usability problem by commenting out a
`#warnings.simplefilter('default')` line in the vcs package, which gets me back 
up and working, but still seems like there is a tangle up somewhere..

Thanks for taking the time to educate me

--

___
Python tracker 

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



[issue30063] DeprecationWarning in json/encoder.py

2017-04-14 Thread R. David Murray

R. David Murray added the comment:

I thought something like that might be the problem with your attempt to 
suppress the warnings.  A library really should not call a global state 
function such as filterwarnings, that should be done only by the application.  
You might want to file a bug report with them about that.

--

___
Python tracker 

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



[issue30063] DeprecationWarning in json/encoder.py

2017-04-14 Thread Paul Durack

Paul Durack added the comment:

@r.david.murray, yep one step ahead of your last comment

https://github.com/UV-CDAT/vcs/issues/170#issuecomment-294219991

feel free to chime in if you think something else would be useful to highlight

--

___
Python tracker 

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



[issue30040] new empty dict can be more small

2017-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I got following result:

$ ./python.patched -m perf timeit --compare-to=./python.default --duplicate=100 
-- '{}'
python.default: . 203 ns +- 5 ns
python.patched: . 97.1 ns +- 0.7 ns

Mean +- std dev: [python.default] 203 ns +- 5 ns -> [python.patched] 97.1 ns +- 
0.7 ns: 2.09x faster (-52%)

$ ./python.patched -m perf timeit --compare-to=./python.default --duplicate=100 
-- 'x={}; x[1]=1'
python.default: . 494 ns +- 5 ns
python.patched: . 592 ns +- 7 ns

Mean +- std dev: [python.default] 494 ns +- 5 ns -> [python.patched] 592 ns +- 
7 ns: 1.20x slower (+20%)

Seems something is wrong with resizing an empty dict. It shouldn't take such 
much time.

--

___
Python tracker 

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



[issue30059] No documentation for C type Py_Ellipsis

2017-04-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> backport needed

___
Python tracker 

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



[issue29931] ipaddress.ip_interface __lt__ check seems to be broken

2017-04-14 Thread Berker Peksag

Berker Peksag added the comment:

I think we should backport this to at least 3.6.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue29651] Inconsistent/undocumented urlsplit/urlparse behavior on invalid inputs

2017-04-14 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue29738] Fix memory leak in SSLSocket.getpeercert()

2017-04-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +1274

___
Python tracker 

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



[issue29738] Fix memory leak in SSLSocket.getpeercert()

2017-04-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 2849cc34a8db93d448a62d69c462402347b50dcb by Mariatta (Olivier 
Vielpeau) in branch 'master':
bpo-29738: Fix memory leak in _get_crl_dp (GH-526)
https://github.com/python/cpython/commit/2849cc34a8db93d448a62d69c462402347b50dcb


--
nosy: +Mariatta

___
Python tracker 

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



[issue29738] Fix memory leak in SSLSocket.getpeercert()

2017-04-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +1275

___
Python tracker 

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



[issue29738] Fix memory leak in SSLSocket.getpeercert()

2017-04-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +1273

___
Python tracker 

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



[issue10379] locale.format() input regression

2017-04-14 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +1276

___
Python tracker 

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



[issue10379] locale.format() input regression

2017-04-14 Thread Berker Peksag

Berker Peksag added the comment:

I think the solution in PR 259 is great, but I still find the documentation a 
little bit vague. I've just opened PR 1145 to add some examples specifiers.

--
nosy: +berker.peksag
stage: needs patch -> patch review
versions: +Python 3.7 -Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue29738] Fix memory leak in SSLSocket.getpeercert()

2017-04-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset b2b00e039ce71e69148e5f479e2154c1c7b712ca by Mariatta in branch 
'2.7':
[2.7] bpo-29738: Fix memory leak in _get_crl_dp (GH-526) (GH-1144)
https://github.com/python/cpython/commit/b2b00e039ce71e69148e5f479e2154c1c7b712ca


--

___
Python tracker 

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



[issue29738] Fix memory leak in SSLSocket.getpeercert()

2017-04-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +1277

___
Python tracker 

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



[issue29738] Fix memory leak in SSLSocket.getpeercert()

2017-04-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 39f5956ffbcc4fe83cee59eed1d18845a5b25dd2 by Mariatta in branch 
'master':
bpo-29738: Add Olivier Vielpeau to Misc/ACKS (GH-1146)
https://github.com/python/cpython/commit/39f5956ffbcc4fe83cee59eed1d18845a5b25dd2


--

___
Python tracker 

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



[issue29738] Fix memory leak in SSLSocket.getpeercert()

2017-04-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 8e7201342dc6eef201bfa4f533ad89a8144fd693 by Mariatta in branch 
'3.6':
[3.6] bpo-29738: Fix memory leak in _get_crl_dp (GH-526) (GH-1142)
https://github.com/python/cpython/commit/8e7201342dc6eef201bfa4f533ad89a8144fd693


--

___
Python tracker 

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



[issue29738] Fix memory leak in SSLSocket.getpeercert()

2017-04-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset c40740cf06470a774e98f84537801cd8b7176938 by Mariatta in branch 
'3.5':
[3.5] bpo-29738: Fix memory leak in _get_crl_dp (GH-526) (GH-1143)
https://github.com/python/cpython/commit/c40740cf06470a774e98f84537801cd8b7176938


--

___
Python tracker 

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



[issue30059] No documentation for C type Py_Ellipsis

2017-04-14 Thread Michael Seifert

Changes by Michael Seifert :


--
pull_requests: +1280

___
Python tracker 

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



[issue29738] Fix memory leak in SSLSocket.getpeercert()

2017-04-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

I merged Olivier's PR, and backported into 3.6, 3.5, and 2.7.
I also added Olivier Vielpeau to misc/ACKS.

Thanks :)

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



[issue30059] No documentation for C type Py_Ellipsis

2017-04-14 Thread Michael Seifert

Changes by Michael Seifert :


--
pull_requests: +1278

___
Python tracker 

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



[issue30059] No documentation for C type Py_Ellipsis

2017-04-14 Thread Michael Seifert

Changes by Michael Seifert :


--
pull_requests: +1279

___
Python tracker 

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



[issue29870] ssl socket leak

2017-04-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

I believe this was fixed in https://bugs.python.org/issue29738, so I'm closing 
this.
Thanks :)

--
nosy: +Mariatta
resolution:  -> fixed
stage:  -> 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



[issue22708] httplib/http.client in method _tunnel used HTTP/1.0 CONNECT method

2017-04-14 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue30059] No documentation for C type Py_Ellipsis

2017-04-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 0b46fcf45afe32402b34240770e01be9b5da3031 by Mariatta (Michael 
Seifert) in branch '2.7':
[2.7] bpo-30059: Include Py_Ellipsis in C API documentation (GH-1018) (GH-1147)
https://github.com/python/cpython/commit/0b46fcf45afe32402b34240770e01be9b5da3031


--

___
Python tracker 

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



[issue30059] No documentation for C type Py_Ellipsis

2017-04-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 05bfbcd233b2f5ba0d0634a380092d6ead6b35e1 by Mariatta (Michael 
Seifert) in branch '3.6':
[3.6] bpo-30059: Include Py_Ellipsis in C API documentation (GH-1018) (GH-1149)
https://github.com/python/cpython/commit/05bfbcd233b2f5ba0d0634a380092d6ead6b35e1


--
nosy: +Mariatta

___
Python tracker 

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



[issue30059] No documentation for C type Py_Ellipsis

2017-04-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset f40e72dbe60038eae69bc72e207ac47851d96752 by Mariatta (Michael 
Seifert) in branch '3.5':
[3.5] bpo-30059: Include Py_Ellipsis in C API documentation (GH-1018) (GH-1148)
https://github.com/python/cpython/commit/f40e72dbe60038eae69bc72e207ac47851d96752


--

___
Python tracker 

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



[issue19225] lack of PyExc_BufferError doc

2017-04-14 Thread Berker Peksag

Berker Peksag added the comment:


New changeset eaeda64c2fd2abd33e59b03298f9cdc9e8efef89 by Berker Peksag 
(cocoatomo) in branch 'master':
bpo-19225: Remove duplicated description for standard warning categories 
(GH-1068)
https://github.com/python/cpython/commit/eaeda64c2fd2abd33e59b03298f9cdc9e8efef89


--
nosy: +berker.peksag

___
Python tracker 

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



[issue30059] No documentation for C type Py_Ellipsis

2017-04-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


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



[issue30022] Get rid of using EnvironmentError and IOError

2017-04-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I checked the patch and it appears to be a clean search/replace.  I assume that 
the aliases have the same diff in C as in Python.

The only idlelib replacement is in run.py, where I (mistakenly) added IOError 
in 3.3 and 3.4 as well as in 2.7.  This must have been after a previous global 
replacement.  I would like this change backported to 3.6 to keep the files 
identical.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue30031] Improve queens demo (use argparse and singular form)

2017-04-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I prefer use of argparse.  Patch *looks* good reading it, but I cannot test yet.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue30068] missing iter(self) in _io._IOBase.readlines

2017-04-14 Thread Xiang Zhang

Xiang Zhang added the comment:


New changeset 026435ce49419a3366171416c68114dd8a1144c7 by Xiang Zhang in branch 
'master':
bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present 
(#1130)
https://github.com/python/cpython/commit/026435ce49419a3366171416c68114dd8a1144c7


--

___
Python tracker 

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



[issue30068] missing iter(self) in _io._IOBase.readlines

2017-04-14 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +1281

___
Python tracker 

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



[issue30068] missing iter(self) in _io._IOBase.readlines

2017-04-14 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +1282

___
Python tracker 

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



[issue30068] missing iter(self) in _io._IOBase.readlines

2017-04-14 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +1283

___
Python tracker 

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



[issue30034] csv reader chokes on bad quoting in large files

2017-04-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Keith, while I sympathize with the request, I am going to agree with the others 
and close this.  As I see it, csv exists to solve a particular problem.  We 
want a printable file of records and text fields with visible field and record 
separators, but we may want to use those separators within fields.  So we add a 
quote character as an auxiliary delimiter and ignore separators within quotes.  
Files with mismatched quotes are broken.

You are willing to append a quote, even though that may be the wrong thing to 
do.  Alternatives include: skip the line, perhaps after logging it; delete the 
last quote to make the count even; provide a more sophisticated auto-editing 
function; or display a GUI entry box initialized to the bad line and request 
the user to edit until quotes are matched.  I don't think we should pick any of 
these.

--
nosy: +terry.reedy
resolution:  -> rejected
stage:  -> 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



[issue30068] missing iter(self) in _io._IOBase.readlines

2017-04-14 Thread Xiang Zhang

Xiang Zhang added the comment:


New changeset 5fbdfc36f397ad46f4057d527855dfacb77242ce by Xiang Zhang in branch 
'2.7':
bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present 
(#1152)
https://github.com/python/cpython/commit/5fbdfc36f397ad46f4057d527855dfacb77242ce


--

___
Python tracker 

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



[issue30068] missing iter(self) in _io._IOBase.readlines

2017-04-14 Thread Xiang Zhang

Xiang Zhang added the comment:


New changeset d5fa5f3ce7d9003bbd3975d1bf634043305ae18f by Xiang Zhang in branch 
'3.6':
bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present 
(#1130) (#1150)
https://github.com/python/cpython/commit/d5fa5f3ce7d9003bbd3975d1bf634043305ae18f


--

___
Python tracker 

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



[issue30068] missing iter(self) in _io._IOBase.readlines

2017-04-14 Thread Xiang Zhang

Xiang Zhang added the comment:


New changeset 4f43f87b6246e13e0eefc793a2c5415c915723c3 by Xiang Zhang in branch 
'3.5':
bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present 
(#1130) (#1151)
https://github.com/python/cpython/commit/4f43f87b6246e13e0eefc793a2c5415c915723c3


--

___
Python tracker 

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



[issue30068] missing iter(self) in _io._IOBase.readlines

2017-04-14 Thread Xiang Zhang

Changes by Xiang Zhang :


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



[issue30011] HTMLParser class is not thread safe

2017-04-14 Thread Alessandro Vesely

Alessandro Vesely added the comment:

On Fri 14/Apr/2017 19:44:29 +0200 Serhiy Storchaka wrote:
> 
> Changes by Serhiy Storchaka :
> 
> 
> --
> pull_requests: +1272

Thank you for your fix, Serhiy.  It makes the class behave consistently.
 However, busy processes are going to concurrently build multiple
temporary entitydefs objects before one of them wins, which is probably
worse than the greedy starting that such lazy initialization tries to
avoid in the first place.  Doesn't that design deserve a comment in the
code, at least?

Greetings
Ale

--

___
Python tracker 

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



[issue30071] Duck-typing inspect.isfunction()

2017-04-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

inspect.isfunction(object) is documented to
Return true if the object is a Python function, which includes functions 
created by a lambda expression.

This is currently implemented as "isinstance(object, types.FunctionType)".

The docs usually regard a 'Python function' as the result of a def statement or 
lambda expression.  The inspect doc says that a function includes a particular 
set of attributes.  One of them is a code object with its own fairly extensive 
set of attributes.  Some of them are derived from the Python code.  But others, 
in particular co_code, are specific to the current CPython bytecode version.  
(And co_code is intentionally writable.)

To me, the main purpose of checking that something is a function, as opposed to 
just being callable, is to know whether one can dependably access the 
attributes.  Given that some are inherently CPython specific, including objects 
compiled by third-party software seems dubious.  (There is also the issue of 
not being able to test with 3rd party objects.)

The referenced cython doc says
"""While it is quite possible to emulate the interface of functions in Cython’s 
own function type, and recent Cython releases have seen several improvements 
here,"""

To me, this implies to me that Cython function (compiled from Cython's extended 
def statements) do not yet perfectly emulate (fulfill) 'Python functions'.  As 
indicated above, perfect emulation seems impossible for Cython or any other 
external compiler that does not use the same bytecode.

"""the “inspect” module does not consider a Cython implemented function a 
“function”, because it tests the object type explicitly instead of comparing an 
abstract interface or an abstract base class. This has a negative impact on 
code that uses inspect to inspect function objects, but would require a change 
to Python itself."""

Where the current situation would be annoying is if working code uses 
isfunction and then Cython is used to speed up the code.  But Cython could 
supply, if it does not now, expanded functions along with the list of 
cyfunction attributes and an indication of which are compatible with CPython 
function attributes.

Cython is not the only 3rd party compiler, and not the only one that might ever 
be linkable to CPython.  So any change to CPython should not be limited to 
Cython.

If it were possible for Cython to makes its CythonFunction class a subclass of 
FunctionType, the issue would be 'solved', though the incompatibilities would 
remain.

--
nosy: +terry.reedy
stage:  -> test needed

___
Python tracker 

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



  1   2   >