[issue33460] "..." is used to confusingly indicate many different things in chapter 3

2018-11-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue15245] ast.literal_eval fails on some literals

2018-11-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

ast.literal_eval('...') works in 3.8.

The question is should we make it working in older versions?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35166] BUILD_MAP_UNPACK doesn't function as expected for dict subclasses

2018-11-04 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

How weird... after restarting the interpreter, I can't reproduce that 
TypeError. I get the AssertionError Serhiy showed.

--

___
Python tracker 

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



[issue35166] BUILD_MAP_UNPACK doesn't function as expected for dict subclasses

2018-11-04 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

You say it doesn't work as expected, but you don't say what you expect or why. 
(Don't make me guess what you mean -- explicit is better than implicit.)

When I try your subclass in 3.6, I get an unexpected TypeError:

py> class Dict(dict):
... def keys(self): assert 0
... def update(*args, **kwds): assert 0
... def __getitem__(self, key): assert 0
... def __iter__(self): assert 0
...
py> {**Dict(a=1)}
{'a': 1}
py> Dict(a=1).keys()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in keys
TypeError

--
nosy: +steven.daprano

___
Python tracker 

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



[issue35166] BUILD_MAP_UNPACK doesn't function as expected for dict subclasses

2018-11-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in keys
AssertionError

This works as expected to me.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35166] BUILD_MAP_UNPACK doesn't function as expected for dict subclasses

2018-11-04 Thread Dan Snider


New submission from Dan Snider :

>>> class Dict(dict):
   
def keys(self): assert 0
def update(*args, **kwds): assert 0
def __getitem__(self, key): assert 0
def __iter__(self): assert 0 


>>> {**Dict(a=1)}
{'a': 1}

The opcode uses PyDict_Update, which calls the internal dict_merge function 
which contains the following line:

if (PyDict_Check(b) && (Py_TYPE(b)->tp_iter == (getiterfunc)dict_iter))

Translated to Python, that should be equal to 

