[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-04 Thread Nick Coghlan

Nick Coghlan added the comment:

I should have made my comments a bit clearer as to which patches they were 
referring to. The ones submitted for inclusion in 3.6.0rc1 are:

* issue23722_classcell_reference_validation.diff (the compatibility fix)
* issue23722_documentation_updates.diff (the related docs updates)

--

___
Python tracker 

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



[issue28860] Fixed all the doctest failures in Doc/library/configparser.rst

2016-12-04 Thread Marco Buttu

Marco Buttu added the comment:

Here is a 3rd patch. I used a generator expression argument to ``sorted()``, as 
recommend by Zachary. Thank you very much for all your suggestions

--
Added file: http://bugs.python.org/file45745/configparser3rd.patch

___
Python tracker 

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



[issue28863] Doc/includes/*.py files and doctests

2016-12-04 Thread Marco Buttu

Marco Buttu added the comment:

Here is the patch for the Sphinx conf.py file.

--
keywords: +patch
Added file: http://bugs.python.org/file45746/conf.py.patch

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Nick, could you please look at the patch? Especially at the part about 
__classcell__.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added comments on Rietveld.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28692] gettext: deprecate selecting plural form by fractional numbers

2016-12-04 Thread Julien Palard

Julien Palard added the comment:

> But gettext formulas are not purposed to support non-integer values and can 
> return incorrect result

Looks like the cast to integer is done *before* giving the value to the C 
gettext expression.

> For example (in Ukrainian)

As long as gettext expression don't support non-integer values, there exist 
*no* way to support two languages where plural form differ for non-integer 
value. Typically if a language A consider 1.5 to be singular and another 
language B consider 1.5 to be plural, the only place in the code that can make 
the difference IS in the C plural expression which don't support non-integer 
values.

Rouding the value before giving it to ngettext only fixes the issue for the 
lang of the current developer, as for other languages, translators won't be 
able to change the rounding properties.

But should we bet that in most, any, or all languages, 1.5 is considered 
plural? I think so, according to wikipedia¹: "Plural of nouns typically denote 
a quantity other than the default quantity represented by a noun, which is 
generally one."

So, I think that a better fix than warning for non-integer values may be to 
round them using math.ceil instead of round. This way we avoid developpers to 
drop round() everywhere to fix the warning the wrong way, leaving the same bug 
you're having in Ukrainian.

¹: https://en.wikipedia.org/wiki/Plural

--

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2016-12-04 Thread Marco Buttu

Marco Buttu added the comment:

Here is a patch that makes all Doc/library/datetime.rst doctests pass. The 
tests only pass with Python 3.6 and 3.7 (the optional ``timespec`` argument of 
``datetime.isoformat()`` has been introduced in Python 3.6).

To apply the patch you should agree with issue 28863. In particular, to make 
the patch effective, as explained in issue 28863, you should:

* apply the Doc/conf.py patch of issue 28863.
* rename Doc/includes/tzinfo-examples.py to Doc/includes/tzinfo_examples.py

About the Raymond disappointment expressed in #10225, I see two ways to make 
both Raymond happy and the code examples tested. For the examples included from 
Doc/includes, using the ``literalinclude`` Sphinx directive, we can just add 
the Doc/includes path in Doc/conf.py (see issue 28863). At this point we can 
import them in the shell code examples (or in the ``setupcode``). In the 
datetime.rst.patch in attachment, I make use of this solution. Another option, 
for short snippets of code, not included from Doc/includes, is to use the 
``testcode`` Sphinx directive.

--
keywords: +patch
nosy: +marco.buttu
Added file: http://bugs.python.org/file45747/datetime.rst.patch

___
Python tracker 

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



[issue28692] gettext: deprecate selecting plural form by fractional numbers

2016-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

round() was used because it is the simplest way to convert fractional numbers 
to integers that doesn't involve strings-to-integer converting (as in int()). 
Perhaps math.trunc() looks a little more appropriate. math.ceil() returns a 
float in 2.7 and is limited by float range. But "1.678 second" don't look more 
correct than "1.678 seconds". My point is that gettext ability of selecting 
plural form shouldn't be used for fractional numbers. It seems to me that a 
fractional number should be formatted with the same form independently from 
it's value (it can be different from plural forms for integer numbers). 
Proposed patch adds a deprecating warning for encouraging users to rewrite 
their code for formatting fractional numbers.

--

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-12-04 Thread Nick Coghlan

Nick Coghlan added the comment:

"__classcell__" in __slots__ doesn't really make sense, as unlike __qualname__ 
(which turns into a real class level attribute and can be useful to override on 
instances), it's only a transient entry in a class definition namespace - 
types.__new__ pops it automatically so it doesn't get turned into an attribute.

However, consistency is a good thing, so allowing it seems reasonable.

Regarding the specifics, the pending patch on issue 23722 makes it a TypeError 
to ever set __classcell__ to anything other than a real cell object.

--

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-12-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +During metaclass.__init__, super() of the constructed class does 
not work

___
Python tracker 

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



[issue28865] [MinGW32-x64]-PyList_Check PyDict_Check does not work

2016-12-04 Thread Mikhail

New submission from Mikhail:

Windows 10 x64
Python 3.4, 3.5, Anaconda3 4.2  - x64
SWIG 3.0.8, 3.0.10
MinGW32/64  - TDM-GCC-64 5.1.0-2, x86_64-5.3.0-win32-sjlj-rt_v4-rev0, 
x86_64-6.2.0-win32-sjlj-rt_v5-rev1  

The code in C compiles fine, there are no warnings. But then, in the finished 
module, do not work C-API functions such as:

PyList_Check
PyDict_Check
PyDict_Next

PyObject *result = PyList_New(1);
printf("%i \n", PyList_Check(result));

Check always returns zero, even if the object is created in the previous line.
But PyMapping_Check works fine

--
components: Build, Distutils, Windows
messages: 282333
nosy: dstufft, eric.araujo, mifik, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: [MinGW32-x64]-PyList_Check PyDict_Check does not work
type: resource usage
versions: Python 3.4, Python 3.5

___
Python tracker 

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



[issue28865] [MinGW32-x64]-PyList_Check PyDict_Check does not work

2016-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please provide a complete C file that is compiled?

Output also PyType_GetFlags(Py_TYPE(result)). And check that result is not NULL.

--
nosy: +serhiy.storchaka
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



[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-04 Thread Nick Coghlan

Nick Coghlan added the comment:

Updated patch for Serhiy's review comments: 
issue23722_classcell_reference_validation_v2.diff

- avoids a spurious deprecation warning for metaclasses that don't return a 
type() instance at all
- avoids even the appearance of a refleak in the __build_class__ fallback code
- integrates the documentation into the main patch

--
Added file: 
http://bugs.python.org/file45748/issue23722_classcell_reference_validation_v2.diff

___
Python tracker 

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



[issue24339] iso6937 encoding missing

2016-12-04 Thread John Helour

Changes by John Helour :


Added file: http://bugs.python.org/file45749/check_iso6937.py

___
Python tracker 

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



[issue24339] iso6937 encoding missing

2016-12-04 Thread John Helour

Changes by John Helour :


Removed file: http://bugs.python.org/file45740/iso6937.py

___
Python tracker 

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



[issue24339] iso6937 encoding missing

2016-12-04 Thread John Helour

Changes by John Helour :


Added file: http://bugs.python.org/file45750/iso6937.py

___
Python tracker 

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



[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-04 Thread Nick Coghlan

Nick Coghlan added the comment:

Assuming there are no further comments overnight, I'll go ahead and commit this 
tomorrow (after doing a local refleak hunting run).

--

___
Python tracker 

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



[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added two more style comments. And please take note of my comments to 
issue23722_documentation_updates.diff. Nothing critical, but would be nice to 
add more cross-references in the documentation.

--

___
Python tracker 

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



[issue24339] iso6937 encoding missing

2016-12-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
priority: normal -> low

___
Python tracker 

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



[issue24339] iso6937 encoding missing

2016-12-04 Thread John Helour

John Helour added the comment:

Performance issue resolved, more info on error added.

I've checked encoding and decoding on a two UTF-8 ~3MiB txt files. Except the 
first BOM mark (May I ignore it?) all seems work OK.

--

___
Python tracker 

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



[issue28596] on Android _bootlocale on startup relies on too many library modules

2016-12-04 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Patch version 3, using sys.getandroidapilevel()

--
Added file: http://bugs.python.org/file45751/android-locale-utf8.patch

___
Python tracker 

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



[issue27305] Crash with "pip list --outdated" on Windows 10 with Python 2.7.12rc1

2016-12-04 Thread Максим Лукоянов

Максим Лукоянов added the comment:

>>> import sys
>>> print sys.version
2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)]
>>> from urllib2 import urlopen
>>> urlopen('http://www.google.co.uk')

Traceback (most recent call last):
  File "", line 1, in 
urlopen('http://www.google.co.uk')
  File "C:\Python27x64\lib\urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
  File "C:\Python27x64\lib\urllib2.py", line 435, in open
response = meth(req, response)
  File "C:\Python27x64\lib\urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
  File "C:\Python27x64\lib\urllib2.py", line 467, in error
result = self._call_chain(*args)
  File "C:\Python27x64\lib\urllib2.py", line 407, in _call_chain
result = func(*args)
  File "C:\Python27x64\lib\urllib2.py", line 654, in http_error_302
return self.parent.open(new, timeout=req.timeout)
  File "C:\Python27x64\lib\urllib2.py", line 435, in open
response = meth(req, response)
  File "C:\Python27x64\lib\urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
  File "C:\Python27x64\lib\urllib2.py", line 473, in error
return self._call_chain(*args)
  File "C:\Python27x64\lib\urllib2.py", line 407, in _call_chain
result = func(*args)
  File "C:\Python27x64\lib\urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 503: Service Unavailable
>>> urlopen('https://www.google.co.uk')

=== RESTART: Shell ===

--

___
Python tracker 

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



[issue27305] Crash with "pip list --outdated" on Windows 10 with Python 2.7.12rc1

2016-12-04 Thread Максим Лукоянов

Максим Лукоянов added the comment:

>>> import platform
>>> platform.platform()
'Windows-10-10.0.14393'

--

___
Python tracker 

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



[issue28692] gettext: deprecate selecting plural form by fractional numbers

2016-12-04 Thread Julien Palard

Julien Palard added the comment:

> It seems to me that a fractional number should be formatted with the same 
> form independently from it's value

Ok, so 1.000 seconds, ok, LGTM.

Should we mention something explicit about it? Not sure how to write it down, 
but I still fear that everyone's reaction will be "Oh can't give a float? Let 
my put a round() in my call" and stay with the same plural bug as before.

Maybe replace

> Plural value must be an integer

by

> Should not use ngettext with floating point, consider an invariant form.

?

--

___
Python tracker 

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



[issue27305] Crash with "pip list --outdated" on Windows 10 with Python 2.7.12rc1

2016-12-04 Thread Steve Dower

Steve Dower added the comment:

Since it's not crashing, it is different from this issue. You should open a new 
bug.

--

___
Python tracker 

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



[issue28866] Unexpected behavior resulting from mro() and __setattr__ in interactive mode

2016-12-04 Thread sjpalt

New submission from sjpalt:

I ran into a strange bug while experimenting with metaclasses that implement a 
custom mro() method. It only seems to occur in interactive mode, either 
returning completely unrelated values or causing a segfault. Python 2 appears 
unaffected. I have been able to reproduce this with the following code:

# $ python -i weird.py
# >>> proxy.x
# 52011448
# >>> proxy.x
# 6160
# ...

class Foo:
pass

class Meta(type):
def mro(cls):
return (cls, Foo, object)

def __setattr__(cls, name, value):
setattr(Foo, name, value)

proxy = Meta('FooProxy', (), {})

proxy.x = 300
proxy.x  # don't omit
proxy.x = 0

--
components: Interpreter Core
files: weird.py
messages: 282344
nosy: sjpalt
priority: normal
severity: normal
status: open
title: Unexpected behavior resulting from mro() and __setattr__ in interactive 
mode
type: crash
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file45752/weird.py

___
Python tracker 

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



[issue28866] Unexpected behavior resulting from mro() and __setattr__ in interactive mode

2016-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Python 2 is affected if make Foo a new style class.

--
nosy: +serhiy.storchaka
priority: normal -> high
versions: +Python 3.6, 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



[issue28707] add 'directory' option to the http.server module

2016-12-04 Thread Julien Palard

Julien Palard added the comment:

@Victor you're right, I forgot that partial can also apply keyword arguments. 
Here is a new patch.

--
Added file: http://bugs.python.org/file45753/issue28707.diff

___
Python tracker 

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



[issue28865] [MinGW32-x64]-PyList_Check PyDict_Check does not work

2016-12-04 Thread Mikhail

Mikhail added the comment:

Project included.


building output in the console:

running build_ext
building '_PyAPITests' extension
swigging PyAPITests.i to PyAPITests_wrap.c
z:\PortableApps\MyApps\Dev\SWIGWin\swigwin-3.0.10\swig.exe -python -py3 -o 
PyAPITests_wrap.c PyAPITests.i
z:\PortableApps\MyApps\Dev\mingw64\x86_64-6.2.0-win32-sjlj-rt_v5-rev1\mingw64\bin\gcc.exe
 -mdll -O -Wall -IZ:\PortableApps\MyApps\Dev\Python\Anaconda3\include 
-IZ:\PortableApps\MyApps\Dev\Python\Anaconda3\include -c PyAPITests_wrap.c -o 
build\temp.win-amd64-3.5\Release\pyapitests_wrap.o -std=c99
z:\PortableApps\MyApps\Dev\mingw64\x86_64-6.2.0-win32-sjlj-rt_v5-rev1\mingw64\bin\gcc.exe
 -mdll -O -Wall -IZ:\PortableApps\MyApps\Dev\Python\Anaconda3\include 
-IZ:\PortableApps\MyApps\Dev\Python\Anaconda3\include -c PyAPITests.c -o 
build\temp.win-amd64-3.5\Release\pyapitests.o -std=c99
writing build\temp.win-amd64-3.5\Release\_PyAPITests.cp35-win_amd64.def
z:\PortableApps\MyApps\Dev\mingw64\x86_64-6.2.0-win32-sjlj-rt_v5-rev1\mingw64\bin\gcc.exe
 -shared -s build\temp.win-amd64-3.5\Release\pyapitests_wrap.o 
build\temp.win-amd64-3.5\Release\pyapitests.o 
build\temp.win-amd64-3.5\Release\_PyAPITests.cp35-win_amd64.def 
-LZ:\PortableApps\MyApps\Dev\Python\Anaconda3\libs 
-LZ:\PortableApps\MyApps\Dev\Python\Anaconda3\PCbuild\amd64 -lpython35 
-lvcruntime140 -o Z:\Projects\AI\PyAPITests\_PyAPITests.cp35-win_amd64.pyd


main output:

Start
TestIteration: 0 
tp_name for List: list 
tp_name for Dict: dict 
PyType_GetFlags for List: 34362368 
PyType_GetFlags for Dict: 537678848 
PyList_Size: 0 
PyDict_Size: 0 
PyMapping_Check for List: 1 
PyMapping_Check for Dict: 1 
PyList_Check: 0 
PyDict_Check: 0 
Iterators test for Dict:

End iterators test.
-
TestIteration: 1 
tp_name for List: list 
tp_name for Dict: dict 
PyType_GetFlags for List: 34362368 
PyType_GetFlags for Dict: 537678848 
PyList_Size: 1 
PyDict_Size: 1 
PyMapping_Check for List: 1 
PyMapping_Check for Dict: 1 
PyList_Check: 0 
PyDict_Check: 0 
Iterators test for Dict:

End iterators test.
-
TestIteration: 2 
tp_name for List: list 
tp_name for Dict: dict 
PyType_GetFlags for List: 34362368 
PyType_GetFlags for Dict: 537678848 
PyList_Size: 2 
PyDict_Size: 2 
PyMapping_Check for List: 1 
PyMapping_Check for Dict: 1 
PyList_Check: 0 
PyDict_Check: 0 
Iterators test for Dict:

End iterators test.
-
ReturnedResult: 3
End

--
Added file: http://bugs.python.org/file45754/PyAPITests.zip

___
Python tracker 

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



[issue28724] Add method send_io, recv_io to the socket module.

2016-12-04 Thread Julien Palard

Julien Palard added the comment:

Unless somebody don't think so, I think this should go as a pypi module before 
going to the socket module, so this issue should probably be closed.

--

___
Python tracker 

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



[issue28866] Unexpected behavior resulting from mro() and __setattr__ in interactive mode

2016-12-04 Thread Emanuel Barry

Emanuel Barry added the comment:

Additionally, trying to access an attribute before assigning it will result in 
an AttributeError on all subsequent accesses (even if set).

I didn't manage to get a segfault, however.

--
nosy: +ebarry

___
Python tracker 

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



[issue28866] Unexpected behavior resulting from mro() and __setattr__ in interactive mode

2016-12-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue28754] Argument Clinic for bisect.bisect_left

2016-12-04 Thread Julien Palard

Julien Palard added the comment:

Hi Martin,

Historically (lo=0, hi=None) was the implementation (in Python), until the C 
implementation, which used (lo=0, hi=-1). As my implementation allows for -1 
and None, I don't think I'm breaking something.

--

___
Python tracker 

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



[issue24339] iso6937 encoding missing

2016-12-04 Thread Julien Palard

Julien Palard added the comment:

LGTM, for me it's time to release it as a package on pypi to check the adoption 
rate and see it it's worth adding it in Python and maybe close this issue.

--

___
Python tracker 

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



[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-04 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2016-12-04 Thread Jon Dufresne

New submission from Jon Dufresne:

When using unittest, I'll frequently enable -Wall to help catch code smells and 
potential bugs.

One feature of this, I'm told when files aren't explicitly closed with an error 
like: "ResourceWarning: unclosed file <...>". I've noticed this warning is 
generated for an unclosed tempfile.TemporaryFile (good), but not for an 
unclosed tempfile.NamedTemporaryFile (possible bug).

I've verified this on Python 3.5 and 3.6.

Example test:

```
import tempfile
import unittest


class MyTest(unittest.TestCase):
def test_temporary_file(self):
tempfile.TemporaryFile()

def test_named_temporary_file(self):
tempfile.NamedTemporaryFile()
```

Actual output:

```
$ Python-3.6.0b4/python --version
Python 3.6.0b4
$ Python-3.6.0b4/python -Wall -m unittest -v test
test_named_temporary_file (test.MyTest) ... ok
test_temporary_file (test.MyTest) ... /home/jon/test.py:7: ResourceWarning: 
unclosed file <_io.BufferedRandom name=3>
  tempfile.TemporaryFile()
ok

--
Ran 2 tests in 0.004s

OK

```

Expected:

I expect both tests to generate a ResourceWarning, as neither test explicitly 
closes the file.

--
components: Library (Lib)
messages: 282352
nosy: jdufresne
priority: normal
severity: normal
status: open
title: NamedTemporaryFile does not generate a ResourceWarning for unclosed 
files (unlike TemporaryFile)
type: behavior
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



[issue28866] Unexpected behavior resulting from mro() and __setattr__ in interactive mode

2016-12-04 Thread Julien Palard

Julien Palard added the comment:

FWIW, in _PyType_Lookup I see the "300" PyLong being cached, and later, just 
before the segfault, I see its address getting out of the cache (a cache hit) 
but it's no longer a PyLong, it's scrambled, so we're getting a real pointer 
with scrambled values on the line:

attribute = _PyType_Lookup(type, name);

segfaulting two lines later in:

descrgetfunc local_get = Py_TYPE(attribute)->tp_descr_get

When I write scrambled value I mean: 

(gdb) p *attribute  
   
$21 = {_ob_next = 0xdbdbdbdbdbdbdbdb, _ob_prev = 0xdbdbdbdbdbdbdbdb, 
ob_refcnt = -2604246222170760229, ob_type = 0xdbdbdbd\
bdbdbdbdb}  
   

To debug interactive session in GDB I used:

r -i weird.py < stdin

with "proxy.x" in the stdin file.

--
nosy: +mdk

___
Python tracker 

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



[issue28865] [MinGW32-x64]-PyList_Check PyDict_Check does not work

2016-12-04 Thread Mikhail

Changes by Mikhail :


Removed file: http://bugs.python.org/file45754/PyAPITests.zip

___
Python tracker 

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



[issue28865] [MinGW32-x64]-PyList_Check PyDict_Check does not work

2016-12-04 Thread Mikhail

Mikhail added the comment:

I made a small correction to the project. But the essence has not changed.


With Microsoft Visual C++ Build Tools everything is fine. But I would like to 
use the GCC.

--
Added file: http://bugs.python.org/file45755/PyAPITests.zip

___
Python tracker 

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



[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2016-12-04 Thread SilentGhost

SilentGhost added the comment:

Looking at the code it seems NamedTemporaryFile is closed on destruction of the 
object, so there is no need for ResourceWarning, because the file descriptor is 
not leaking.

You also don't need to involve unittest here. Just running python with -Wall 
would generate a warning if there is a need for one.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue28865] [MinGW32-x64]-PyList_Check PyDict_Check does not work

2016-12-04 Thread Steve Dower

Steve Dower added the comment:

Is this the fork of MinGW specially for Python? I didn't think it supported 3.5 
yet, because of the different CRT.

Also, I can't easily tell right now, but if you're using the libpython35.a 
that's included with the regular install, you might want to regenerate it. 
Nobody could agree on what tools should be used to generate it, so I picked one 
fairly blind and it may not be compatible with your tools (really it should 
just be regenerated if you want to rely on it, rather than shipping one, but 
that's where we're currently at).

--

___
Python tracker 

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



[issue25591] refactor imaplib tests

2016-12-04 Thread R. David Murray

R. David Murray added the comment:

Revised patch LGTM.  Once 3.6 is out the door I'll commit it, though you may 
need to remind me.

--
stage: patch review -> commit review
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue25591] refactor imaplib tests

2016-12-04 Thread R. David Murray

Changes by R. David Murray :


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



[issue28864] Add devnull file-like object

2016-12-04 Thread R. David Murray

R. David Murray added the comment:

Yes, in my mind open(os.devnull) is the "obvious way" to do this.

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



[issue28857] SyncManager and Main Process fail to communicate after reboot or stoping with Ctrl - C

2016-12-04 Thread R. David Murray

R. David Murray added the comment:

Hmm.  I wasn't aware that multiprocessing used anything other than semaphores 
(ie: not files in /tmp). Clearly my knowledge is not enough to understand this 
problem, I'll leave it to the multiprocessing experts.

--
nosy: +davin

___
Python tracker 

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



[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2016-12-04 Thread R. David Murray

R. David Murray added the comment:

The point of ResourceWarning it tell you when you are depending on destructors 
for cleanup, so this does look like a bug.

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



[issue28868] Python advertising BeOpen.com domain

2016-12-04 Thread rm

New submission from rm:

There is BeOpen attribution in __builtins__() call, that may confuse users and 
generate some traffic to unrelated domain.

For example:

>>> import smtplib
>>> smtplib.__builtins__
<...>
Copyright (c) 2000 BeOpen.com.
All Rights Reserved.
<...>

but beopen.com resolves to domain hosting stub page. May be this string should 
be changed to just BeOpen, or removed altogether.

--
assignee: docs@python
components: Documentation
messages: 282361
nosy: cvs-src, docs@python
priority: normal
severity: normal
status: open
title: Python advertising BeOpen.com domain
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



[issue28868] Python advertising BeOpen.com domain

2016-12-04 Thread SilentGhost

SilentGhost added the comment:

It's part of the copyright notice, just removing it is probably not an option.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2016-12-04 Thread Ivan Levkivskyi

New submission from Ivan Levkivskyi:

__module__ attribute is set differently depending on whether a metaclass is 
explicitly called or invoked in a class statement:

>>> A = ABCMeta('A', (), {})
>>> A.__module__
'abc'
>>> class B(metaclass=ABCMeta): ...
... 
>>> B.__module__
'__main__'

Documentation on data model says that "__module__ is the module name in which 
the class was defined", so that the second behaviour seems right, while the 
first behaviour seems wrong to me.

--
components: Interpreter Core
messages: 282363
nosy: levkivskyi
priority: normal
severity: normal
status: open
title: __module__ attribute is not set correctly for a class created by direct 
metaclass call
versions: 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



[issue28868] Python advertising BeOpen.com domain

2016-12-04 Thread Emanuel Barry

Emanuel Barry added the comment:

Part of the copyright notice, as SilentGhost mentioned. This can't be removed.

--
nosy: +ebarry
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



[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2016-12-04 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
type:  -> behavior

___
Python tracker 

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



[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2016-12-04 Thread Emanuel Barry

Emanuel Barry added the comment:

As a matter of fact, A.__module__ in this case is abc.ABCMeta.__module__. A 
class body creates a __module__ key, while a direct metaclass call does not.

--
nosy: +ebarry

___
Python tracker 

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



[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2016-12-04 Thread SilentGhost

SilentGhost added the comment:

> The point of ResourceWarning it tell you when you are depending on 
> destructors for cleanup
But there is an explicit call in __del__ to .close(), it's looks like intended 
behaviour and is ultimately the difference that Jon was seeing between 
NamedTemporaryFile and TemporaryFile.

--

___
Python tracker 

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



[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2016-12-04 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

> As a matter of fact, A.__module__ in this case is abc.ABCMeta.__module__. A 
> class body creates a __module__ key, while a direct metaclass call does not.

But

>>> A = ABCMeta('A', (), {})
>>> ABCMeta.__module__ = 'hi'
>>> A.__module__
'abc'
>>> ABCMeta.__module__
'hi'

This means that the __module__ is copied from metaclass (also A.__dict__ 
actually contains '__module__' key, checked in 3.6).

--

___
Python tracker 

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



[issue28866] Unexpected behavior resulting from mro() and __setattr__ in interactive mode

2016-12-04 Thread Julien Palard

Julien Palard added the comment:

I'm able to reproduce the segmentation fault outside the interactive mode, see 
attached file.

--
Added file: http://bugs.python.org/file45756/weird_without_interactive.py

___
Python tracker 

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



[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2016-12-04 Thread Emanuel Barry

Emanuel Barry added the comment:

Oh, nicely spotted! Apparently I was wrong, and it does create a key; 
defaulting to __name__.

About the original issue, I don't think it's easily possible to fix, sadly.

--

___
Python tracker 

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



[issue28858] Fastcall uses more C stack

2016-12-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d35fc6e58a70 by Victor Stinner in branch 'default':
Backed out changeset b9c9691c72c5
https://hg.python.org/cpython/rev/d35fc6e58a70

--
nosy: +python-dev

___
Python tracker 

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



[issue28858] Fastcall uses more C stack

2016-12-04 Thread STINNER Victor

STINNER Victor added the comment:

> Serhiy Storchaka reported that Python 3.6 crashs earlier than Python 3.5 on 
> calling json.dumps() when sys.setrecursionlimit() is increased.

Reference: http://bugs.python.org/issue23507#msg282190 (issue #23507).


Serhiy Storchaka: "Yes, that is why I asked you to revert your changes."

Sorry, I misunderstood your comments. So yes, my change b9c9691c72c5 introduced 
a regression. Sorry, I didn't have time before now to revert my  change. I just 
pushed the change d35fc6e58a70 which reverts b9c9691c72c5.

The question is how replacing PyObject_CallFunctionObjArgs() with 
_PyObject_CallArg1() increases the usage of the C stack. I wrote my change to 
reduce the usage of the C stack.

PyObject_CallFunctionObjArgs() allocates 5 "PyObject *", so 40 bytes, on the C 
stack. Maybe using _PyObject_CallArg1() increases the usage of C stack in the 
*caller*.


> In additional, they introduced compiler warnings.

This one was fixed by Benjamin Peterson in the issue #28855 (change 
96245d4af0ca).

--

___
Python tracker 

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



[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2016-12-04 Thread R. David Murray

R. David Murray added the comment:

__del__ is a destructor.  If the file is open when it is called, it should emit 
a ResourceWarning.

--

___
Python tracker 

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



[issue28858] Fastcall uses more C stack

2016-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Victor.

Following script includes several examples of achieving a stack overflow (most 
are real world examples or can be used in real world examples). It measures 
maximal deep for every type of recursion.

--
Added file: http://bugs.python.org/file45757/stack_overflow.py

___
Python tracker 

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



[issue28870] Refactor PyObject_CallFunctionObjArgs() and like

2016-12-04 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Following patch I wrote in attempt to decrease a stack consumption of 
PyObject_CallFunctionObjArgs(), PyObject_CallMethodObjArgs() and 
_PyObject_CallMethodIdObjArgs(). But it doesn't affect a stack consumption. I 
still didn't measured what performance effect it has. Seems it makes a code a 
little cleaner.

--
components: Interpreter Core
files: PyObject_CallFunctionObjArgs.patch
keywords: patch
messages: 282374
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Refactor PyObject_CallFunctionObjArgs() and like
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45758/PyObject_CallFunctionObjArgs.patch

___
Python tracker 

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



[issue28866] Unexpected behavior resulting from mro() and __setattr__ in interactive mode

2016-12-04 Thread Julien Palard

Julien Palard added the comment:

Problem looks mainly due to the __setattr__ done on a different type than the 
getattr, and the cache of PyType_Lookup:

 - type_setattro will be called with Foo, "x", and the value to set
 - type_getattro will be called with FooProxy, "x"

The timeline (with my weird_without_interactive.py) is:

 - type_setattro is called on Foo for attr "x" with the instance of Bar
 - type_getattro is called on FooProxy for attr "x" (the `proxy.x` line)
 During this type_getattro, the instance of Bar is cached in PyType_Lookup 
for (FooProxy, "x")
 - type_setattro is called on Foo for attr "x" with the value 0
 During this call, insertdict will legitimately call DECREF on the Bar 
instance, which is deleted
 - type_getattro is called on FooProxy with attr "x" for the print()
 During this call, PyType_Lookup will cache hit for (FooProxy, x) with the 
old reference to the instance of Bar

--

___
Python tracker 

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



[issue28871] Destructor of ElementTree.Element is recursive

2016-12-04 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The Element class in the xml.etree.ElementTree module is a collection. It can 
contain other Element's. But unlike to common Python collections (list, dict, 
etc) and pure Python classes, C implementation of Element doesn't support 
unlimited recursion. As result, destroying very deep Element tree can cause 
stack overflow. Example:

import xml.etree.cElementTree as ElementTree
y = x = ElementTree.Element('x')
for i in range(20): y = ElementTree.SubElement(y, 'x')

del x

--
components: Extension Modules
messages: 282376
nosy: eli.bendersky, scoder, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Destructor of ElementTree.Element is recursive
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



[issue28858] Fastcall uses more C stack

2016-12-04 Thread STINNER Victor

STINNER Victor added the comment:

When I wrote the _PyObject_CallArg1(), it looks as a cool hack:

#define _PyObject_CallArg1(func, arg) \
_PyObject_FastCall((func), (PyObject **)&(arg), 1)

It hacks the declaration of an explicit "stack" like:

   PyObject *stack[1];
   stack[0] = arg;
   res = _PyObject_FastCall(func, stack, 1);

And I expected that the C compiler magically computes the memory address of the 
argument. But it seems like requesting the memory address of an argument 
allocates something on the C stack.

On x86_64, first function arguments are passed with CPU registers. Maybe 
requesting the memory address of an argument requires to allocate a local 
variable, copy the register into the variable, to get the address of the local 
variable?

So, I suggest to *remove* the _PyObject_CallArg1() macro, and use existing 
functions like PyObject_CallFunctionObjArgs().

What do you think Serhiy?

--

___
Python tracker 

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



[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2016-12-04 Thread Steven D'Aprano

Steven D'Aprano added the comment:

I had a brief look at the source for ABCMeta, and it seems to me that the 
__module__ behaviour is coming from `type`. I'm not sure whether it can, or 
should, can be fixed in type, but I think that the correct behaviour for 
ABCMeta is to set __module__ to the caller's global "__name__", not its own.

Something like this should probably work:


class ABCMeta(type):
def __new__(mcls, name, bases, namespace):
if '__module__' not in namespace:
# globals()['__name__'] gives 'abc'
frame = inspect.currentframe()
if frame is not None:
# IronPython? 
caller_globals = frame.f_back.f_globals
namespace['__module__'] = caller_globals['__name__']
cls = super().__new__(mcls, name, bases, namespace)
...

--
nosy: +steven.daprano

___
Python tracker 

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



[issue28870] Refactor PyObject_CallFunctionObjArgs() and like

2016-12-04 Thread STINNER Victor

STINNER Victor added the comment:

What do you think of using alloca() instead of an "PyObject *small_stack[5];" 
which has a fixed size?

Note: About your patch, try to avoid _PyObject_CallArg1() if you care of the 
usage of the C stack, see issue #28858.

--

___
Python tracker 

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



[issue28870] Refactor PyObject_CallFunctionObjArgs() and like

2016-12-04 Thread STINNER Victor

STINNER Victor added the comment:

> But it doesn't affect a stack consumption.

How do you check the stack consumption of PyObject_CallFunctionObjArgs()?

--

___
Python tracker 

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



[issue28854] FIPS mode causes dead-lock in ssl module

2016-12-04 Thread Christian Heimes

Christian Heimes added the comment:

It was a downstream bug in Fedora. Tomas Mraz has fixed the issue and will 
release openssl-1.0.2j-3 soon, 
https://bugzilla.redhat.com/show_bug.cgi?id=1400922

--
resolution:  -> third party
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



[issue28864] Add devnull file-like object

2016-12-04 Thread Martin Panter

Martin Panter added the comment:

If you only need the readable interface, use BytesIO or StringIO.

I once had an implementation like Serhiy’s, called dummywriter: 
. To fully 
implement the writable file API it should also implement writable(), and 
write() should return the size of its argument.

Implementing this without opening a real file descriptor is slightly easier to 
manage (no need to worry about closing it, and no problem sharing instances or 
creating many copies). I don’t have a strong opinion about including it in the 
builtin library though, since it is pretty easy to implement the basics 
yourself.

I doubt anyone would need a readable and writable object, i.e. open(devnull, 
"r+"). On the other hand, it is occasionally useful to know how many bytes were 
written in total, so implementing tell() etc could be useful. (Linux’s 
/dev/null doesn’t work that way though; I find it always returns zero.)

--
nosy: +martin.panter

___
Python tracker 

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



[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-04 Thread Nick Coghlan

Nick Coghlan added the comment:

I've hit a problem where test_builtin and test_unittest are failing for me when 
refleak hunting is enabled (as in actual test failures, not just leak reports), 
but those also appear for me without the patch applied.

Current plan:

- ensure "./python -m test -R 3:3 -x test_builtin test_unittest" is clean both 
with and without the patch (perhaps also removing some other tests that are 
unreliable even without the patch)
- file a separate issue for the refleak hunting problem with the error 
tracebacks
- push the fix for the __classcell__ problems to 3.6

--

___
Python tracker 

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



[issue28870] Refactor PyObject_CallFunctionObjArgs() and like

2016-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> What do you think of using alloca() instead of an "PyObject *small_stack[5];" 
> which has a fixed size?

alloca() is not in POSIX.1. I afraid it would make CPython less portable.

> Note: About your patch, try to avoid _PyObject_CallArg1() if you care of the 
> usage of the C stack, see issue #28858.

I don't understand how can I avoid it.

> How do you check the stack consumption of PyObject_CallFunctionObjArgs()?

Using a script from issue28858.

--

___
Python tracker 

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



[issue28858] Fastcall uses more C stack

2016-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

That was my initial preference. Mainly because this doesn't add code churn.

But I don't understand how PyObject_CallFunctionObjArgs() that uses 
_PyObject_CallArg1() and has many local variables can consume less stack than 
_PyObject_CallArg1() itself.

--

___
Python tracker 

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



[issue28596] on Android _bootlocale on startup relies on too many library modules

2016-12-04 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Thanks Victor. Here's new patch, which uses hasattr

--
Added file: http://bugs.python.org/file45759/android-locale-utf8.patch

___
Python tracker 

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



[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e33245800f1a by Nick Coghlan in branch '3.6':
Issue #23722: improve __classcell__ compatibility
https://hg.python.org/cpython/rev/e33245800f1a

New changeset 9e5bc3d38de8 by Nick Coghlan in branch 'default':
Merge #23722 from 3.6
https://hg.python.org/cpython/rev/9e5bc3d38de8

--

___
Python tracker 

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



[issue27050] Demote run() below the high level APIs in subprocess docs

2016-12-04 Thread Nick Coghlan

Nick Coghlan added the comment:

I've switched to using Vinay Sajip's "sarge" for my own subprocess invocation 
needs, which uses a similar all-in-one "run" API (albeit quite a different 
approach to capturing output).

Accordingly, I don't think there's anything useful to be done specifically in 
the context of this issue - any energy that might be spent here would likely be 
spent more constructively on things like making the pipe encoding easier to 
configure, or reducing the risk of deadlocks due to OS-level buffer size limits.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue28872] test_builtin failures when refleak hunting

2016-12-04 Thread Nick Coghlan

New submission from Nick Coghlan:

test_builtin currently fails for me when hunting refleaks (Fedora 25):

$ ./python -m test -R 3:3 -v test_builtin

[snip]

==
FAIL: test_input_tty_non_ascii (test.test_builtin.PtyTests)
--
Traceback (most recent call last):
  File "/home/ncoghlan/devel/py36/Lib/test/test_builtin.py", line 1592, in 
test_input_tty_non_ascii
self.check_input_tty("prompté", b"quux\xe9", "utf-8")
  File "/home/ncoghlan/devel/py36/Lib/test/test_builtin.py", line 1583, in 
check_input_tty
self.assertEqual(input_result, expected)
AssertionError: 'quux' != 'quux\udce9'
- quux
+ quux\udce9
? +


==
FAIL: test_input_tty_non_ascii_unicode_errors (test.test_builtin.PtyTests)
--
Traceback (most recent call last):
  File "/home/ncoghlan/devel/py36/Lib/test/test_builtin.py", line 1596, in 
test_input_tty_non_ascii_unicode_errors
self.check_input_tty("prompté", b"quux\xe9", "ascii")
  File "/home/ncoghlan/devel/py36/Lib/test/test_builtin.py", line 1583, in 
check_input_tty
self.assertEqual(input_result, expected)
AssertionError: 'quux' != 'quux\udce9'
- quux
+ quux\udce9
? +


--
Ran 78 tests in 0.066s

FAILED (failures=2)

--
messages: 282389
nosy: ncoghlan, ned.deily
priority: normal
severity: normal
stage: needs patch
status: open
title: test_builtin failures when refleak hunting
type: behavior
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



[issue28873] test_unittest failures when refleak hunting

2016-12-04 Thread Nick Coghlan

New submission from Nick Coghlan:

test_unittest currently fails for me when hunting refleaks (Fedora 25):

$ ./python -m test -R 3:3 -v test_unittest

==
ERROR: test_discover_with_init_module_that_raises_SkipTest_on_import 
(unittest.test.test_discovery.TestDiscovery)
--
Traceback (most recent call last):
  File "/home/ncoghlan/devel/py36/Lib/unittest/test/test_discovery.py", line 
572, in test_discover_with_init_module_that_raises_SkipTest_on_import
pickle.loads(pickle.dumps(suite, proto))
_pickle.PicklingError: Can't pickle : 
attribute lookup ModuleSkipped on unittest.loader failed

==
ERROR: test_discover_with_module_that_raises_SkipTest_on_import 
(unittest.test.test_discovery.TestDiscovery)
--
Traceback (most recent call last):
  File "/home/ncoghlan/devel/py36/Lib/unittest/test/test_discovery.py", line 
548, in test_discover_with_module_that_raises_SkipTest_on_import
pickle.loads(pickle.dumps(suite, proto))
_pickle.PicklingError: Can't pickle : 
attribute lookup ModuleSkipped on unittest.loader failed

--
Ran 715 tests in 1.898s

FAILED (errors=2, skipped=7)

--
messages: 282390
nosy: ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: test_unittest failures when refleak hunting
type: behavior
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



[issue28873] test_unittest failures when refleak hunting

2016-12-04 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ned.deily

___
Python tracker 

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



[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-04 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks for the reviews Serhiy! The patch as merged addressed both your comments 
on the docs (including adding several new index entries) as well as the last 
couple of style comments on the code changes.

I've filed separate issues for the test failures I'm seeing when refleak 
hunting:

* test_builtin: http://bugs.python.org/issue28872
* test_unittest: http://bugs.python.org/issue28873

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



[issue28872] test_builtin failures when refleak hunting

2016-12-04 Thread Nick Coghlan

Nick Coghlan added the comment:

Ned, I'm not sure if this should be a release blocker or not.

Superficially, it looks like it's just a test bug arising from running the test 
multiple times in the same process, but I unfortunately don't have time to 
investigate further today.

--
assignee:  -> ned.deily

___
Python tracker 

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



[issue28873] test_unittest failures when refleak hunting

2016-12-04 Thread Nick Coghlan

Nick Coghlan added the comment:

Ned, I'm not sure if this should be a release blocker or not.

Superficially, it looks like it's just a test bug arising from running the test 
multiple times in the same process, but I unfortunately don't have time to 
investigate further today.

--
assignee:  -> ned.deily

___
Python tracker 

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



[issue28873] test_unittest failures when refleak hunting

2016-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a duplicate of issue25746.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
superseder:  -> test_unittest failure in leaks searching mode

___
Python tracker 

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



[issue28872] test_builtin failures when refleak hunting

2016-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a duplicate of issue13886.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
superseder:  -> readline-related test_builtin failure

___
Python tracker 

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



[issue28874] test_logging fails

2016-12-04 Thread Whitequill Riclo

New submission from Whitequill Riclo:

while testing my build of cpython it hangs on test 198/404 and will not 
continue unless interrupted with ctrl-C.

the build is fairly sound, but I can't test anything after test 198/404 cause 
it gets stuck.

--
components: Tests
files: cpython-testlogging.log
hgrepos: 364
messages: 282396
nosy: Whitequill Riclo
priority: normal
severity: normal
status: open
title: test_logging fails
versions: Python 3.7
Added file: http://bugs.python.org/file45760/cpython-testlogging.log

___
Python tracker 

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



[issue28875] test fails and freezes

2016-12-04 Thread Whitequill Riclo

New submission from Whitequill Riclo:

while testing my build of cpython it hangs on test 198/404 and will not 
continue unless interrupted with ctrl-C.

the build is fairly sound, but I can't test anything after test 198/404 cause 
it gets stuck.

--
components: Tests
files: cpython-testlogging.log
hgrepos: 365
messages: 282397
nosy: Whitequill Riclo
priority: normal
severity: normal
status: open
title: test fails and freezes
type: behavior
versions: Python 3.7
Added file: http://bugs.python.org/file45761/cpython-testlogging.log

___
Python tracker 

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



[issue28875] test fails and freezes

2016-12-04 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> test_logging fails

___
Python tracker 

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



[issue28874] test_logging fails and freezes

2016-12-04 Thread Martin Panter

Changes by Martin Panter :


--
title: test_logging fails -> test_logging fails and freezes
type:  -> behavior

___
Python tracker 

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