[issue31584] Documentation Language mixed up

2017-10-09 Thread INADA Naoki

INADA Naoki  added the comment:

Japanese HTML has this line:

https://docs.python.org/2/faq/design.html; />

I suspect this line affects CDN's cache.
But I can't find document about canonical link in fastly's document.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue31728] crashes in _elementtree due to unsafe decrefs of Element.text and Element.tail

2017-10-09 Thread Oren Milman

Oren Milman  added the comment:

As serhiy pointed out in a comment in PR 3924, setting self->text or self->tail 
to
NULL might lead to an assertion failure, so we should also prevent the following
assertion failure (and the similar one for tail):
import xml.etree.ElementTree
class X:
def __del__(self):
elem.text

elem = xml.etree.ElementTree.Element('elem')
elem.text = X()
elem.__setstate__({'tag': None}) # implicitly also set elem.text to None

--

___
Python tracker 

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



[issue31736] PEP 485 tiny typo

2017-10-09 Thread Berker Peksag

Berker Peksag  added the comment:

Thank you for the report. Fixed in 
https://github.com/python/peps/commit/070dc7e037e5f66e4e17b661641503815a8bbe05

(By the way, you can report issues like this at 
https://github.com/python/peps/issues or send a PR directly.)

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type: enhancement -> behavior

___
Python tracker 

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



[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-09 Thread Amber Brown

Amber Brown  added the comment:

Donald hits it on the head for me.

As long as the code is not covered by the same API deprecation contract that 
the rest of the standard library is, it should make it obvious when attempting 
to use it. I can be relatively certain that a lot of people were not aware that 
the potential scope of asyncio changes included what it potentially could have, 
and I personally wasn't aware that typing was a provisional module (and got 
burnt by incompatible changes in 3.6). There was a small note in the docs, but 
when I was learning from cattrs's docs and not CPython's, how was I supposed to 
know?

A warning is low cost, there's a way to switch it off, and it potentially 
informs users that they need to be aware of its provisional status, especially 
if it's a dependency of a dependency.

--
nosy: +hawkowl

___
Python tracker 

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



[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-09 Thread Donald Stufft

Donald Stufft  added the comment:

The fundamental problem is that unless you're closely following the development 
of python-dev, it's really really easy to use a provisional module without 
knowing that you are.

Take asyncio for example, as far as I can tell the documentation that noted it 
was provisional was a single, near invisible (light grey on a white background) 
call out at the very top of a single page in the documentation. This is made 
especially hard when you have people giving talks at PyCon encouraging people 
to use this, libraries of the code that don't mention that asyncio is 
provisional, so unless you're directly using asyncio you might not even be 
aware that they're using a provisional API at all.

This has the effect that by including these APIs and make the fact they are 
provisional practically unnoticeable, it pushes the pain of dealing with 
changes onto library authors who have their own users asking them to integrate 
with these features. Putting library authors in the position of either having 
to opt-in to a provisional API and hope it doesn't change, having to scramble 
to keep up with changes in new minor releases, or having to relitigate why 
they're not going to support a provisional API.

Ironically, as we found with web APIs, releasing provisional APIs can actually 
make things worse for end users, because people will expect the usage of the 
APIs as if they were covered under the normal contract, but the developers of 
those APIs feel empowered to make more drastic changes. The long development 
time of CPython makes this even worse (it was ~2 years from the release of 
3.4.0 and 3.6.0 for asyncio to become non provisional, longer if you count 
alpha/beta/etc) because people want to use the new stuff, but they have to wait 
a fairly long time to be "allowed" to do it, all the while the general 
ecosystem consensus is "just do it and ignore the warning, if you noticed the 
warning at all".

Ultimately, the provisional status doesn't reduce the pain of getting APIs 
wrong, it just shifts the pain from CPython's developers to the software 
developers writing stuff that depends on CPython but that they don't directly 
control the execution environment (e.g., all the OSS libraries and applications 
on PyPI). A proposal like this helps alleviate some of that pain by creating 
additional barriers to entry to make end users less likely to use it unless 
they understand what they're asking for.

--

___
Python tracker 

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



[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-09 Thread Guido van Rossum

Guido van Rossum  added the comment:

While I understand the sentiment, having this warning pop up every time you 
import a provisional module while developing code feels like harassment of the 
very users we'd like to try out the provisional APIs.

It's also too course-grained -- most of the time a provisional module is pretty 
stable but has a few gray areas that are still under development.

For those people who are writing software for the ages, maybe this can be an 
opt-in warning? I won't object to that.

--

___
Python tracker 

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



[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-09 Thread Nick Coghlan

Nick Coghlan  added the comment:

This is also fairly similar to Rust's approach of using feature flags to 
explicitly opt-in to unstable features: https://doc.rust-lang.org/unstable-book/

--

___
Python tracker 

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



[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-09 Thread Nick Coghlan

Nick Coghlan  added the comment:

Another advantage of this approach: anyone running their tests in a "no 
warnings allowed" configuration would get a hard failure when dependencies on a 
provisional API were unexpectedly introduced (e.g. when updating a third party 
library), rather than silently acquiring a potential future compatibility issue.

--

___
Python tracker 

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



[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-09 Thread Nick Coghlan

New submission from Nick Coghlan :

Chatting to Donald Stufft and Amber Brown about the way we currently handle 
provisional APIs, I think they have a legitimate concern that we may not be 
gathering adequately informed consent from users when they depend on APIs that 
we've reserved the right to change in the future.

So what I'm now wondering is whether or not it may be worth amending PEP 411 to 
say that all provisional modules should include an import-time snippet like the 
following:

import __main__
if not getattr(__main__, f"use_provisional_{__name__}"):
import warnings
warnings.warn(FutureWarning, f"The {__name__} module is currently a 
provisional API. New features might be added and API may change even between 
minor releases if deemed necessary.")

The exact wording of the warning would match the caveat used in that module's 
API documentation (the variant above comes from the "typing" module)

The idea here would be that *application* developers would get a FutureWarning 
whenever a provisional module was imported, unless they set 
"use_provisional_" in __main__.

Storing the marker attribute in __main__ would be intended to serve two 
purposes:

- it's always going to be imported anyway, so the runtime cost of the new 
snippet in the provisional modules will be low
- it sends a clear indication to library authors that they *shouldn't* be 
setting the flag implicitly as a side-effect of import (framework authors, by 
contrast, may decide to set it, since they're more in control of the overall 
application behaviour than library authors)

--
messages: 304006
nosy: dstufft, gvanrossum, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Default to emitting FutureWarning for provisional APIs
type: enhancement
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



[issue31314] email throws exception with oversized header input

2017-10-09 Thread Dong-hee Na

Dong-hee Na  added the comment:

I sent a patch if anyone have a time, please take a look :)

--
nosy: +corona10

___
Python tracker 

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



[issue31741] backports import path can not be overridden in Windows (Linux works fine)

2017-10-09 Thread R. David Murray

R. David Murray  added the comment:

What is "the backports module"?  I still don't understand what a backports 
directory, that I don't think our installer creates, has to do with your 
MyLibraries directory.

I'm sorry that I'm having trouble following your explanation.  Maybe you could 
list out the contents of your directories and what your sys.path is?

--

___
Python tracker 

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



[issue31741] backports import path can not be overridden in Windows (Linux works fine)

2017-10-09 Thread Chris Caron

Chris Caron  added the comment:

Thank you for replying so quickly;  the issue stems from a bug created here
which explains it a bit better:
https://github.com/caronc/nzb-notify/issues/27 (scroll to the bottom).

In my case, I had a lib\site-packages\backports in C:\Python27 that keeps
over-riding the one defined in the \MyLibraries path. But even when the
'sys.path' has been successfully overridden, the backports module (one i
provide for the package of interest) keeps reverting to the
C:\Python27\lib\site-packages\ path.  It actually just throws an exception
that the module doesn't exist (when ordering of paths would say it does).

To answer your other question: I got the installer from here:
https://www.python.org/downloads/release/python-2713/ (the MSI 64 bit
installer - second from the bottom)

--

___
Python tracker 

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



[issue31741] backports import path can not be overridden in Windows (Linux works fine)

2017-10-09 Thread R. David Murray

R. David Murray  added the comment:

Where did you get your installer?  I don't find any references to 'backports' 
in our repo, other than a couple of places in the docs where the word appears.

I also don't understand the relationship between your MyPackages and a 
backports directory.  They seem to be unrelated in your examples.

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



[issue31741] backports import path can not be overridden in Windows (Linux works fine)

2017-10-09 Thread Chris Caron

New submission from Chris Caron :

The Windows install of Python 2.7.13 defaults it's install into 
**C:\Python27**.  It creates several subdirectories within this; one of which 
is **C:\Python27\lib\site-packages\backports**. So just out of the box (without 
this script installed):
```python
import backports
print(backports.__path__)
# C:\Python27\lib\site-packages\backports
```

I have a custom package that sets the sys.path(0, "new path") entry which works 
great in Linux. I ship all my modules and settings in this path.  This to work 
great in Windows too 'except' for the reference to `backports`.

Consider the block of code:
```python
import sys
from os import getcwd
from os.path import join
sys.path.insert(0, join(getcwd(), 'MyLibraries'))

# Now if we import backports, we should find the one in our MyLibraries 
directory
import backports
print(backports.__path__)# Nope... :(
# C:\Python27\lib\site-packages\backports

# What's weird is it's not entirely broken... you can do the following:
import chardet
print(chardet.__path__)
# Prints my path to MyLibraries/chardet
# So the path is correct and other libraries are coming in correctly
```

What's really weird, is (in Windows) even if i delete the 
**C:\Python27\lib\site-packages\backports**, it still imports the module; so 
it's like part of the Python27 build in some way.

`pip install` with the backports module I want works great because it drops the 
correct package in this 'lib/site-packages\backports' directory which is 
constantly being referenced.

>From what I can see the Microsoft version of Python27 can't seem to stop 
>referencing (even when told not to) the _backports_ location. Linux works 
>perfectly (as intended) but having customers port to this isn't an option for 
>me.

--
components: Windows
messages: 304001
nosy: Chris Caron, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: backports import path can not be overridden in Windows (Linux works fine)
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



[issue31608] crash in methods of a subclass of _collections.deque with a bad __new__()

2017-10-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I meant that if make deque.copy(), deque.__add__() and deque.__mul__() 
returning an exact deque for subclasses, this would make the deque class more 
consistent with other collections and solve this issue. This could even make 
them (almost) atomic.

--

___
Python tracker 

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



[issue31740] refleaks when calling sqlite3.Connection.__init__() more than once

2017-10-09 Thread Oren Milman

Oren Milman  added the comment:

Ah, here also there are crashes when calling methods of uninitialized 
connection objects.

Should i fix this as part of this issue, or open another one?

--

___
Python tracker 

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



[issue31738] Lib/site.py: method `abs_paths` is not documented

2017-10-09 Thread Julien Palard

New submission from Julien Palard :

Hi, thanks for reporting.

This method has been renamed in 
https://github.com/python/cpython/commit/28a691b7fdde1b8abafa4c4a5025e6bfa44f48b9
 and is only used in Lib/site.py (currently in main()).

The function has a docstring, so:

  Help on function abs_paths in module site:

  abs_paths()
  Set all module __file__ and __cached__ attributes to an absolute path


Is this function usefull for you outside of site.py?

--
nosy: +mdk

___
Python tracker 

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



[issue31740] refleaks when calling sqlite3.Connection.__init__() more than once

2017-10-09 Thread Oren Milman

New submission from Oren Milman :

The following code causes refleaks:
import sqlite3
connection = sqlite3.Connection.__new__(sqlite3.Connection)
connection.__init__('foo')
connection.__init__('foo')

This is because pysqlite_connection_init() (in Modules/_sqlite/connection.c)
doesn't decref (if needed) before assigning to various fields of `self`.

I would open a PR to fix this soon.

--
components: Extension Modules
messages: 303997
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: refleaks when calling sqlite3.Connection.__init__() more than once
type: resource usage
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



[issue31734] crash or SystemError in sqlite3.Cache in case it is uninitialized or partially initialized

2017-10-09 Thread Oren Milman

Change by Oren Milman :


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

___
Python tracker 

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



[issue31724] test_xmlrpc_net should use something other than buildbot.python.org

2017-10-09 Thread Zachary Ware

Change by Zachary Ware :


--
stage: patch review -> needs patch

___
Python tracker 

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



[issue31737] Documentation renders incorrectly

2017-10-09 Thread Julien Palard

Julien Palard  added the comment:

Tested locally with different versions of sphinx-build:

- 1.3.3 does not produce the issue
- 1.6.2 (used on docs.python.org) produces the issue
- 1.6.3 does not produce the issue
- 1.6.4 does not produce the issue

Reading the changelog between 1.6.2 and 1.6.3 lead to 
https://github.com/sphinx-doc/sphinx/issues/3824 itself leading to
https://github.com/sphinx-doc/sphinx/commit/f99fe20e507210bd7db8665b8f234f1fe25c8100

So it looks fixed in 1.6.3 and 1.6.4, I'm running a full local build (using 
docsbuild-scripts) using sphinx 1.6.4 to see if we can upgrade.

--

___
Python tracker 

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



[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-09 Thread R. David Murray

R. David Murray  added the comment:

Which example?  (It might be easiest to just generate a PR with your suggested 
improvement.)

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



[issue31719] [2.7] test_regrtest.test_crashed() fails on s390x

2017-10-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Why not use just abort() or Py_FatalError()?

$ ./python -c 'import ctypes; ctypes.CDLL("libc.so.6").abort()'
Aborted (core dumped)

$ ./python -c 'import ctypes; ctypes.pythonapi.Py_FatalError(b"boom!")'
Fatal Python error: boom!

Current thread 0x7f26805c7580 (most recent call first):
  File "", line 1 in 
Aborted (core dumped)

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-09 Thread Nathaniel Manista

New submission from Nathaniel Manista :

https://docs.python.org/3.7/library/socket.html#socket.socket.close says "it is 
recommended to close() [sockets] explicitly, or to use a with statement around 
them", but in the example code on the same page at 
https://docs.python.org/3.7/library/socket.html#example correct use of the 
.close() method seems to be missing.

--
assignee: docs@python
components: Documentation
messages: 303993
nosy: Nathaniel Manista, docs@python
priority: normal
severity: normal
status: open
title: socket.close recommended but not demonstrated in same-page example code
type: enhancement
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



[issue26546] Provide translated french translation on docs.python.org

2017-10-09 Thread Julien Palard

Julien Palard  added the comment:

→ https://docs.python.org/fr/

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



[issue31584] Documentation Language mixed up

2017-10-09 Thread Julien Palard

Julien Palard  added the comment:

FTR I'm still daily monitoring the presence of mixed-up pages server side and 
did not spotted a single one.

I'm still using my very basic:

  $ grep -rl 'définition' /srv/docs.python.org/ja/; grep -rl か 
/srv/docs.python.org/{2.7,3.6,3.7}

--

___
Python tracker 

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



[issue31737] Documentation renders incorrectly

2017-10-09 Thread Julien Palard

Julien Palard  added the comment:

We spotted some quoting probleme in the french translation too, and I still 
didn't had time to look at it, typically here: 
https://docs.python.org/fr/3/library/itertools.html#itertool-functions

where we're getting:

  10.1.1. Fonctions d”itertool¶

instead of:

  10.1.1. Fonctions d'itertool¶

--

___
Python tracker 

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



[issue31314] email throws exception with oversized header input

2017-10-09 Thread Dong-hee Na

Change by Dong-hee Na :


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

___
Python tracker 

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



[issue31705] test_sha256 from test_socket fails on ppc64le arch

2017-10-09 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

Attaching the strace output.

--
Added file: https://bugs.python.org/file47202/trace

___
Python tracker 

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



[issue31738] Lib/site.py: method `abs_paths` is not documented

2017-10-09 Thread Liel Fridman

Change by Liel Fridman :


--
components: Tests
nosy: lielfr
priority: normal
severity: normal
status: open
title: Lib/site.py: method `abs_paths` is not documented
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



[issue31737] Documentation renders incorrectly

2017-10-09 Thread Ned Deily

Change by Ned Deily :


--
nosy: +mdk

___
Python tracker 

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



[issue31737] Documentation renders incorrectly

2017-10-09 Thread Richard Gibson

New submission from Richard Gibson :

The content at docs.python.org seems to be inserting language-dependent "smart 
quotes" in code blocks, which mangles backslashes and sequences like `'''`. 
Observed at 
https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
 , which renders

  longstring  ::=  “”’” longstringitem* “”’” | ‘”“”’ longstringitem* ‘”“”’

instead of

  longstring  ::=  "'''" longstringitem* "'''" | '"""' longstringitem* '"""'

and

  stringescapeseq ::=  “" 

instead of

  stringescapeseq ::=  "\" 

, and looks even worse in other languages:

  longstring  ::=   » »” » longstringitem*  » »” » | “ »«  »” 
longstringitem* “ »«  »”

  longstring  ::=  「」』」 longstringitem* 「」』」 | 『」「」』 longstringitem* 『」「」』


Running `make html` locally produces the desired output, so whatever's going on 
appears specific to the public site.

--
assignee: docs@python
components: Documentation
messages: 303988
nosy: docs@python, gibson042
priority: normal
severity: normal
status: open
title: Documentation renders incorrectly
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



[issue31736] PEP 485 tiny typo

2017-10-09 Thread Ben Bolker

New submission from Ben Bolker :

In two places in https://www.python.org/dev/peps/pep-0485/ floating point 
numbers are incorrectly formatted: 1-e8 and 1-e9 rather than 1e-8 and 1e-9 
("absolute tolerance default", para. 3 and "relative tolerance default", para. 
1)

--
messages: 303987
nosy: bbolker
priority: normal
severity: normal
status: open
title: PEP 485 tiny typo
type: enhancement

___
Python tracker 

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



[issue31735] Documentation incorrectly states how descriptors are invoked

2017-10-09 Thread Paul Pinterits

Paul Pinterits  added the comment:

If we take this class:

class Obj:
@property
def d(self):
print('called')

And we access Obj.d:

_ = Obj.d

According to the docs, the following should happen:

# obj.d looks up d in the dictionary of obj
d = Obj.__dict__['d']

# If d defines the method __get__(),
if hasattr(d, '__get__'):

# then d.__get__(obj) is invoked
d.__get__(Obj)

We know this doesn't happen because nothing is printed to stdout.

--

___
Python tracker 

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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 6e3d6b5dc22cd06d8c4d44a38a8a3415e4bebb16 by Victor Stinner in 
branch 'master':
bpo-31701: faulthandler: ignore MSC and COM Windows exception (#3929)
https://github.com/python/cpython/commit/6e3d6b5dc22cd06d8c4d44a38a8a3415e4bebb16


--

___
Python tracker 

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



[issue31735] Documentation incorrectly states how descriptors are invoked

2017-10-09 Thread Paul Pinterits

Paul Pinterits  added the comment:

I'm aware that descriptors have to exist on the class in order to work. The 
point is that the documentation states "If d defines the method __get__(), then 
d.__get__(obj) is invoked" (where d is obj.d), which is simply not true.

--

___
Python tracker 

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



[issue31415] Add -X option to show import time

2017-10-09 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +3910
stage: resolved -> patch review

___
Python tracker 

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



[issue27172] Undeprecate inspect.getfullargspec()

2017-10-09 Thread Tim Graham

Tim Graham  added the comment:

Perhaps the reason for the undeprecation could use some clarification. In a 
Python 3 only world (where Django's master branch is), I believe there's still 
usefulness for inspect.getfullargspec() -- see 
https://github.com/django/django/search?q=getfullargspec for usages.

--

___
Python tracker 

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



[issue31683] a stack overflow on windows in faulthandler._fatal_error()

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

IMHO this issue is theorical. I don't expect that anyone would call 
Py_FatalError() with a very long message, so I will not backport the fix to 
Python 2.7 and 3.6.

Thanks for the bug report Oren Milman!

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



[issue24084] pstats: sub-millisecond display

2017-10-09 Thread Romuald Brunet

Romuald Brunet  added the comment:

I figured we didn't want to change the size of the columns (+12 COL), but this 
could easily be done yes

--

___
Python tracker 

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



[issue31178] [EASY] subprocess: TypeError: can't concat str to bytes, in _execute_child()

2017-10-09 Thread STINNER Victor

Change by STINNER Victor :


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



[issue31178] [EASY] subprocess: TypeError: can't concat str to bytes, in _execute_child()

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

commit fae0512e58619231a566bf77aa21148440b0ec8d
Author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
Date:   Thu Oct 5 07:10:59 2017 -0700

[3.6] bpo-31178: Mock os.waitpid() in test_subprocess (GH-3896) (#3897)

Fix test_exception_errpipe_bad_data() and
test_exception_errpipe_normal() of test_subprocess: mock os.waitpid()
to avoid calling the real os.waitpid(0, 0) which is an unexpected
side effect of the test.
(cherry picked from commit 11045c9d8a21dd9bd182a3939189db02815f9783)

--

___
Python tracker 

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



[issue31727] FTP_TLS errors when

2017-10-09 Thread Steve Dower

Steve Dower  added the comment:

"OSError: [Errno 0] Error" typically means that OpenSSL failed due to a Windows 
error, but we assumed it failed due to a POSIX error and so read the wrong 
error number (errno instead of GetLastError()).

It's worth testing with Python 3.7.0a1, since we made some changes to OpenSSL 
integration (as well as updating it to a significantly newer version) that may 
impact this scenario.

--
assignee:  -> christian.heimes
components: +SSL
nosy: +christian.heimes

___
Python tracker 

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



[issue31735] Documentation incorrectly states how descriptors are invoked

2017-10-09 Thread Henk-Jaap Wagenaar

Henk-Jaap Wagenaar  added the comment:

You get what you should get: when you print obj.d, Obj.d, you will get:



which is exactly what you expect:
- in the first case, you assigned a property object to the dictionary at 
obj.__dict__, so that's what you get back when you run obj.d.
- you defined a property on a class called d, and you get it when you run Obj.d

If you run print(Obj().d) you will get a TypeError: your lambda should read:

lambda self: print('called')

Properties should be added to the class not the instance, see 
https://stackoverflow.com/questions/1325673/how-to-add-property-to-a-class-dynamically
 and https://eev.ee/blog/2012/05/23/python-faq-descriptors/

--
nosy: +Henk-Jaap Wagenaar

___
Python tracker 

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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-10-09 Thread Steve Dower

Steve Dower  added the comment:

> Is it possible to be asked to be called as the last handler ...

Unfortunately not, since the stack-based handlers always come after the vector 
handlers, and C++ handlers written using try/catch will always be stack-based.

It may be interesting for faulthandler to have a stack-based version, so that 
you can provide the function to call and it will call it inside an exception 
handler. But I don't think it's that interesting and in any case doesn't need 
to be in the stdlib.

I wouldn't worry about 0xE0434F4D for now, but if someone comes along with a 
need for it then we can add it.

--

___
Python tracker 

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



[issue29324] test_aead_aes_gcm fails on Kernel 4.9

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

FYI the merged fix is:

commit 9764c151c51480a7ca6042b1ccd69be2620ff360
Author: matejcik 
Date:   Thu Feb 16 14:41:31 2017 +0100

update test_socket AEAD test for kernel 4.9 and up (#133)

--

___
Python tracker 

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



[issue31705] test_sha256 from test_socket fails on ppc64le arch

2017-10-09 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

Forgot the mention the kernel version which is 3.10.0-693.2.1.el7.ppc64le

--

___
Python tracker 

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



[issue31705] test_sha256 from test_socket fails on ppc64le arch

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

> The issue is reproducible on a CentOS 7.4 on ppc64le architecture.

What is the kernel version?

It would be nice to have the strace output. Example:

strace -o trace ./python -m test -v test_socket -m test_sha256
# then get the trace file

I'm surprised because it seems like ENOKEY (error 126) can only be get on 
accept(), not on send():
http://elixir.free-electrons.com/linux/latest/source/crypto/af_alg.c#L295

--
nosy: +haypo

___
Python tracker 

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



[issue31681] pkgutil.get_data() leaks open files in Python 2.7

2017-10-09 Thread Éric Araujo

Change by Éric Araujo :


--
assignee:  -> merwok
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



[issue31734] crash or SystemError in sqlite3.Cache in case it is uninitialized or partially initialized

2017-10-09 Thread Eric N. Vander Weele

Change by Eric N. Vander Weele :


--
nosy: +ericvw

___
Python tracker 

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



[issue31723] refleaks in zipimport when calling zipimporter.__init__() more than once

2017-10-09 Thread Oren Milman

Oren Milman  added the comment:

Yes, i am going manually over the code to find similar stuff to #31718,
and i afraid i found quite a few, and still working on it..

--

___
Python tracker 

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



[issue31734] crash or SystemError in sqlite3.Cache in case it is uninitialized or partially initialized

2017-10-09 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +ghaering, serhiy.storchaka
versions: +Python 2.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



[issue31723] refleaks in zipimport when calling zipimporter.__init__() more than once

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

> I'm curious, how did you find this code? Are you using a code generator 
> coupled with a tool to track for reference leaks?

Oh, I think that the issue is related to bpo-31718.

--

___
Python tracker 

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



[issue31723] refleaks in zipimport when calling zipimporter.__init__() more than once

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

I merged your PR, thanks! As I wrote on the PR:

I don't think that a NEWS entry is needed, since you are not supposed to call 
__init__() multiple times.

I don't think that it's worth it to backport the fix to Python 2.7 and 3.6. So 
I close the issue.

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



[issue31723] refleaks in zipimport when calling zipimporter.__init__() more than once

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

> The following code causes refleaks:

I'm curious, how did you find this code? Are you using a code generator coupled 
with a tool to track for reference leaks?

--

___
Python tracker 

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



[issue31723] refleaks in zipimport when calling zipimporter.__init__() more than once

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset c0cabc23bbe474d542ff8a4f1243f4ec3cce5549 by Victor Stinner (Oren 
Milman) in branch 'master':
bpo-31723: Fix refleaks when zipimporter.__init__() is called more than once 
(GH-3919)
https://github.com/python/cpython/commit/c0cabc23bbe474d542ff8a4f1243f4ec3cce5549


--
nosy: +haypo

___
Python tracker 

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



[issue31735] Documentation incorrectly states how descriptors are invoked

2017-10-09 Thread Paul Pinterits

New submission from Paul Pinterits :

The [descriptor 
howto](https://docs.python.org/3/howto/descriptor.html#invoking-descriptors) 
states:

"For example, obj.d looks up d in the dictionary of obj. If d defines the 
method __get__(), then d.__get__(obj) is invoked [...]"

This is not true - the descriptor obtained from obj's dictionary is never 
invoked. If it was, the following two snippets would produce output:


class Class:
pass

obj = Class()
obj.__dict__['d'] = property(lambda: print('called'))

_ = obj.d  # nothing is printed.


class Obj:
@property
def d(self):
print('called')

_ = Obj.d  # nothing is printed.

--
assignee: docs@python
components: Documentation
messages: 303968
nosy: Paul Pinterits, docs@python
priority: normal
severity: normal
status: open
title: Documentation incorrectly states how descriptors are invoked
versions: Python 2.7, 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



[issue30008] OpenSSL 1.1.0 deprecated functions

2017-10-09 Thread Christian Heimes

Christian Heimes  added the comment:

Thanks for your patches, Mark. A few remarks:

Python 3.5 is in security fix-only mode. The issue is not a security bug.

Python has switched to a different workflow a while ago. Please provide a pull 
request on GitHub against master (3.7). I'll take care of the backports.

Also your implementation of version specific TLS has multiple flaws, e.g. 
missing NULL check and missing set_max_proto_version() calls. I opened a new PR.

--

___
Python tracker 

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



[issue30008] OpenSSL 1.1.0 deprecated functions

2017-10-09 Thread Christian Heimes

Change by Christian Heimes :


--
pull_requests: +3908
stage:  -> patch review

___
Python tracker 

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



[issue24084] pstats: sub-millisecond display

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

Hum, "2447µs" makes the output more difficult to parse (by a program) and to 
read (by a human). Why not always displaying 6 digits (after the dot) for the 
two "percall" columns.

--
nosy: +haypo

___
Python tracker 

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



[issue31681] pkgutil.get_data() leaks open files in Python 2.7

2017-10-09 Thread Éric Araujo

Éric Araujo  added the comment:


New changeset cfe1aefcbd2534ddc1059a7332842644e6c8d1e4 by Éric Araujo (Elvis 
Pranskevichus) in branch '2.7':
bpo-31681: Make sure pkgutil.get_data closes files properly (#3875)
https://github.com/python/cpython/commit/cfe1aefcbd2534ddc1059a7332842644e6c8d1e4


--
nosy: +merwok

___
Python tracker 

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



[issue31092] delicate behaviour of shared (managed) multiprocessing Queues

2017-10-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> To a avoid race condition

As Oren explained, the race condition is due to your use of the managed Queue.  
If you keep the object alive in the main process until the tasks have finished, 
there shouldn't be any problem.  The question is: is there any reason you don't 
want to?

--

___
Python tracker 

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



[issue31734] crash or SystemError in sqlite3.Cache in case it is uninitialized or partially initialized

2017-10-09 Thread Oren Milman

Oren Milman  added the comment:

Also, the following code results in a memory leak:
import sqlite3
cache = sqlite3.Cache.__new__(sqlite3.Cache)

This is because pysqlite_cache_dealloc() just returns in case of an 
uninitialized
Cache object.

--

___
Python tracker 

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



[issue31733] [2.7] Add PYTHONSHOWREFCOUNT environment variable to Python 2.7

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

Since this issue is on the thin border between "feature" and "bug fix", I would 
like to get the feedback of Benjamin on this change.

@Benjamin: Are you ok to make such change late in the Python 2.7 cycle, in 
Python 2.7.15?

--

___
Python tracker 

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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

All Victor's PRs LGTM is they look good to Benjamin.

But on the next iteration we can get a report that tests don't work if set 
PYTHONSHOWREFCOUNT.

--

___
Python tracker 

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



[issue27172] Undeprecate inspect.getfullargspec()

2017-10-09 Thread Larry Hastings

Larry Hastings  added the comment:

Wait, what is all this nonsense?

inspect.getfullargspec is Python 3 only.  It was added to support keyword-only 
parameters.  Python 2 doesn't *have* keyword-only parameters, so it isn't 
needed there.

Check for yourself: Python 2 doesn't have inspect.getfullargspec.

https://docs.python.org/2/library/inspect.html#inspect.getargspec

We might consider un-deprecating inspect.getargspec() for supporting code 
supporting Py2 and Py3.  But there's no point in un-deprecating 
inspect.getfullargspec() for that reason.

Nick: please *back out* your pointless, taffy-headed checkin.

--
status: closed -> open

___
Python tracker 

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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

(I prefer to not split the discussion on this issue and my 2 PR, I prefer to 
only discuss the design in this issue.)

https://github.com/python/cpython/pull/3927#pullrequestreview-67963845

Serhiy:
> Using the requires_type_collecting decorator LGTM. But I don't sure about 
> adding PYTHONSHOWALLOCCOUNT. This looks like a new feature to me.
> What if split this PR on two parts? The one fixes issues related to immortal 
> types, the other is about additional output.

Both changes are connected. If you only want to fix tests, that's the purpose 
of my much longer PR 3910.

"This looks like a new feature to me."

My PR changes the default behaviour, but COUNT_ALLOCS is not enabled by 
default, not even by the debug mode. You have to explicitely enable it. I 
expect that developers who use this option are able to track the Python 2.7 
changelog and "discover" the newly added environment variable by themself. 
Moreover, defining PYTHONSHOWALLOCCOUNT=1 is "backward compatible" with Python 
< 2.7.15 and Python 3, since unknown environment variables are just ignored.

--

___
Python tracker 

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



[issue31734] crash or SystemError in sqlite3.Cache in case it is uninitialized or partially initialized

2017-10-09 Thread Oren Milman

New submission from Oren Milman :

The following code causes a crash:
import sqlite3
cache = sqlite3.Cache.__new__(sqlite3.Cache)
cache.get(None)

This is because pysqlite_cache_get() (in Modules/_sqlite/cache.c) assumes that
the Cache object is initialized, and so it passes self->mapping to
PyDict_GetItem(), which assumes it is not NULL, and crashes.


Also, the following code causes a SystemError ('null argument to internal
routine'), as well as refleaks in the deallocation of the Cache object:
import sqlite3
cache = sqlite3.Cache(str)
try:
cache.__init__()
except TypeError:
pass
cache.get(None)

This is because pysqlite_cache_init() first sets self->factory to NULL, and
only then parses its arguments, so in case it fails to parse the arguments
(e.g. due to a wrong number of arguments) we are left with a partially
initialized Cache object.


While we are here, we should also fix refleaks that occur when
sqlite3.Cache.__init__() is called more than once.

--
components: Extension Modules
messages: 303958
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: crash or SystemError in sqlite3.Cache in case it is uninitialized or 
partially initialized
type: crash
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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

> How many tests are still left broken if just change the COUNT_ALLOCS output 
> to stderr instead of stdout?

That's my first PR: PR 3910.


> COUNT_ALLOCS is not the only option that spoils Python output. Py_TRACE_REFS 
> adds even more noise to stderr, and this is a default option in debug build.

Again, I created bpo-31733 to propose to make this *super annoying* [xxx refs] 
line *by default*. It makes this issue more consistent ;-)

--

___
Python tracker 

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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy: "Do you going to backport also -X showrefcount?"

I just created bpo-31733 "Add PYTHONSHOWREFCOUNT environment variable to Python 
2.7".

--

___
Python tracker 

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



[issue31733] [2.7] Add PYTHONSHOWREFCOUNT environment variable to Python 2.7

2017-10-09 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +benjamin.peterson, ezio.melotti, serhiy.storchaka
stage: patch review -> 

___
Python tracker 

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



[issue31733] [2.7] Add PYTHONSHOWREFCOUNT environment variable to Python 2.7

2017-10-09 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue30008] OpenSSL 1.1.0 deprecated functions

2017-10-09 Thread Mark Wright

Mark Wright  added the comment:

My proposed patch based on python 3.6.3 to remove the use of the API
that was deprecated in openssl 1.1.  As RAND_pseudo_bytes was removed I
call RAND_bytes instead.

--
Added file: https://bugs.python.org/file47201/python-3.6.3-openssl-1.1.0.patch

___
Python tracker 

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



[issue30008] OpenSSL 1.1.0 deprecated functions

2017-10-09 Thread Mark Wright

Mark Wright  added the comment:

My proposed patch based on python 3.5.4 to remove the use of the API
that was deprecated in openssl 1.1.  As RAND_pseudo_bytes was removed I
call RAND_bytes instead.

--
Added file: https://bugs.python.org/file47200/python-3.5.4-openssl-1.1.0.patch

___
Python tracker 

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



[issue30008] OpenSSL 1.1.0 deprecated functions

2017-10-09 Thread Mark Wright

Mark Wright  added the comment:

This patch allows python 3.4.6 to compile with openssl 1.1 without using
the deprecated API.  It is hacky though as I had to backport changes
that were already in 3.5.4 and 3.6.3.

Also RAND_pseudo_bytes was removed, so I call RAND_bytes instead.

--
Added file: https://bugs.python.org/file47199/python-3.4.6-openssl-1.1.0.patch

___
Python tracker 

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



[issue31733] [2.7] Add PYTHONSHOWREFCOUNT environment variable to Python 2.7

2017-10-09 Thread STINNER Victor

New submission from STINNER Victor :

When Python 2.7 is built in debug mode, it displays the total number of 
references  when the program finishes or after each statement in the 
interactive interpreter.

Example:

haypo@selma$ ./python
Python 2.7.14+ (heads/2.7:cc4b6f1c62, Oct  9 2017, 15:30:11) 
[GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+1
2
[45025 refs]
>>> 2+2
4
[45025 refs]
>>> 
[45025 refs]
[21655 refs]

While I'm Python core developer working on reference leaks for years, I *never* 
used this value. I only use "python -m test -R 3:3 test_xxx" to track reference 
leaks.

I really liked Python 3.4 which made this option an opt-in, python3 -X 
showrefcount: bpo-17323 (commit 1f8898a5916b942c86ee8716c37d2db388e7bf2f).

I propose to change Python 2.7 behaviour to not print this value by default, 
but add a new PYTHONSHOWREFCOUNT environment variable to display it. The value 
is displayed if PYTHONSHOWREFCOUNT is set. Other similar existing variables:

* PYTHONTHREADDEBUG
* PYTHONDUMPREFS
* PYTHONMALLOCSTATS

https://docs.python.org/2.7/using/cmdline.html#debug-mode-variables

I prefer to add a new environment style rather than adding a new -X command 
line option. IMHO an environment variable is less intrusive. For example, older 
Python 2.7 versions completely ignore unknown environment variables, whereas 
"python2.7 -X showrefcount ..." currently logs the "-X is reserved for 
implementation-specific arguments" message into stderr.

Attached PR adds PYTHONSHOWREFCOUNT.

--
messages: 303952
nosy: haypo
priority: normal
severity: normal
status: open
title: [2.7] Add PYTHONSHOWREFCOUNT environment variable to Python 2.7
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



[issue30008] OpenSSL 1.1.0 deprecated functions

2017-10-09 Thread Mark Wright

Mark Wright  added the comment:

My proposed patch based on python 2.7.14 to remove the use of the API
that was deprecated in openssl 1.1.

--
keywords: +patch
nosy: +gienah
Added file: https://bugs.python.org/file47198/python-2.7.14-openssl-1.1.0.patch

___
Python tracker 

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



[issue24084] pstats: sub-millisecond display

2017-10-09 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +3906

___
Python tracker 

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



[issue31732] Add TRACE level to the logging module

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

More references to TRACE logging level:

* "CUSTOM_TRACE = 5 # Mapping for zLOG.TRACE" in Zope zLOG
  https://github.com/zopefoundation/zLOG/blob/master/src/zLOG/EventLogger.py#L29

* Runlevel = stem.util.enum.UppercaseEnum('TRACE', 'DEBUG', 'INFO', 'NOTICE', 
'WARN', 'ERROR')
  TRACE, DEBUG, INFO, NOTICE, WARN, ERR = list(Runlevel)
  https://stem.torproject.org/_modules/stem/util/log.html

* "TRACE = 5 # Trace log level."
  "An extension of Python's option parser."
  
https://github.com/mikeorr/WebHelpers2/blob/master/unfinished/logging_optparse.py#L14

* "TRACE = 5"
  http://www.taurus-scada.org/en/latest/_modules/taurus/core/util/log.html

* "TRACE = 9"
  "bokeh: Interactive plots and applications in the browser from Python"
  https://pypkg.com/pypi/bokeh/f/bokeh/util/logconfig.py

* "With custom log levels: (...) TRACE = 5" (an example in the doc)
  https://pypi.python.org/pypi/colorlog

Note: Zope zLOG also has a "CUSTOM_BLATHER = 15 # Mapping for zLOG.BLATHER" 
level.

--

___
Python tracker 

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



[issue31732] Add TRACE level to the logging module

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

Other references to a TRACE logging level:

* SaltStack: trace = 5
  https://docs.saltstack.com/en/latest/ref/configuration/logging/#log-levels

* autologging.TRACE = 1: "A custom tracing log level, lower in severity than 
logging.DEBUG."
  autologging: "Autologging eliminates boilerplate logging setup code and 
tracing code, and provides a means to separate application logging from program 
flow and data tracing."
  http://pythonhosted.org/Autologging/autologging.html#autologging.TRACE

* robot.logger.TRACE and robot.logger.trace()
  https://robot-framework.readthedocs.io/en/2.9.2/_modules/robot/api/logger.html
  
https://robot-framework.readthedocs.io/en/2.9.2/autodoc/robot.api.html#log-levels

* "I'd like to have loglevel TRACE (5) for my application (...)"
  
https://stackoverflow.com/questions/2183233/how-to-add-a-custom-loglevel-to-pythons-logging-facility

--


FYI while searching users of "TRACE" log level, I also found the other log 
levels:

* "NOTE" < DEBUG
* "FATAL" = CRITICAL
* "profile" = 15 < INFO, but 15 > DEBUG
* "garbage" = 1 < DEBUG

Again, I don't think that these ones are interesting.

--

___
Python tracker 

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



[issue31445] Index out of range in get of message.EmailMessage.get()

2017-10-09 Thread Michala

Michala  added the comment:

I added 2 lines into the file "email/_header_value_parser.py"
into the function "get_mailbox_list(value)" before return value:

if not value:
value = ';'
return mailbox_list, value


It is in attachments.

--
resolution:  -> works for me
Added file: https://bugs.python.org/file47197/_header_value_parser.py

___
Python tracker 

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



[issue31732] Add TRACE level to the logging module

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

Attached PR 3930 adds logging.TRACE, logging.trace() and logging.Logger.trace().

--
nosy: +vinay.sajip

___
Python tracker 

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



[issue31732] Add TRACE level to the logging module

2017-10-09 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Adding PYTHONSHOWALLOCCOUNT looks rather like a new feature to me. It is on to 
Bejaming to make a decision about this.

The difference between an environment variable and a command line option is 
that the former is inherited by children, and the latter is not (this can be 
considered a drawback or an advantage).

COUNT_ALLOCS is not the only option that spoils Python output. Py_TRACE_REFS 
adds even more noise to stderr, and this is a default option in debug build. 
How many tests are still left broken if just change the COUNT_ALLOCS output to 
stderr instead of stdout?

--

___
Python tracker 

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



[issue31732] Add TRACE level to the logging module

2017-10-09 Thread STINNER Victor

New submission from STINNER Victor :

The logging module has already 5 log levels: CRITICAL, ERROR, WARNING, INFO, 
DEBUG.
https://docs.python.org/dev/library/logging.html#logging-levels
(I don't count NOTSET, I don't consider it to be "usable", at least not in an 
application or a library.)

For a large application, sometimes we need to a 6th level since DEBUG might be 
too verbose for some customers (random value: 1 MiB of log per minute). The 
OpenStack project has 2 additional logging levels: TRACE and AUDIT. See the 
Oslo Log project used by all OpenStack projects:

https://github.com/openstack/oslo.log/blob/master/oslo_log/handlers.py#L39

The typical usage for TRACE is to log a Python traceback when an exception is 
logged:

logger.debug("Oops: something bad happened! %s", exc)
for line in my_exception_formatter(exc):
   logger.trace(line)

In software development, "trace" term is commonly associated to "debug traces", 
as in "How to get debug traces?". Or more commonly in Python: "traceback" or 
"stack trace".

An additional level helps to filter logs, but also to colorize logs differently.

--

I don't propose to add a new AUDIT level since it's not well defined and it's 
less popular in OpenStack. For example, the Oslo Log module adds a new 
logger.trace() method, but no logger.audit().

--
components: Library (Lib)
messages: 303945
nosy: haypo
priority: normal
severity: normal
status: open
title: Add TRACE level to the logging module
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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-09 Thread Iryna Shcherbina

Iryna Shcherbina  added the comment:

I have run a test build with the patch from PR 3927 applied, and all tests 
passed.
Full build log can be viewed here: 
https://kojipkgs.fedoraproject.org//work/tasks/8392/22348392/build.log

--

___
Python tracker 

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



[issue10496] Python startup should not require passwd entry

2017-10-09 Thread Nicholas Brown

Nicholas Brown  added the comment:

This is also a problem when using the DynamicUser=yes feature available in 
systemd 232 onward with a service that's implemented in python.
See http://0pointer.net/blog/dynamic-users-with-systemd.html for details of the 
DynamicUser= systemd feature.

--
nosy: +Nicholas Brown

___
Python tracker 

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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

I abandon my intent to log all interesting errors: PR 3929 now always ignore 
all MSC and COM Windows exceptions.

--

___
Python tracker 

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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-10-09 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +3904

___
Python tracker 

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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

I failed to build https://github.com/FynnBe/faulthandler-spam with a Python 
built myself. But I succeeded to recompile a Python extension (_overlapped) in 
C++ (I removed two functions which caused compilation error) and then added 
faulthandler-spam/test_module/module.cpp code into _overlapped. So I was able 
to test C++ code raising a regular extension called by Python.

Sadly, using "AddVectoredExceptionHandler(0, faulthandler_exc_handler);" 
(instead of "AddVectoredExceptionHandler(1, ...") doesn't solve the issue: the 
exception is still logged. It seems like the faulthandler exception handler is 
called before C++ has the opportunity to handle the exception.

So it doesn't seem possible to log *unhandled* C++ exceptions using 
AddVectoredExceptionHandler() without flooding logs with *handled* C++ 
extensions.

I now agree with Steve Dower to ignore *all* C++ exceptions in faulthandler.

--

___
Python tracker 

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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

I misunderstood how Windows works. UNIX signals handlers and Windows exception 
handlers are unrelated. Exception handlers are not called to handle a SIGSEGV 
signal (raised manually by the process itself, not raised by the Windows 
kernel).

--

___
Python tracker 

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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

I wrote the PR 3928 to call AddVectoredExceptionHandler(0, ...) rather than 
AddVectoredExceptionHandler(1, ...), but it doesn't work as expected.

I tested "faulthandler.enable(); faulthandler._sigsegv()": a traceback is 
logged. But this code tested the *signal handler* rather than the exception 
handler. I disabled manually the code of faulthandler.enable() to not install 
signal handlers anymore: no more traceback is logged.

--

___
Python tracker 

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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-10-09 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue31666] Pandas_datareader Error Message - ModuleNotFoundError: No module named 'pandas_datareader' with module in folder

2017-10-09 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi,

Your bug is related to Pandas and not to Python 3.6.

Maybe you need to post your issue to the bug tracker of Pandas.

You need to install pandas-datareader

pip install pandas-datareader

But it is not an issue with Python.

Have a nice day,

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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

I tested PR 3927. I run "./python -m test -j8 -r" with PYTHONSHOWALLOCCOUNT 
unset: the full Python test suite pass in release and debug modes:

* ./configure CFLAGS="-D COUNT_ALLOCS=1"
* ./configure  --with-pydebug CFLAGS="-D COUNT_ALLOCS=1"

--

___
Python tracker 

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



[issue27172] Undeprecate inspect.getfullargspec()

2017-10-09 Thread Nick Coghlan

Nick Coghlan  added the comment:

Oops, we/I missed the window for also getting the deprecation removed from 
3.5.x (as that branch is now in security-fix only mode).

Marking as resolved for 3.6 accordingly.

--
resolution:  -> fixed
stage: backport needed -> resolved
status: open -> closed
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue31666] Pandas_datareader Error Message - ModuleNotFoundError: No module named 'pandas_datareader' with module in folder

2017-10-09 Thread Scott Tucholka

Scott Tucholka  added the comment:

I am running Windows 10 Enterprise x64 and use Spyder (Python 3.6).

This is my code:
import pandas as pd
import pandas_datareader as dr
dr.get_data_yahoo('AAPL')

I am expecting that the module will import and the get_data_yahoo will
return results for 'AAPL'.

This is my log:
Python 3.6.2 |Anaconda, Inc.| (default, Sep 19 2017, 08:03:39) [MSC v.1900
64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
IPython 6.1.0 -- An enhanced Interactive Python.
import pandas as pd
import pandas_datareader as dr
dr.get_data_yahoo('AAPL')
Traceback (most recent call last):
  File "", line 2, in 
import pandas_datareader as dr
ModuleNotFoundError: No module named 'pandas_datareader'

Thanks

On Fri, Oct 6, 2017 at 12:57 PM, Éric Araujo  wrote:

>
> New submission from Éric Araujo :
>
> Hello!  Your bug report gives very little information for us to help you.
> Can you give details such as: your environement / setup, your code,
> expected result and full error message?
>
> https://devguide.python.org/tracker/#reporting-an-issue
>
> --
> nosy: +merwok
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31267] threading.Timer object is affected by changes to system time: Python locks should use a monotonic clock if available

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

> it looks as if measures were implemented but never merged.

The blocker issue is that sem_timedwait() doesn't support CLOCK_MONOTONIC. The 
glibc has to be enhanced to support this new feature.

--

___
Python tracker 

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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-09 Thread STINNER Victor

STINNER Victor  added the comment:

Ok, so. I wrote a different PR: PR 3927 adds a new PYTHONSHOWALLOCCOUNT 
environment variable and write allocations statistics into stderr (rather than 
stdout) when PYTHONSHOWALLOCCOUNT is set.

The PR also fixes the test suite for COUNT_ALLOCS.

The PR 3927 is much shorter because PYTHONSHOWALLOCCOUNT now has to be defined 
to dump allocations statistics.

haypo@selma$ git diff 2.7.. --stat
 Doc/using/cmdline.rst   | 
7 +++
 Lib/test/support/__init__.py| 
3 +++
 Lib/test/test_abc.py| 
1 +
 Lib/test/test_gc.py | 
4 +++-
 Lib/test/test_regrtest.py   | 
1 +
 Lib/test/test_sys.py| 
5 -
 Lib/test/test_weakref.py| 
1 +
 Misc/NEWS.d/next/Core and Builtins/2017-10-09-11-03-13.bpo-31692.5-bpdk.rst | 
4 
 Python/pythonrun.c  | 
4 +++-
 9 files changed, 27 insertions(+), 3 deletions(-)

--

___
Python tracker 

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



[issue19527] Test failures with COUNT_ALLOCS

2017-10-09 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +3902

___
Python tracker 

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



  1   2   >