if type(b).__flags__ & (1<<29) and type.__getattribute__(type(b), 
'__iter__') is type.__getattribute__(dict, '__iter__')`

Both that and the line in C evaluate to false for me (while a dict subclass 
that doesn't override __iter__ evaluates to true), so I 
 apparently can't help narrow down the problem any further assuming people 
agree that this is even is a problem...

The BUILD_MAP_UNPACK_WITH_CALL, CALL_FUNCTION_EX, and CALL_FUNCTION_KW opcodes 
are affected as well.

--
components: Interpreter Core
messages: 329280
nosy: bup
priority: normal
severity: normal
status: open
title: BUILD_MAP_UNPACK doesn't function as expected for dict subclasses
type: behavior
versions: 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



[issue10536] Enhancements to gettext docs

2018-11-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think it is worth to enhance documentation for other versions too. See also 
my comments on GitHub.

--

___
Python tracker 

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



[issue9842] Document ... used in recursive repr of containers

2018-11-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 10330 adds few references for using an ellipsis as a placeholder.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue9842] Document ... used in recursive repr of containers

2018-11-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9634

___
Python tracker 

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



[issue29183] Unintuitive error handling in wsgiref when a crash happens in write() or close()

2018-11-04 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

This may or may not be the same as what you're suggesting, Martin. But is 
another option to make close() a no-op if it is called a second time? 
Otherwise, it seems we'd need to make sure that no code path can result in 
close() being called twice (even during exception handling, etc).

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2018-11-04 Thread Jonathan Gossage


Change by Jonathan Gossage :


--
pull_requests: +9633

___
Python tracker 

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



[issue35018] Sax parser provides no user access to lexical handlers

2018-11-04 Thread Jonathan Gossage


Change by Jonathan Gossage :


--
keywords: +patch
pull_requests: +9631
stage:  -> patch review

___
Python tracker 

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



[issue6686] xml.sax.xmlreader.XMLReader.getProperty (xml.sax.handler.property_xml_string) returns bytes

2018-11-04 Thread Jonathan Gossage


Change by Jonathan Gossage :


--
pull_requests: +9632

___
Python tracker 

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



[issue32285] In `unicodedata`, it should be possible to check a unistr's normal form without necessarily copying it

2018-11-04 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 2810dd7be9876236f74ac80716d113572c9098dd by Benjamin Peterson 
(Max Bélanger) in branch 'master':
closes bpo-32285: Add unicodedata.is_normalized. (GH-4806)
https://github.com/python/cpython/commit/2810dd7be9876236f74ac80716d113572c9098dd


--
nosy: +benjamin.peterson
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



[issue34022] 6 tests fail using SOURCE_DATE_EPOCH env var

2018-11-04 Thread Elvis Pranskevichus


Elvis Pranskevichus  added the comment:

https://github.com/python/cpython/pull/10327 fixes the remaining test failures.

--

___
Python tracker 

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



[issue34022] 6 tests fail using SOURCE_DATE_EPOCH env var

2018-11-04 Thread Elvis Pranskevichus


Change by Elvis Pranskevichus :


--
pull_requests: +9630

___
Python tracker 

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



[issue35165] Possible wrong method name in attribute references doc

2018-11-04 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

https://docs.python.org/3/reference/expressions.html#attribute-references

__getattr__ is the correct method to override in most (but not all) cases. I 
don't think we should encourage people to override __getattribute__ as the 
first resort.

__getattribute__ is a more specialised method that is used by the interpreter 
at a deeper level. It is called on every attribute access, so it ought to be as 
fast as possible, while __getattr__ is only called if the named attribute 
doesn't exist.

I don't think anything needs to change here.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue19675] Pool dies with excessive workers, but does not cleanup

2018-11-04 Thread ppperry


Change by ppperry :


--
nosy:  -ppperry

___
Python tracker 

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



[issue19675] Pool dies with excessive workers, but does not cleanup

2018-11-04 Thread Julien Palard


Julien Palard  added the comment:


New changeset 5d236cafd7126e640fb25541fcc7e0a494450143 by Julien Palard in 
branch 'master':
bpo-19675: Terminate processes if construction of a pool is failing. (GH-5614)
https://github.com/python/cpython/commit/5d236cafd7126e640fb25541fcc7e0a494450143


--
nosy: +mdk

___
Python tracker 

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



[issue9842] Document ... used in recursive repr of containers

2018-11-04 Thread miss-islington


miss-islington  added the comment:


New changeset b4db249c9544fc4425c32feb86d610f3224ca3d8 by Miss Islington (bot) 
(Pablo Galindo) in branch 'master':
bpo-9842: Add cross-reference to the ellipsis object (GH-4063)
https://github.com/python/cpython/commit/b4db249c9544fc4425c32feb86d610f3224ca3d8


--
nosy: +miss-islington

___
Python tracker 

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



[issue35118] Add peek() or first() method in queue

2018-11-04 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue35118] Add peek() or first() method in queue

2018-11-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 98b85354153883b0a080f678f213729cd0764fee by Raymond Hettinger 
(Windson yang) in branch 'master':
bpo-35118: Improve docs regarding indexing (GH-10265)
https://github.com/python/cpython/commit/98b85354153883b0a080f678f213729cd0764fee


--

___
Python tracker 

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



[issue10536] Enhancements to gettext docs

2018-11-04 Thread Julien Palard


Change by Julien Palard :


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



[issue10536] Enhancements to gettext docs

2018-11-04 Thread Julien Palard

Julien Palard  added the comment:


New changeset 55f3317e984cc35bd18ba0326ed98766a2750ffd by Julien Palard 
(Stéphane Wirtel) in branch 'master':
bpo-10536: Enhancements to gettext docs (GH-10324)
https://github.com/python/cpython/commit/55f3317e984cc35bd18ba0326ed98766a2750ffd


--
nosy: +mdk

___
Python tracker 

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



[issue35034] Add closing and iteration to threading.Queue

2018-11-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I've put some more thought into this and have discussed it with another core 
developer.  While the idea was inspired, I think we should decline the API 
expansion.

When I last talked with Guido about this module, he opined that he didn't want 
to module to get further into the business of moderating between the producer 
and consumer, that it should focus on its core task of being a one-way 
thread-safe message queue.  

I agree that users do craft various ways of communicating via sentinel objects; 
however, there is no one pattern that dominates so much that it warrants 
deforming the API to accommodate.  FWIW, I use email as the basis for my mental 
model of how Queue is used.  With email, we don't don't need a special part of 
the API to communicate that we're not going to send messages any more; instead, 
we either stop sending messages or send a farewell message.

Of the two ideas, making queues iterable is more plausible.  However, it 
doesn't fit will common ways of using a queue.  For non-blocking queues it 
makes zero sense.  For daemon threads that block until sent a message, the 
usual pattern is while True loop that blocks on a get().  In such a case, a 
for-loop might be more compact but doesn't reflect how we think about the 
problem (implying that the loop may terminate and it  obscures that the get() 
is what is actually blocking).

Sorry for taking a while to evaluate this.  I looked at the effort you put in 
to the patch and wanted to really think it through.  This idea is inspired, but 
in the end I don't think it is a good fit for how people typically use the 
Queue module (or its cousin in the Multiprocessing module).

Do consider posting a queue variant to the Python Package Index.  Though not 
for all users, there may well be some uptake for a few users.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue31887] docs for email.generator are missing a comment on special multipart/signed handling

2018-11-04 Thread miss-islington


miss-islington  added the comment:


New changeset 622935d9a69d12e125e470ce9a9ff3cad9e8e296 by Miss Islington (bot) 
(Saptak Sengupta) in branch 'master':
bpo-31887: Adds documentations for special multipart/signed handling (GH-4268)
https://github.com/python/cpython/commit/622935d9a69d12e125e470ce9a9ff3cad9e8e296


--
nosy: +miss-islington

___
Python tracker 

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



[issue31873] Inconsistent capitalization of proper noun - Unicode.

2018-11-04 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

If you want to do this correctly, you have to check each case:

* if "unicode object" refers to a C PyUnicode object, it's probably better to 
use "PyUnicode object"
* if "unicode object" refers to a C PyObject object, with type "unicode", it's 
probably better to leave it as is
* if "unicode object" refers to a Python unicode object, it's probably better 
to call it "Unicode string object" or just "string object" in Python 3
* if "unicode object" does not indicate whether Python or C is meant, "Unicode 
object" is probably better

--

___
Python tracker 

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



[issue30999] statistics module: add "key" keyword argument to median, mode, ...

2018-11-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This issue (as originally proposed) should be closed.  A key function for 
median() and mode() likely isn't a good idea.  Those two functions should be 
kept parallel with mean() as returning simple descriptive statistics.  

Work towards a select() function with a key function can be pursued in a 
separate tracker item.  That would suffice to locate a specific record 
occurring at a median (or quartile or decile).  FWIW, that is how MS Excel 
approaches the problem as well (using RANK with INDEX to locate a record by its 
sort position, leaving AVERAGE, MODE.SNGL, and MEDIAN for straight descriptive 
statistics).

--

___
Python tracker 

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



[issue24916] In sysconfig, don't rely on sys.version format

2018-11-04 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Following up on 
https://github.com/python/cpython/pull/10321#discussion_r230604393 I would like 
to summarise here what's been going on, in order to move the discussion here 
forward. I've tried to make a PR for this issue, in which _PY_VERSION in 
Lib/sysconfig.py and py_version in Lib/distutils/command/install.py are updated 
to get their value from sys.version_info instead of sys.version. This PR 
removes the '+' from both so the issue remains, if we want to keep the '+' info 
or not.

--

___
Python tracker 

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



[issue31873] Inconsistent capitalization of proper noun - Unicode.

2018-11-04 Thread Julien Palard


Julien Palard  added the comment:

Currently in our documentation there's 89 "Unicode obj" vs 8 "unicode obj" so 
I'll go for it.

--
nosy: +mdk

___
Python tracker 

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



[issue21263] test_gdb failures on os x 10.9.2

2018-11-04 Thread Ned Deily


Ned Deily  added the comment:

Thanks, everyone! Fixed for 3.8.0, 3.7.2, and 3.6.8.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.5

___
Python tracker 

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



[issue21263] test_gdb failures on os x 10.9.2

2018-11-04 Thread Ned Deily


Ned Deily  added the comment:


New changeset f574ce79729ecb01f1f5b3e1a34c8aa7480b79e8 by Ned Deily (Miss 
Islington (bot)) in branch '3.6':
bpo-21263: Skip test_gdb when python has been compiled with LLVM clang 
(GH-10318) (GH-10326)
https://github.com/python/cpython/commit/f574ce79729ecb01f1f5b3e1a34c8aa7480b79e8


--

___
Python tracker 

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



[issue21263] test_gdb failures on os x 10.9.2

2018-11-04 Thread Ned Deily


Ned Deily  added the comment:


New changeset 96fb350bfd2c9b66d7804ae27ea8c4adbfabad5b by Ned Deily (Miss 
Islington (bot)) in branch '3.7':
bpo-21263: Skip test_gdb when python has been compiled with LLVM clang 
(GH-10318) (GH-10325)
https://github.com/python/cpython/commit/96fb350bfd2c9b66d7804ae27ea8c4adbfabad5b


--

___
Python tracker 

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



[issue25410] Clean up and fix OrderedDict

2018-11-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Maybe it's considered undefined behavior for a subclass to use 
> a method of one of its bases which it has overriden.

In general, it's true that if OrderedDict is a subclass of dict, then it would 
have no defense against someone making a direct call to the dict base class.  
Such a call should be expected to violate the OrderedDicts invariants.

> it's a complete coin toss on whether one of the many internal
> API function will set an attribute or name via PyDict_SetItem 
> or PyObject_SetItem. 

Not really.  The CPython source is supposed to only call PyDict_SetItem when 
the target is known to be an exact dictionary.  If you find a case where that 
isn't true, please file a bug report and we'll fix it.

> It might be more appropriate to start a new issue for this, but I'll > leave 
> that decision to somehow who would know for sure.

No need.  We've known about this sort of problem for years.  See 
https://bugs.python.org/issue10977 for example.  There isn't really much we 
could do about it without causing other issues that would be worse.

FWIW, this doesn't seem to be a problem in practice.  Further, OrderedDict is 
expected to become less relevant now that regular dicts are order preserving.

--

___
Python tracker 

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



[issue21263] test_gdb failures on os x 10.9.2

2018-11-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9629

___
Python tracker 

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



[issue21263] test_gdb failures on os x 10.9.2

2018-11-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9628

___
Python tracker 

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



[issue21263] test_gdb failures on os x 10.9.2

2018-11-04 Thread Ned Deily


Ned Deily  added the comment:


New changeset 59668aa8b7f174b59304eab833c1c1181886c3c6 by Ned Deily (Lysandros 
Nikolaou) in branch 'master':
bpo-21263: Skip test_gdb when python has been compiled with LLVM clang 
(GH-10318)
https://github.com/python/cpython/commit/59668aa8b7f174b59304eab833c1c1181886c3c6


--

___
Python tracker 

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



[issue10536] Enhancements to gettext docs

2018-11-04 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
versions: +Python 3.8

___
Python tracker 

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



[issue10536] Enhancements to gettext docs

2018-11-04 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Serhiy & Éric, I have ported the patch to a PR for master (3.8).

I have removed the double spaces and some useless diffs. You will find my diff 
file I have used for the PR.
 
the git revision was 5d744a8855bb4d411e5f32cfd365f0581e30ef48

Author: Stefan Krah 
Date:   Fri Nov 26 11:07:04 2010 +

Merged revisions 86791 via svnmerge from
svn+ssh://python...@svn.python.org/python/branches/py3k


  r86791 | stefan.krah | 2010-11-26 11:54:09 +0100 (Fri, 26 Nov 2010) | 1 
line

  Indentation cleanup.

--
Added file: https://bugs.python.org/file47904/bpo-10536.diff

___
Python tracker 

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



[issue10536] Enhancements to gettext docs

2018-11-04 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
pull_requests: +9627

___
Python tracker 

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



[issue35159] Add a link to the devguide in the sidebar of the documentation

2018-11-04 Thread Julien Palard


Change by Julien Palard :


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



[issue35159] Add a link to the devguide in the sidebar of the documentation

2018-11-04 Thread Julien Palard

Julien Palard  added the comment:


New changeset 0edc7b1b1a2b22d4d200f80995454d01927bf93e by Julien Palard 
(Stéphane Wirtel) in branch 'master':
bpo-35159: Add a link to the devguide in the sidebar of the index (Doc/) 
(GH-10316)
https://github.com/python/cpython/commit/0edc7b1b1a2b22d4d200f80995454d01927bf93e


--

___
Python tracker 

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



[issue35154] subprocess.list2cmdline() does not allow running some commands.

2018-11-04 Thread Eryk Sun


Eryk Sun  added the comment:

> he himself puts double quotes or calls CommandLineToArgvW

CommandLineToArgvW has nothing to do with creating a command line for use with 
CreateProcess. It's used by a process to parse its own command line using the 
common VC++ rules.

> subprocess.list2cmdline() is always called

No, it's only called for an args sequence, not a command-line string. If you 
have your own function to convert a sequence to a command-line, then call it 
explicitly, e.g. subprocess.run(mylist2cmdline(args)).

--

___
Python tracker 

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



[issue30533] missing feature in inspect module: getmembers_static

2018-11-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

+1 from me too. issue35108 could help from this implementation where properties 
execute code that might cause runtime exception. Initially I tried using 
getattr_static inside getmembers at msg329254 but I think a separate function 
or an option to use getattr_static only in getmembers is more clean.

Bumping the version to 3.8.

Thanks!

--
nosy: +xtreak
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue35108] inspect.getmembers passes exceptions from object's properties through

2018-11-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

There are some relevant docs in the inspect module about properties triggering 
code execution and thus using getattr_static to fetch attributes. Ref : 
https://docs.python.org/3/library/inspect.html#fetching-attributes-statically . 
I tried the below and it passes for your code but there might be still cases 
where getattr_static triggers an exception too where we need to decide whether 
to skip the attribute from being listed and if so with a test for the scenario.

Using getattr_static first causes 
test_inspect.TestPredicates.test_get_slot_members to fail by including 
slot_member. Thus we try for getattr and if it raises an exception that is not 
AttributeError (@property might also raise AttributeError consciously at 
runtime) and then use getattr_static in case of exception other than 
AttributeError. This helps in passing the test suite and also the example 
attached listing bar which raises NotImplementedError or other Exceptions.


diff --git a/Lib/inspect.py b/Lib/inspect.py
index b8a142232b..9df2173e0c 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -341,7 +341,12 @@ def getmembers(object, predicate=None):
 # like calling their __get__ (see bug #1785), so fall back to
 # looking in the __dict__.
 try:
-value = getattr(object, key)
+try:
+value = getattr(object, key)
+except Exception as e:
+if isinstance(e, AttributeError):
+raise e
+value = getattr_static(object, key)
 # handle the duplicate key
 if key in processed:
 raise AttributeError


I am adding Yury. Removing 3.5 and 3.4 since they are in security fixes only 
mode.

Also see issue30533 a proposal for implementation of getmembers that uses 
getattr_static instead of getattr.


Thanks

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



[issue35154] subprocess.list2cmdline() does not allow running some commands.

2018-11-04 Thread Roffild


Roffild  added the comment:

Yes, the string with spaces must be enclosed in double quotes. But when a 
programmer calls CreateProcess(), he himself puts double quotes or calls 
CommandLineToArgvW().

subprocess.list2cmdline() is always called and can spoil the launch string.

I propose to add an additional argument list2cmdline=False in subprocess.run() 
to disable this function.

subprocess.run(['"program path"', '/param="space space"'], list2cmdline=False)

subprocess.run('"program path" /param="space space"', list2cmdline=False)

--

___
Python tracker 

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



[issue10536] Enhancements to gettext docs

2018-11-04 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Serhyi and Eric, for which version of Python, only 2.7? or master, 3.6 & 3.7?

--
nosy: +matrixise

___
Python tracker 

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



[issue10536] Enhancements to gettext docs

2018-11-04 Thread Éric Araujo

Éric Araujo  added the comment:

I will try to find some time in the next month!

--

___
Python tracker 

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



[issue33486] regen autotools related files

2018-11-04 Thread Ned Deily


Change by Ned Deily :


--
pull_requests:  -9626

___
Python tracker 

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



[issue33486] regen autotools related files

2018-11-04 Thread Ned Deily


Change by Ned Deily :


--
stage: patch review -> commit review

___
Python tracker 

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



[issue33486] regen autotools related files

2018-11-04 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
pull_requests: +9626
stage: commit review -> patch review

___
Python tracker 

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



[issue33486] regen autotools related files

2018-11-04 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi Ned, thanks for this clarification

--
nosy: +matrixise

___
Python tracker 

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



[issue33486] regen autotools related files

2018-11-04 Thread Ned Deily


Change by Ned Deily :


--
resolution: fixed -> 
stage: resolved -> commit review

___
Python tracker 

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



[issue33486] regen autotools related files

2018-11-04 Thread Ned Deily


Ned Deily  added the comment:

If we are going to bump the tools version from 2.65 to 2.69 for master, we 
should probably bump them for all active branches.  It creates confusion and 
makes backporting more difficult.  Besides, it appears that, at the moment, the 
checked-in configure files for 3.7, 3.6, and 2.7 were all generated with 2.69 
anyway :)  if doing so, the reference to 2.65 in the devguide setup.rst should 
also be updated.

--
status: closed -> open
versions: +Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue35119] Customizing module attribute access example raises RecursionError

2018-11-04 Thread Denis Osipov


Change by Denis Osipov :


--
keywords: +patch
pull_requests: +9625
stage: needs patch -> patch review

___
Python tracker 

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



[issue35163] locale: setlocale(..., 'eo') sets non-existing locale

2018-11-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +lemburg

___
Python tracker 

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



[issue27682] wsgiref BaseHandler / SimpleHandler can raise additional errors when handling an error

2018-11-04 Thread Petter S


Petter S  added the comment:

> I think this is what Petter is trying to do in 
> .

That's right.

--

___
Python tracker 

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



[issue35157] Missing pyconfig.h when building from source and pgo flag is enabled

2018-11-04 Thread Jorge Ramos

Jorge Ramos  added the comment:

Hello: I followed the same command: PCBuild\build.bat -d -p x64 -r --pgo and in 
summary, it found 5 errors (the last part of this messages contains the 
PGInstrument|x64 interpreter verbose). I include a number between parenthesis 
to show the test number:


***
test_distutils failed in 43 sec 783 ms  (107)
test_httpservers failed (171)
test_platform failed(246)
test_regrtest failed in 1 min 36 sec(273)
test_sysconfig failed   (330)
***
 
And for the sake of completeness I also runh the command "python.exe -m 
test.pythoninfo" which basically gave the same results as yours. But my problem 
is not with the exixting python installation but at compile time when using PGO.



***
Running PGInstrument|x64 interpreter...
Run tests sequentially
0:00:00 [  1/407] test_grammar
0:00:00 [  2/407] test_opcodes
0:00:00 [  3/407] test_dict
0:00:01 [  4/407] test_builtin
0:00:02 [  5/407] test_exceptions
0:00:10 [  6/407] test_types
0:00:11 [  7/407] test_unittest
0:00:18 [  8/407] test_doctest
0:00:25 [  9/407] test_doctest2
0:00:26 [ 10/407] test_support
0:00:26 [ 11/407] test___all__
0:00:33 [ 12/407] test___future__
0:00:33 [ 13/407] test__locale
0:00:33 [ 14/407] test__opcode
0:00:33 [ 15/407] test__osx_support
0:00:33 [ 16/407] test_abc
0:00:34 [ 17/407] test_abstract_numbers
0:00:34 [ 18/407] test_aifc
0:00:35 [ 19/407] test_argparse
0:00:41 [ 20/407] test_array
0:00:46 [ 21/407] test_asdl_parser
0:00:46 [ 22/407] test_ast -- test_asdl_parser skipped
0:00:52 [ 23/407] test_asyncgen
0:00:53 [ 24/407] test_asynchat
0:00:56 [ 25/407] test_asyncio
Executing .start() done, defined at 
E:\RepoGiT\cpython\lib\test\test_asyncio\test_pep492.py:150> result=None 
created at E:\RepoGiT\cpython\lib\asyncio\base_events.py:452> took 0.141 seconds
0:02:28 [ 26/407] test_asyncore -- test_asyncio passed in 1 min 32 sec
0:02:28 [ 27/407] test_atexit -- test_asyncore skipped
0:02:29 [ 28/407] test_audioop
0:02:29 [ 29/407] test_augassign
0:02:29 [ 30/407] test_base64
0:02:32 [ 31/407] test_baseexception
0:02:32 [ 32/407] test_bdb
0:02:32 [ 33/407] test_bigaddrspace
0:02:32 [ 34/407] test_bigmem
0:02:33 [ 35/407] test_binascii
0:02:33 [ 36/407] test_binhex
0:02:33 [ 37/407] test_binop
0:02:34 [ 38/407] test_bisect
0:02:34 [ 39/407] test_bool
0:02:34 [ 40/407] test_buffer
0:03:18 [ 41/407] test_bufio -- test_buffer passed in 43 sec 970 ms
0:03:22 [ 42/407] test_bytes
0:03:31 [ 43/407] test_bz2
0:03:39 [ 44/407] test_calendar
0:03:58 [ 45/407] test_call
0:03:59 [ 46/407] test_capi
0:04:12 [ 47/407] test_cgi
0:04:12 [ 48/407] test_cgitb
0:04:14 [ 49/407] test_charmapcodec
0:04:15 [ 50/407] test_class
0:04:15 [ 51/407] test_cmath
0:04:15 [ 52/407] test_cmd
0:04:16 [ 53/407] test_cmd_line
0:04:38 [ 54/407] test_cmd_line_script
0:05:19 [ 55/407] test_code -- test_cmd_line_script passed in 41 sec 453 ms
0:05:19 [ 56/407] test_code_module
0:05:20 [ 57/407] test_codeccallbacks
0:05:20 [ 58/407] test_codecencodings_cn
0:05:21 [ 59/407] test_codecencodings_hk
0:05:22 [ 60/407] test_codecencodings_iso2022
0:05:23 [ 61/407] test_codecencodings_jp
0:05:26 [ 62/407] test_codecencodings_kr
0:05:27 [ 63/407] test_codecencodings_tw
0:05:27 [ 64/407] test_codecmaps_cn
0:05:27 [ 65/407] test_codecmaps_hk
0:05:28 [ 66/407] test_codecmaps_jp
0:05:28 [ 67/407] test_codecmaps_kr
0:05:28 [ 68/407] test_codecmaps_tw
0:05:28 [ 69/407] test_codecs
0:05:35 [ 70/407] test_codeop
0:05:35 [ 71/407] test_collections
0:05:39 [ 72/407] test_colorsys
0:05:39 [ 73/407] test_compare
0:05:39 [ 74/407] test_compile
0:05:40 [ 75/407] test_compileall
0:06:27 [ 76/407] test_complex -- test_compileall passed in 46 sec 78 ms
0:06:28 [ 77/407] test_concurrent_futures
0:08:34 [ 78/407] test_configparser -- test_concurrent_futures passed in 2 min 
6 sec
0:08:36 [ 79/407] test_contains
0:08:37 [ 80/407] test_contextlib
0:08:37 [ 81/407] test_copy
0:08:37 [ 82/407] test_copyreg
0:08:38 [ 83/407] test_coroutines
0:08:39 [ 84/407] test_cprofile
0:08:40 [ 85/407] test_crashers
0:08:40 [ 86/407] test_crypt
0:08:40 [ 87/407] test_csv -- test_crypt skipped
0:08:41 [ 88/407] test_ctypes
0:08:44 [ 89/407] test_curses
0:08:44 [ 90/407] test_datetime -- test_curses skipped (resource denied)
0:08:50 [ 91/407] test_dbm
0:08:51 [ 92/407] test_dbm_dumb
0:08:52 [ 93/407] test_dbm_gnu
0:08:52 [ 94/407] test_dbm_ndbm -- test_dbm_gnu skipped
0:08:52 [ 95/407] test_decimal -- test_dbm_ndbm skipped
0:09:14 [ 96/407] test_decorators
0:09:14 [ 97/407] test_defaultdict
0:09:14 [ 98/407] test_deque
0:09:25 [ 99/407] test_descr
0:09:30 [100/407] test_descrtut
0:09:31 [101/407] test_devpoll
0:09:31 [102/407] test_dict_version -- test_devpoll 

[issue27682] wsgiref BaseHandler / SimpleHandler can raise additional errors when handling an error

2018-11-04 Thread Petter S


Change by Petter S :


--
keywords: +patch
pull_requests: +9624
stage: test needed -> patch review

___
Python tracker 

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



[issue35160] PyObjects initialized with PyObject_New have uninitialized pointers to set to 0x1

2018-11-04 Thread Serafeim Mellos


Serafeim Mellos  added the comment:

Ok, I understand your point about PyObject_New not initializing custom fields 
(although it looks like something is initializing the memory since it's not 
random, it's either 0x0 or 0x1).

However, if that's the expected behavior, it's not very clear why there's a 
difference between the default values when invoking the same commands in 
different ways or between different python versions, eg:

Python3.8
=

Python 3.8.0a0 (heads/master-dirty:f98c1623ec, Nov  4 2018, 17:16:57) 
[GCC 5.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import custom; custom.Custom()
weird pointer has value of: 0x0

>>> import custom;
>>> custom.Custom()
weird pointer has value of: 0x1
deallocating weird pointer

>>> 
deallocating weird pointer
zsh: segmentation fault  ../cpython/python

Python 3.6
==

Python 3.6.5 (default, Nov  4 2018, 18:20:36) 
[GCC 5.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import custom; custom.Custom()
weird pointer has value of: 0x0
deallocating weird pointer

>>> import custom  
>>> custom.Custom()
weird pointer has value of: 0x0
deallocating weird pointer



Is there any discussions or documentation I can refer to, in order to better 
understand this behavior or why it was changed since python 3.7? 

Thanks!

--

___
Python tracker 

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



[issue31583] 2to3 call for file in current directory yields error

2018-11-04 Thread Denis Osipov


Change by Denis Osipov :


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



[issue35165] Possible wrong method name in attribute references doc

2018-11-04 Thread Denis Osipov


New submission from Denis Osipov :

6.3.1. Attribute references says:

"The primary must evaluate to an object of a type that supports attribute 
references, which most objects do. This object is then asked to produce the 
attribute whose name is the identifier. This production can be customized by 
overriding the __getattr__() method. If this attribute is not available, the 
exception AttributeError is raised."

It seems that __getattribute__ method is meaning.

--
assignee: docs@python
components: Documentation
messages: 329245
nosy: denis-osipov, docs@python
priority: normal
severity: normal
status: open
title: Possible wrong method name in attribute references doc
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue35160] PyObjects initialized with PyObject_New have uninitialized pointers to set to 0x1

2018-11-04 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

PyObject_New is a low-level allocation function. It doesn't initialize anything 
but the type pointer and ref count. If you want a field to be NULL, set it to 
NULL.

--
nosy: +benjamin.peterson
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



[issue35119] Customizing module attribute access example raises RecursionError

2018-11-04 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

Ah, sorry, I didn't understand this was a documentation issue. Please feel free 
to submit a PR that fixes the example to use `super().__setattr__()`.

--
resolution: not a bug -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

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



[issue29705] socket.gethostbyname, getaddrinfo etc broken on MacOS 10.12

2018-11-04 Thread Sorin Sbarnea


Sorin Sbarnea  added the comment:

It seems that the bug is still present. There is some additional
information on the new report https://bugs.python.org/issue35164

--
nosy: +ssbarnea

___
Python tracker 

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



[issue35160] PyObjects initialized with PyObject_New have uninitialized pointers to set to 0x1

2018-11-04 Thread Serafeim Mellos


Serafeim Mellos  added the comment:

Actually, I'm not so sure it's related to memory management after all judging 
by this (but I don't really know how the compilation part is supposed to work 
:)):


(gdb) watch *0x77ec0680
Hardware watchpoint 1: *0x77ec0680
(gdb) b Custom_dealloc
Breakpoint 2 at 0x7fffef9c4c50: file custom.c, line 16.
(gdb) run
[...]
Hardware watchpoint 1: *0x77ec0680

Old value = 0
New value = 1
dfs (c=c@entry=0x7fffd440, b=b@entry=0x77ec0660, 
a=a@entry=0x7fffd3b0, end=2) at Python/compile.c:4974
4974a->a_postorder[--j] = b;
(gdb) bt
#0  dfs (c=c@entry=0x7fffd440, b=b@entry=0x77ec0660, 
a=a@entry=0x7fffd3b0, end=2) at Python/compile.c:4974
#1  0x004e9e86 in assemble (c=c@entry=0x7fffd440, 
addNone=) at Python/compile.c:5530
#2  0x004f45c6 in compiler_mod (mod=0x9a86a8, c=0x7fffd440) at 
Python/compile.c:1641
#3  PyAST_CompileObject (mod=mod@entry=0x9a86a8, 
filename=filename@entry=0x77e510d8, flags=flags@entry=0x7fffd5e0, 
optimize=optimize@entry=-1, arena=arena@entry=0x77fb81e0)
at Python/compile.c:345
#4  0x00520025 in run_mod (arena=0x77fb81e0, flags=0x7fffd5e0, 
locals=0x77f38d80, globals=0x77f38d80, filename=0x77e510d8, 
mod=0x9a86a8)
at Python/pythonrun.c:1028
#5  PyRun_InteractiveOneObjectEx (fp=fp@entry=0x7749b8a0 <_IO_2_1_stdin_>, 
filename=filename@entry=0x77e510d8, flags=flags@entry=0x7fffd5e0) at 
Python/pythonrun.c:256
#6  0x00520326 in PyRun_InteractiveLoopFlags 
(fp=fp@entry=0x7749b8a0 <_IO_2_1_stdin_>, 
filename_str=filename_str@entry=0x5f1345 "", 
flags=flags@entry=0x7fffd5e0)
at Python/pythonrun.c:120
#7  0x0052049c in PyRun_AnyFileExFlags (fp=0x7749b8a0 
<_IO_2_1_stdin_>, filename=0x5f1345 "", closeit=0, flags=0x7fffd5e0) 
at Python/pythonrun.c:78
#8  0x0042e0be in pymain_run_stdin (pymain=0x7fffd6f0, 
pymain=0x7fffd6f0, cf=0x7fffd5e0, config=0x922ea8) at 
Modules/main.c:1185
#9  pymain_run_python (interp=0x922e20, pymain=0x7fffd6f0) at 
Modules/main.c:1613
#10 pymain_main (pymain=0x7fffd6f0) at Modules/main.c:1758
#11 0x0042e309 in _Py_UnixMain (argc=, argv=) at Modules/main.c:1795
#12 0x7711b4db in __libc_start_main () from /lib64/libc.so.6
#13 0x0042ae6a in _start ()
(gdb) frame
#0  dfs (c=c@entry=0x7fffd440, b=b@entry=0x77ec0660, 
a=a@entry=0x7fffd3b0, end=2) at Python/compile.c:4974
4974a->a_postorder[--j] = b;
(gdb) c
Continuing.
weird pointer has value of: 0x1
>>> 

Breakpoint 2, Custom_dealloc (self=0x77ec0660) at custom.c:16
16  {
(gdb) print(self->test_field)
$1 = (PyObject *) 0x1
(gdb) print(>test_field)
$2 = (PyObject **) 0x77ec0680

--

___
Python tracker 

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



[issue35164] socket.getfqdn and socket.gethostbyname fail on MacOS

2018-11-04 Thread Ned Deily


Ned Deily  added the comment:

See also Issue29705.

--

___
Python tracker 

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



[issue35119] Customizing module attribute access example raises RecursionError

2018-11-04 Thread Denis Osipov


Denis Osipov  added the comment:

I understand that it's expected behavior. But why don't use completely working 
example in the docs, which one could just copy and paste? It requires to add 
just seven chars)

--

___
Python tracker 

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



[issue35164] socket.getfqdn and socket.gethostbyname fail on MacOS

2018-11-04 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report but I don't think the problem you are seeing is that 
simple.  On my 10.14.1 system, I don't see that problem:

$ scutil --get HostName
HostName: not set
$ /usr/local/bin/python3.7
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 03:13:28)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.gethostname()
'harj.local'
>>> socket.gethostbyname(socket.gethostname())
'10.0.1.8'
>>>

So there's likely some other configuration issue here.

--

___
Python tracker 

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



[issue35164] socket.getfqdn and socket.gethostbyname fail on MacOS

2018-11-04 Thread Sorin Sbarnea


New submission from Sorin Sbarnea :

It seems that when the MacOS machine does not have a FQDN name manually 
configured using `scutil`, python will be fail to resolve domain names and 
timeout after ~30 seconds.

I mention that the DNS resolution works correctly on the machine and that the 
DHCP servers provides one ore more domains to be useles for resolution. Tools 
like nslookup or ping are not affected by this, only python (tried py27,34-36 
and got same behavior).

Usually python user encounters errors like:

Traceback (most recent call last):
...
socket.gethostbyname(socket.gethostname())
gaierror: [Errno 8] nodename nor servname provided, or not known

One these machines `hostname` cli command returns a valid FQDN name like 
`foo.lan` but scutil will not return one:
```
sudo scutil --get HostName
HostName: not set
```

One temporary workaround is to manually run:
```
sudo scutil --set HostName `hostname`
```

This will set the hostname and python sockets functions will start to work 
(after few minutes as some caching is involved).

Still, we cannot expect users to run this command themselves. Even worse, they 
would have to re-run this each time the roam to another network that may have a 
different set of domains.

See: https://stackoverflow.com/questions/52602107

--
components: macOS
messages: 329237
nosy: ned.deily, ronaldoussoren, ssbarnea
priority: normal
severity: normal
status: open
title: socket.getfqdn and socket.gethostbyname fail on MacOS
type: behavior
versions: Python 2.7, 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



[issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created

2018-11-04 Thread Eryk Sun


Eryk Sun  added the comment:

> file mode and flags which can be set by os.chmod() and os.chflags() 
> by unprivileged user. 

I remembered incorrectly about chflags. It's not a single immutable flag, but 
several (depending on the OS). The owner or superuser can modify UF_IMMUTABLE, 
UF_READONLY, and UF_NOUNLINK. The SF_* flags can only be unset by the superuser 
in single-user mode.

> It doesn't solve problem when files was made immutable by chattr on
> Linux.

We may not have CAP_LINUX_IMMUTABLE, but we can at least try to clear the 
immutable flag, no?

--

___
Python tracker 

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



[issue35163] locale: setlocale(..., 'eo') sets non-existing locale

2018-11-04 Thread Carmen Bianca Bakker


New submission from Carmen Bianca Bakker :

See the following script:

>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'eo')
'eo'
>>> my_locale = locale.getlocale()
>>> my_locale
('eo_XX', 'ISO8859-3')
>>> locale.setlocale(locale.LC_ALL, my_locale)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.7/locale.py", line 604, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting


'eo_XX.ISO8859-3' does not exist on Fedora 29 or Debian Stretch. The only 
Esperanto locales that exists are 'eo' and 'eo.utf8'.  Even so, locale.py 
defines the Esperanto locales as follows:

'eo':   'eo_XX.ISO8859-3',
'eo.utf8':  'eo.UTF-8',
'eo_eo':'eo_EO.ISO8859-3',
'eo_us.utf8':   'eo_US.UTF-8',
'eo_xx':'eo_XX.ISO8859-3',

eo_EO used to exist on Debian in the early 2000s, and eo_XX on some other 
distributions.  Since glibc 2.24 upstreamed Esperanto, however, it has been 
'eo[.utf8]'.

I'm not sure whether 'eo_eo', 'eo_us' and/or 'eo_xx' should be removed as keys, 
but 'eo' should have 'eo.UTF-8' as value.

--
components: Library (Lib)
messages: 329235
nosy: carmenbianca
priority: normal
severity: normal
status: open
title: locale: setlocale(..., 'eo') sets non-existing locale
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



[issue35161] ASAN: stack-use-after-scope in grp.getgr{nam, gid} and pwd.getpw{nam, uid}

2018-11-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue35161] ASAN: stack-use-after-scope in grp.getgr{nam, gid} and pwd.getpw{nam, uid}

2018-11-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset e359bc24b1f3a6ce311b9ef3043d1fdf5f1bf1cd by Serhiy Storchaka 
(Alexey Izbyshev) in branch 'master':
bpo-35161: Fix stack-use-after-scope in grp.getgr{nam,gid} and 
pwd.getpw{nam,uid}. (GH-10319)
https://github.com/python/cpython/commit/e359bc24b1f3a6ce311b9ef3043d1fdf5f1bf1cd


--

___
Python tracker 

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



[issue24916] In sysconfig, don't rely on sys.version format

2018-11-04 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +9623

___
Python tracker 

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



[issue35162] Inconsistent behaviour around __new__

2018-11-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Assigning and deleting __new__ attr on the class does not allow 
to create instances of this class

___
Python tracker 

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



[issue35161] ASAN: stack-use-after-scope in grp.getgr{nam, gid} and pwd.getpw{nam, uid}

2018-11-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Good catch!

--

___
Python tracker 

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



[issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created

2018-11-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 10320 solves problems with file mode and flags which can be set by 
os.chmod() and os.chflags() by unprivileged user. Was tested on Linux, FreeBSD 
and Windows.

It doesn't solve problem when files was made immutable by chattr on Linux.

--

___
Python tracker 

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



[issue33275] glob.glob should explicitly note that results aren't sorted

2018-11-04 Thread Julien Palard


Change by Julien Palard :


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



[issue35162] Inconsistent behaviour around __new__

2018-11-04 Thread Barney Stratford


New submission from Barney Stratford :

>>> class Eggs (object):
...  def __init__ (self, number):
...   self.__number = number
...  def __repr__ (self):
...   return "{} eggs".format (self.__number)
... 
>>> Eggs (4)
4 eggs
>>> del Eggs.__new__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: __new__
>>> # As expected
...
>>> Eggs (4)
4 eggs
>>> Eggs.__new__ = None
>>> del Eggs.__new__
>>> Eggs (4)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: object() takes no parameters
>>> # Wrong! Eggs has no __new__, so this should respond as earlier
...

This bug seems to be because the slotdef isn't updated when __new__ is deleted.

--
messages: 329231
nosy: Barney Stratford
priority: normal
severity: normal
status: open
title: Inconsistent behaviour around __new__
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



[issue35144] TemporaryDirectory clean-up fails with unsearchable directories

2018-11-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +9622
stage:  -> patch review

___
Python tracker 

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



[issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created

2018-11-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +9621
stage:  -> patch review

___
Python tracker 

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



[issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created

2018-11-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
title: tempfile.TemporaryDirectory() cleanup exception on Windows if readonly 
files created -> tempfile.TemporaryDirectory() cleanup exception if 
nonwriteable or non-searchable files or directories created
versions: +Python 3.7, Python 3.8 -Python 3.5

___
Python tracker 

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



[issue35161] ASAN: stack-use-after-scope in grp.getgr{nam, gid} and pwd.getpw{nam, uid}

2018-11-04 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


--
keywords: +patch
pull_requests: +9620
stage:  -> patch review

___
Python tracker 

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



[issue35161] ASAN: stack-use-after-scope in grp.getgr{nam, gid} and pwd.getpw{nam, uid}

2018-11-04 Thread Alexey Izbyshev


New submission from Alexey Izbyshev :

==24122==ERROR: AddressSanitizer: stack-use-after-scope on address 
0x7fffb1c62550 at pc 0x006ec66c bp 0x7fffb1c62450 sp 0x7fffb1c62448
READ of size 8 at 0x7fffb1c62550 thread T0
#0 0x6ec66b in mkpwent /scratch2/izbyshev/cpython/Modules/pwdmodule.c:79
#1 0x6ecdc9 in pwd_getpwnam_impl 
/scratch2/izbyshev/cpython/Modules/pwdmodule.c:260
#2 0x6ecfee in pwd_getpwnam 
/scratch2/izbyshev/cpython/Modules/clinic/pwdmodule.c.h:39
#3 0x454146 in _PyMethodDef_RawFastCallKeywords 
/scratch2/izbyshev/cpython/Objects/call.c:644
[=== snip ===]
Address 0x7fffb1c62550 is located in stack of thread T0 at offset 160 in frame
#0 0x6eca60 in pwd_getpwnam_impl 
/scratch2/izbyshev/cpython/Modules/pwdmodule.c:203

  This frame has 3 object(s):
[32, 40) 'name_chars'
[96, 104) 'p'
[160, 208) 'pwd' <== Memory access at offset 160 is inside this variable

Variables declared in the block scope created with 
Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS are referred to via a pointer 
outside of that scope (i.e., after their lifetime ends). The bug was introduced 
in 
https://github.com/python/cpython/commit/23e65b25557f957af840cf8fe68e80659ce28629
 .

--
components: Extension Modules
messages: 329230
nosy: berker.peksag, izbyshev, serhiy.storchaka, vstinner, wg
priority: normal
severity: normal
status: open
title: ASAN: stack-use-after-scope in grp.getgr{nam,gid} and pwd.getpw{nam,uid}
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue35160] PyObjects initialized with PyObject_New have uninitialized pointers to set to 0x1

2018-11-04 Thread Serafeim Mellos


Serafeim Mellos  added the comment:

Backtrace from segfault is below but I'm not very familiar with python's memory 
internals in order to figure out where is the value initialized at the first 
place 

(gdb) bt
#0  _Py_XDECREF (op=0x1) at 
/home/fim/.pyenv/versions/3.8-dev/include/python3.8m/object.h:896
#1  Custom_dealloc (self=0x77ec0660) at custom.c:20
#2  0x004685f2 in _Py_Dealloc_inline (op=) at 
./Include/object.h:806
#3  _Py_DECREF (filename=0x5f7460 "Objects/dictobject.c", lineno=1508, 
op=) at ./Include/object.h:833
#4  delitem_common (old_value=, ix=, 
hash=-2939463505650448616, mp=0x77f38d80) at Objects/dictobject.c:1508
#5  _PyDict_DelItem_KnownHash (hash=-2939463505650448616, key=0x77f39b90, 
op=0x77f38d80) at Objects/dictobject.c:1560
#6  PyDict_DelItem (op=0x77f38d80, key=0x77f39b90) at 
Objects/dictobject.c:1526
#7  0x00468aa5 in dict_ass_sub (mp=0x77f38d80, v=0x77f39b90, 
w=) at Objects/dictobject.c:2058
#8  0x004262e3 in _PyEval_EvalFrameDefault (f=, 
throwflag=) at Python/ceval.c:2044
#9  0x004e3ac0 in PyEval_EvalFrameEx (throwflag=0, f=0x77f5a970) at 
Python/ceval.c:531
#10 _PyEval_EvalCodeWithName (_co=_co@entry=0x77e97e40, 
globals=globals@entry=0x77f38d80, locals=locals@entry=0x77f38d80, 
args=args@entry=0x0, argcount=argcount@entry=0, 
kwnames=kwnames@entry=0x0, kwargs=0x0, kwcount=0, kwstep=2, defs=0x0, 
defcount=0, kwdefs=0x0, closure=0x0, name=0x0, qualname=0x0) at 
Python/ceval.c:3946
#11 0x004e3bb3 in PyEval_EvalCodeEx (closure=0x0, kwdefs=0x0, 
defcount=0, defs=0x0, kwcount=0, kws=0x0, argcount=0, args=0x0, 
locals=locals@entry=0x77f38d80, 
globals=globals@entry=0x77f38d80, _co=_co@entry=0x77e97e40) at 
Python/ceval.c:3975
#12 PyEval_EvalCode (co=co@entry=0x77e97e40, 
globals=globals@entry=0x77f38d80, locals=locals@entry=0x77f38d80) at 
Python/ceval.c:508
#13 0x0052009f in run_mod (arena=0x77fb81e0, flags=0x7fffd5e0, 
locals=0x77f38d80, globals=0x77f38d80, filename=0x77e510d8, 
mod=0x9a66c0)
at Python/pythonrun.c:1031
#14 PyRun_InteractiveOneObjectEx (fp=fp@entry=0x7749b8a0 <_IO_2_1_stdin_>, 
filename=filename@entry=0x77e510d8, flags=flags@entry=0x7fffd5e0) at 
Python/pythonrun.c:256
#15 0x00520386 in PyRun_InteractiveLoopFlags 
(fp=fp@entry=0x7749b8a0 <_IO_2_1_stdin_>, 
filename_str=filename_str@entry=0x5f13a5 "", 
flags=flags@entry=0x7fffd5e0)
at Python/pythonrun.c:120
#16 0x005204fc in PyRun_AnyFileExFlags (fp=0x7749b8a0 
<_IO_2_1_stdin_>, filename=0x5f13a5 "", closeit=0, flags=0x7fffd5e0) 
at Python/pythonrun.c:78
#17 0x0042e0fe in pymain_run_stdin (pymain=0x7fffd6f0, 
pymain=0x7fffd6f0, cf=0x7fffd5e0, config=0x922ea8) at 
Modules/main.c:1185
#18 pymain_run_python (interp=0x922e20, pymain=0x7fffd6f0) at 
Modules/main.c:1613
#19 pymain_main (pymain=0x7fffd6f0) at Modules/main.c:1758
#20 0x0042e349 in _Py_UnixMain (argc=, argv=) at Modules/main.c:1795
#21 0x7711b4db in __libc_start_main () from /lib64/libc.so.6
#22 0x0042aeaa in _start ()

--

___
Python tracker 

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



[issue35157] Missing pyconfig.h when building from source and pgo flag is enabled

2018-11-04 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi Jorge,

I am really sorry but I don't have any issue for the compilation of Python 3.6 
under Windows 8.1

C:\Users\pydev\cpython-bpo-35157>PCbuild\amd64\python.exe -m test.pythoninfo

 
Python debug information

 


 


 
Py_DEBUG: No (sys.gettotalrefcount() missing)   

 
_decimal.__libmpdec_version__: 2.4.2

 
builtins.float.double_format: IEEE, little-endian   

 
builtins.float.float_format: IEEE, little-endian

 
datetime.datetime.now: 2018-11-04 14:18:35.618798   

 
expat.EXPAT_VERSION: expat_2.2.6

 
locale.encoding: cp1252 

 
os.cpu_count: 2 

 
os.cwd: C:\Users\pydev\cpython-bpo-35157

 
os.environ[COMSPEC]: C:\Windows\system32\cmd.exe

 
os.environ[HOMEDRIVE]: C:   

 
os.environ[HOMEPATH]: \Users\pydev  

 
os.environ[HOME]: C:\Users\pydev

 
os.environ[LANG]: fr_BE.UTF-8   

 
os.environ[PATH]: 
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
 Files\TortoiseHg\;C:\Program Files\TortoiseSVN\bin;C:\Program 
Files\Git\cmd;C:\Progr
am Files\Microsoft Windows Performance Toolkit\;C:\Program 
Files\Git\bin;C:\Program Files\Microsoft\Web Platform Installer\
  
os.environ[PYTHON]: py -3.6 

 
os.environ[TEMP]: C:\Users\pydev\AppData\Local\Temp 

 
os.environ[TMP]: C:\Users\pydev\AppData\Local\Temp  
 

[issue21263] test_gdb failures on os x 10.9.2

2018-11-04 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
keywords: +patch
pull_requests: +9619
stage: needs patch -> patch review

___
Python tracker 

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



[issue35145] sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime fields

2018-11-04 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

ok in this case, I re-open the issue.

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



[issue35145] sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime fields

2018-11-04 Thread Robert Pollak

Robert Pollak  added the comment:

Stéphane, your example does not match my use case with unknown table structure.

Does everyone agree that such a sniffing is out of scope for sqlite3?
That's not what I'd call "batteries included" :-(

--
title: sqlite3: "select *" should optionally autoconvert TEXT datetime fields 
-> sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime 
fields

___
Python tracker 

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



[issue35145] sqlite3: "select *" should optionally autoconvert TEXT datetime fields

2018-11-04 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

For my part, we could close this issue just because I am sure they sniff the 
format of the string.
If you use sqliteman you get a TEXT and not "datetime" 

You can read this doc about the read_sql 
https://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_sql.html

Now, sqlite3 does not support the datetime type and I think it is not the job 
of Python to do this operation but the caller (your code) but you can see the 
example in Doc/includes/sqlite3/pysqlite_datetime.py
```python
import sqlite3
import datetime

con = sqlite3.connect(":memory:", 
detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES)
cur = con.cursor()
cur.execute("create table test(d date, ts timestamp)")

today = datetime.date.today()
now = datetime.datetime.now()

cur.execute("insert into test(d, ts) values (?, ?)", (today, now))
cur.execute("select d, ts from test")
row = cur.fetchone()
print(today, "=>", row[0], type(row[0]))
print(now, "=>", row[1], type(row[1]))

cur.execute('select current_date as "d [date]", current_timestamp as "ts 
[timestamp]"')
row = cur.fetchone()
print("current_date", row[0], type(row[0]))
print("current_timestamp", row[1], type(row[1]))
```

```shell
2018-11-04 => 2018-11-04 
2018-11-04 12:58:01.399669 => 2018-11-04 12:58:01.399669 
current_date 2018-11-04 
current_timestamp 2018-11-04 11:58:01 
```

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



[issue35160] PyObjects initialized with PyObject_New have uninitialized pointers to set to 0x1

2018-11-04 Thread Serafeim Mellos


New submission from Serafeim Mellos :

I looked but I couldn't find any mention of this either in the bug tracker or 
the docs so I assume this is not a desired behavior or a known proble but feel 
free to correct me if I'm wrong.

I have noticed a weird behavior in Python3.7 onwards with the way 
PyObject_New() works. I'm not sure what is the exact cause for the issue but 
even though the documentation mentions that it should initialize all fields 
described in the associated PyTypeObject, I think there's a problem that 
somehow causes uninitialized pointers to get initialized with strange values 
that break other functionality (eg Py_XDECREF).

In more detail, it seems like uninitialized pointers in PyObjects get 
initialized to 0x1 which can lead to SEGFAULTs when calling Py_XDECREF() on 
them since they are no longer valid pointers.

I have taken the example extension from the python docs 
(https://docs.python.org/3/extending/newtypes_tutorial.html) and modified 
lightly in order to surface the issue. You can find the sample extension in my 
github: https://github.com/fim/python_pyobjectnew_example

I have checked versions 3.5, 3,6 which are fine but 3.7.0, 3.7.1 and 3.8 seem 
to reproduce this issue.

You can see a simple transcript of how the issue manifests below:

$ python setup.py build
[...]
$ pip install . 
[...]
$ python -c 'import custom; custom.Custom()'
weird pointer has value of: 0x8ec480
deallocating weird pointer
$ python
Python 3.7.1 (default, Nov  3 2018, 09:33:27) 
[GCC 5.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import custom, gc
>>> custom.Custom()
weird pointer has value of: 0x1

>>> gc.collect()
deallocating weird pointer
zsh: segmentation fault  python

--
components: Extension Modules
messages: 329224
nosy: fim
priority: normal
severity: normal
status: open
title: PyObjects initialized with PyObject_New have uninitialized pointers to 
set to 0x1
type: crash
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue29183] Unintuitive error handling in wsgiref when a crash happens in write() or close()

2018-11-04 Thread Martin Panter

Martin Panter  added the comment:

Looks like the error handling is broken by Issue 16220, which calls the 
“BaseHandler.close” method before the exception is caught for the error 
handler. Perhaps it is better to just close the iterator without messing with 
the other attributes in the exception case.

I tried various cases in Python 2.6 (without the Issue 16220 change) and the 
error handling seems better (not masked by double exceptions, no sending a 500 
response after the start of the app’s response).

The same problem exists in Python 2, except only the later exception is 
reported, and the original exception is forgotten.

--
keywords: +3.2regression
nosy: +martin.panter
type:  -> behavior
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



[issue35157] Missing pyconfig.h when building from source and pgo flag is enabled

2018-11-04 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

I started a compilation with 
PCBuild\build.bat -d -p x64 -r --pgo  on a Windows machine but I am not the 
owner of this machine.

--
nosy: +matrixise, zach.ware
title: Missing pyconfig.h when building from source -> Missing pyconfig.h when 
building from source and pgo flag is enabled

___
Python tracker 

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



[issue35157] Missing pyconfig.h when building from source and pgo flag is enabled

2018-11-04 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden

___
Python tracker 

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



[issue27682] wsgiref BaseHandler / SimpleHandler can raise additional errors when handling an error

2018-11-04 Thread Martin Panter

Martin Panter  added the comment:

There seem to be at least two different issues raised here (and in Issue 34547):

1. Double exceptions due to “self.environ” and “self.status” being None when 
the error handler is called. This problem was specifically raised in Issue 
29183.

2. What to do about exceptions such as ConnectionAbortedError, which are caused 
by the network or the client, and are outside the server’s control. I find it 
annoying when these exceptions are logged, and tend to add handlers for these 
exception types to silence them. I think this is what Petter is trying to do in 
.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25410] Clean up and fix OrderedDict

2018-11-04 Thread Dan Snider


Dan Snider  added the comment:

It might be more appropriate to start a new issue for this, but I'll leave that 
decision to somehow who would know for sure. Anyway, basically the entire 
dict/PyDictObject api functions do not appear work at all with OrderedDict. Or 
rather, OrderedDict doesn't seem to be able to recognize the changes the dict 
api makes to an object. This is present in both 3.6.0 and 3.7.0 by the way.

from operator import setitem
from collections import OrderedDict
from pprint import pprint
class thing:
def __init__(self):
ns = OrderedDict(a='od.__init__')
vars(__class__)['__dict__'].__set__(self, ns)
dict.__setitem__(ns, 'b', 'dict.__setitem__')
self.c = 'PyObject_SetAttr'
OrderedDict.__setitem__(ns, 'd', 'od.__setitem__')
ns.update(e='od.update')
object.__setattr__(self, 'f', 'PyObject_GenericSetAttr')
setattr(self, 'f', 'PyObject_SetAttr')
setitem(ns, 'g', 'od.__setitem__')
dict.update(ns, h='dict.update')
dict.setdefault(ns, 'i', 'i')
self= thing()
ns  = self.__dict__
real_ns = {**ns}
missing = {k: ns[k] for k in real_ns.keys() - ns.keys()}
pprint(ns)
pprint(missing, width=len(f'{missing}')-1)
print(f'"b" in {ns.keys()} == {"b" in ns.keys()}')
print(f'"b" in {*ns.keys(),} == {"b" in [*ns.keys()]}')
del ns['a']
del ns['b']
print(f"ns.get('c', KeyError('c')) == {ns.get('c', KeyError('c'))}")
print(f"ns.pop('c', KeyError('c')) == {ns.pop('c', KeyError('c'))!r}")
ns.get('i')
ns.pop('i')

Maybe it's considered undefined behavior for a subclass to use 
 a method of one of its bases which it has overriden. That's fair enough, but 
as this example demonstrates, the silence and arbitrariness of the errors is a 
real problem when OrderedDict is used as a namespace, since it's a complete 
coin toss on whether one of the many internal API function will set an 
attribute or name via PyDict_SetItem or PyObject_SetItem. Only the former can 
invoke the methods OrderedDict overrides and there isn't any easy-to-find on 
the subject as far as I know.

--
nosy: +bup

___
Python tracker 

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



[issue35159] Add a link to the devguide in the sidebar of the documentation

2018-11-04 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
versions: +Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue35159] Add a link to the devguide in the sidebar of the documentation

2018-11-04 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
nosy: +mdk

___
Python tracker 

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



[issue35159] Add a link to the devguide in the sidebar of the documentation

2018-11-04 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
keywords: +patch
pull_requests: +9618
stage:  -> patch review

___
Python tracker 

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



  1   2   >