[issue29149] SSL.py recursion limit crash

2017-01-03 Thread Sumner Hearth

Sumner Hearth added the comment:

Attached a simpler version of the code with same error using only eventlet.

--
Added file: http://bugs.python.org/file46136/crash_simple.py

___
Python tracker 

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



[issue17301] An in-place version of many bytearray methods is needed

2017-01-03 Thread INADA Naoki

INADA Naoki added the comment:

I prefer ".inplace_translate" to ".mtranslate", but I'm not sure about it's 
worth enough to add it to bytearray.

In last year, I proposed adding `bytes.frombuffer()` constructor to avoid
unnecessary memory copy.
https://mail.python.org/pipermail/python-dev/2016-October/146668.html

Nick Coghlan againsted for adding methods to builtin type only for low level
programming, and suggested to implement it in 3rd party library first.
https://mail.python.org/pipermail/python-dev/2016-October/146746.html
https://mail.python.org/pipermail/python-dev/2016-October/146763.html

--
nosy: +inada.naoki

___
Python tracker 

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



[issue29149] SSL.py recursion limit crash

2017-01-03 Thread Sumner Hearth

Sumner Hearth added the comment:

Recursion crash disappears in eventlet 0.17.4

--

___
Python tracker 

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



[issue28768] Warning: implicit declaration of function '_setmode'

2017-01-03 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

Building 2.7 is for testing purposes. It is used to judge whether it is a 
problem (specifically for Cygwin-specific) originated in the old version. 
_setmode is an important function for setting input and output of CPython, so 
in Cygwin I feel annoying that warnings are issued even though there is 
actually no problem.

--

___
Python tracker 

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



[issue29149] SSL.py recursion limit crash

2017-01-03 Thread Sumner Hearth

New submission from Sumner Hearth:

Error in python 3.6 ssl.py:

[...]
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", 
line 737, in __init__
self._context.verify_mode = cert_reqs
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", 
line 479, in verify_mode
super(SSLContext, SSLContext).verify_mode.__set__(self, value)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", 
line 479, in verify_mode
super(SSLContext, SSLContext).verify_mode.__set__(self, value)
[Repeated]

Crash is infinite recursion on super calls having to do with the verify_mode 
property

Crash found when creating an SSL context for eventlet with flask-socketio, 
unfortunately easiest way to reproduce involves installing eventlet, flask, 
flask-socketio, and pyopenssl. I've included the smallest working example of 
the crash in python 3.6, attached code works in python 3.5.

Note:
I'm attempting to create a dependency-free version of the file which exhibits 
the same behavior, it's tricky to unwrap all the libraries leading to the 
issue. See https://github.com/miguelgrinberg/Flask-SocketIO/issues/193 for 
original post discovering bug.

--
assignee: christian.heimes
components: SSL
files: crash.py
messages: 284614
nosy: Sumner Hearth, christian.heimes
priority: normal
severity: normal
status: open
title: SSL.py recursion limit crash
type: crash
versions: Python 3.6
Added file: http://bugs.python.org/file46135/crash.py

___
Python tracker 

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



[issue29147] registry value to be cleared when python is uninstalled

2017-01-03 Thread Steve Dower

Steve Dower added the comment:

Interesting. I don't suppose you could find all the log files in your %TEMP% 
directory, put them in a zip file and attach them here? There may be some clue 
as to why this happened - it's certainly meant to clean everything up when you 
uninstall (except for site-packages, but definitely shortcuts and registry 
entries).

--

___
Python tracker 

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



[issue16026] csv.DictReader argument names documented incorrectly

2017-01-03 Thread Berker Peksag

Berker Peksag added the comment:

Welcome and thanks for the patch, Greg. csv.rst-patch looks good to me. I will 
commit it this week if there are no objections.

Documentation updates can go into all active branches so I'm adding 3.5 and 3.6 
back (we can pass 2.7 at this point since this is a trivial change)

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

___
Python tracker 

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



[issue29147] registry value to be cleared when python is uninstalled

2017-01-03 Thread jha.amit6666

jha.amit added the comment:

The start menu shortcuts and the files in installation path "C:\Program 
Files\Python35" are also present. The thing should go when python3.5 is 
uninstalled.

This can be solved when newer version of python, i.e., python 3.6 is 
installed/uninstalled. During this time, a prompt should be shown.

--
Added file: http://bugs.python.org/file46134/1.png

___
Python tracker 

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



[issue29148] Inheritance behaviour ambiguos

2017-01-03 Thread Xiang Zhang

Xiang Zhang added the comment:

It seems you are surprised `super(C, self).foo2()` works but it is actually how 
super() and class.__mro__ works. :-) So not a bug. You could learn more about 
it but sorry I don't have any good reference for you. :-(

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



[issue17301] An in-place version of many bytearray methods is needed

2017-01-03 Thread irdb

Changes by irdb :


--
nosy: +irdb

___
Python tracker 

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



[issue29148] Inheritance behaviour ambiguos

2017-01-03 Thread Yugansh Marwah

New submission from Yugansh Marwah:

Inheritance property behaves ambiguously on inheriting multiple inheritance 
over a class
It even calls the function of un-inherited class
code is attached below kindly run it and tell me the exact behavior of the same.

--
components: Tests
files: oops.py
messages: 284610
nosy: yugansh94
priority: normal
severity: normal
status: open
title: Inheritance behaviour ambiguos
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file46133/oops.py

___
Python tracker 

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



[issue29134] contextlib doc bug

2017-01-03 Thread Senthil Kumaran

Senthil Kumaran added the comment:

I am going to vote for "not a bug" here. From the context is it understood that 
the `ContextBaseClass` is to be provided by the user.

> Existing context managers that already have a base class can be extended by 
> using ContextDecorator as a mixin class:

The idea here is the illustrate the Mixin possibility with a Base class and not 
to provide a full example with Base class code as well.

@Marco, also not a good ticket add more doc strings to this module.rst. If the 
docs of those can be improved, they can done separately, concentrating on all 
the possible improvements.

--
nosy: +orsenthil
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue29147] registry value to be cleared when python is uninstalled

2017-01-03 Thread jha.amit6666

New submission from jha.amit:

I have installed python 3.5 on Windows and then uninstalled it. THe registry 
value HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.5 is still present.

This is solved in python 3.6. So the work to be done here is: if there was any 
previous version of python installed and not present now, then the registry 
values should be cleared.

The behaviour of uninstallation of Python 3.6 is that the registry value is 
cleared.

--
components: Windows
messages: 284608
nosy: jha.amit, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: registry value to be cleared when python is uninstalled
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue29145] failing overflow checks in replace_*

2017-01-03 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Does that mean it no longer respects -fwrapv?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue16026] csv.DictReader argument names documented incorrectly

2017-01-03 Thread Greg Bengeult

Greg Bengeult added the comment:

Here's a revised patch file for Python 3.7. This is my first ever submission to 
an open source project, so please be gentle.

--
nosy: +gbengeult
versions:  -Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file46132/csv.rst-patch

___
Python tracker 

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



[issue29130] Exit code 120 returned from Python unit test testing SystemExit

2017-01-03 Thread R. David Murray

Changes by R. David Murray :


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



[issue28180] sys.getfilesystemencoding() should default to utf-8

2017-01-03 Thread INADA Naoki

INADA Naoki added the comment:

I read PEP 538 but I can't understand why just using UTF-8 when locale is C 
like macOS is bad idea.

--

___
Python tracker 

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



[issue22417] PEP 476: verify HTTPS certificates by default

2017-01-03 Thread Carlos Alberto Lopez Perez

Carlos Alberto Lopez Perez added the comment:

The python 2.7 documentation for urrlib still has a big warning notice at the 
top saying:

"""
Warning

When opening HTTPS URLs, it does not attempt to validate the server 
certificate. Use at your own risk! 
"""
^^ https://docs.python.org/2/library/urllib.html

I believe this is incorrect since this patch was backported to the 2.7  branch. 
I checked it, and it verifies SSL certs by default.


I guess the documentation for urllib should be updated to remove that warning?

--
nosy: +clopez

___
Python tracker 

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



[issue20608] 'SyntaxError: invalid token' is unfriendly

2017-01-03 Thread John Parejko

John Parejko added the comment:

I had filed issue 29146 but eventually found this, which has patches to fix the 
exception messages. Could someone please look at this and get it incorporated 
into python?

--

___
Python tracker 

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



[issue20608] 'SyntaxError: invalid token' is unfriendly

2017-01-03 Thread John Parejko

Changes by John Parejko :


--
nosy: +John Parejko

___
Python tracker 

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



[issue29146] Confusing "invalid token" exception when integers have leading zero

2017-01-03 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for finding the duplicate. I'm closing this as a duplicate of issue 
20608.

--
components:  -2to3 (2.x to 3.x conversion tool), Documentation
nosy: +berker.peksag -docs@python
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> 'SyntaxError: invalid token' is unfriendly

___
Python tracker 

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



[issue20608] 'SyntaxError: invalid token' is unfriendly

2017-01-03 Thread Berker Peksag

Changes by Berker Peksag :


--
versions: +Python 3.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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

unitttest.patch: my attempt to write an unit test, but I was bitten by the 
datetime.timestamp() bug.

--
Added file: http://bugs.python.org/file46131/unittest.patch

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

Oh, datetime.datetime.timestamp() also has a bug for values close to 0001-01-01 
(year 1), at least in my timezone (CET).

$ ./python -c 'import datetime; datetime.datetime.min.timestamp()'
python: /home/haypo/prog/python/default/Modules/_datetimemodule.c:251: 
days_before_year: Assertion `year >= 1' failed.
Aborted (core dumped)

datetime_check_args.patch doesn't fix this issue. A solution is to check that 
year>=1 in utc_to_seconds():

+if (year < MINYEAR || year > MAXYEAR) {
+PyErr_SetString(PyExc_ValueError,
+"year is out of range");
+return -1;
+}

Maybe it would solve the following local() comment:

   /* XXX: add bounds checking */

--

___
Python tracker 

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



[issue29133] Minor inaccuracy in shlex.shlex punctuation_chars example

2017-01-03 Thread Evan

Evan added the comment:

Second patch looks good, thanks. Do you also want to doctest that?

--

___
Python tracker 

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



[issue29140] time_hash() reads the wrong bytes to get microseconds

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

Note: I found this bug while working on the issue #29100.

--

___
Python tracker 

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



[issue29140] time_hash() reads the wrong bytes to get microseconds

2017-01-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 72e48ff7b169 by Victor Stinner in branch '3.6':
Issue #29140: Fix hash(datetime.time)
https://hg.python.org/cpython/rev/72e48ff7b169

--
nosy: +python-dev

___
Python tracker 

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



[issue29140] time_hash() reads the wrong bytes to get microseconds

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

I used attached check.patch to check if macros are misused in other functions. 
Hopefully, only time_hash() has bugs.

I don't think that it's worth it to apply check.patch, I dislike such complex 
macro.

--
Added file: http://bugs.python.org/file46130/check.patch

___
Python tracker 

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



[issue28961] unittest.mock._Call ignores `name` parameter

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

The latest patch (Jiajun Huang, 2017-01-03 14:34) LGTM.

--

___
Python tracker 

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



[issue29141] error in 2to3

2017-01-03 Thread Brett Cannon

Brett Cannon added the comment:

To help you work around this you can simplify your original code such that you 
don't trigger the issue:

dict((key, val) for key, val in docs_uploaded_at.iteritems() if len(val) == 3)

and

[x for x in registered if x.phone not in with_transaction_mobile]

--
nosy: +brett.cannon

___
Python tracker 

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



[issue27961] remove support for platforms without "long long"

2017-01-03 Thread Petr Viktorin

Petr Viktorin added the comment:

The backwards compatibility is not as strong as it could be: previously, 
HAVE_LONG_LONG was defined to 1; now it's defined but empty.

At least that's the case on Fedora.
Found in the Python plugin for GCC: 
https://bugzilla.redhat.com/show_bug.cgi?id=1409009

--
nosy: +encukou

___
Python tracker 

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



[issue29146] Confusing "invalid token" exception when integers have leading zero

2017-01-03 Thread John Parejko

John Parejko added the comment:

Ah, I finally found a related issue, and it looks like it has patches! 
https://bugs.python.org/issue20608

If someone could check that over and merge it, that would be wonderful!

--

___
Python tracker 

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



[issue29146] Confusing "invalid token" exception when integers have leading zero

2017-01-03 Thread John Parejko

New submission from John Parejko:

As described in PEP-3127, the "leading-zeros" formatting for octal was removed 
from python 3. This is a good thing(tm), but the recommendation of that PEP to 
improve the error message of the raised exception[1] was apparently never 
implemented. I just ran into this while with some recently-ported python2 code, 
and it took a while to figure out the problem.

Although this is going to be less of a problem with time as people convert to 
pure python3, it will be very helpful during the transition period.

>>> 0o007
7
>>> 007
  File "", line 1
007
  ^
SyntaxError: invalid token


1: https://www.python.org/dev/peps/pep-3127/#id17

--
assignee: docs@python
components: 2to3 (2.x to 3.x conversion tool), Documentation, Interpreter Core
messages: 284591
nosy: John Parejko, docs@python
priority: normal
severity: normal
status: open
title: Confusing "invalid token" exception when integers have leading zero
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2017-01-03 Thread Martin Panter

Martin Panter added the comment:

Behaviour change in Free BSD as I understand. Nothing changed in Python, but 
perhaps older versions of Free BSD behaved like Linux and raised EIO (or 
another errno; it is not clear).

--

___
Python tracker 

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



[issue28961] unittest.mock._Call ignores `name` parameter

2017-01-03 Thread Berker Peksag

Berker Peksag added the comment:

The patch looks good to me. There are some styling issues in the test code 
(e.g. no need to add trailing spaces after commas in some cases), but I can 
take care of them before committing the patch :) Thanks!

--

___
Python tracker 

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



[issue29145] failing overflow checks in replace_*

2017-01-03 Thread jan matejek

New submission from jan matejek:

Related to http://bugs.python.org/issue1621 and 
http://bugs.python.org/issue27473
GCC 6 optimizes away broken overflow checks. This leads to segfaults on 
test_replace_overflow, at least for strings and bytearrays.

--
components: Interpreter Core
messages: 284588
nosy: matejcik
priority: normal
severity: normal
status: open
title: failing overflow checks in replace_*
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue29144] Implicit namespace packages in Python 3.6

2017-01-03 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue29144] Implicit namespace packages in Python 3.6

2017-01-03 Thread Lumír Balhar

New submission from Lumír Balhar:

Hello.

I've found a really strange difference between Python 3.5 and 3.6 related to 
namespace packages and I cannot find any note in changelogs.

I've created a simple bash script which can reproduce my issue using virtual 
environments: http://pastebin.com/j3fXMtR4

This script creates a virtual environment, installs marrow.util from PyPI which 
is one part of namespace package and creates the other part (marrow.mailer) in 
the local folder. Then script tries to import marrow.util and marrow.mailer - 
and there is the difference.

In Python 3.5 - I can import marrow.util (installed via pip) but I cannot 
import local marrow.mailer module. I think that this is right behavior.
In Python 3.6 - I cannot import marrow.util (installed via pip) but I can 
import local marrow.mailer module.

Python versions are 3.5.2 (installed from Fedora repositories) and 3.6.0 
(compiled manually).

Why there is such a big difference? Am I missing something?

I tried to ask on IRC, stackoverflow etc. but without success. Could you please 
explain the reason for this behavior to me?

Thank you and have a nice day.
Lumír

Bash script attached

--
files: test_namespace_package.sh
messages: 284587
nosy: frenzy
priority: normal
severity: normal
status: open
title: Implicit namespace packages in Python 3.6
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file46129/test_namespace_package.sh

___
Python tracker 

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



[issue29076] Py 3.6 Mac installer doesn't update "python3" shell command

2017-01-03 Thread Elias Zamaria

Elias Zamaria added the comment:

Ned, that sounds plausible. I think I started using fish after I installed 
Python 3.5, but before I installed Python 3.6.

--

___
Python tracker 

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



[issue28518] execute("begin immediate") throwing OperationalError

2017-01-03 Thread Aviv Palivoda

Aviv Palivoda added the comment:

Yes. If a transaction is open you will need to explicitly commit before doing 
vacuum.
I am not sure if that was intentional or not. From quick look in the sqlite 
source code there are few things that cannot happen from a transaction:
1. VACUUM
2. ATTACH
3. DETACH
4. BEGIN
5. Few PRAGMAs (temp_store, synchronous)

All of the above worked with implicit commit before commit 284676cf2ac8 but now 
has to call commit explicitly.

--

___
Python tracker 

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



[issue29143] Logger should ignore propagate property for disabled handlers.

2017-01-03 Thread Oleg Serov

Oleg Serov added the comment:

> 1. I have some random logging configuration with some logging handlers that 
> have "propagate = True"
Read as: 1. I have some random logging configuration with some logging handlers 
that have "propagate = False"

--

___
Python tracker 

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



[issue29143] Logger should ignore propagate property for disabled handlers.

2017-01-03 Thread Oleg Serov

New submission from Oleg Serov:

Looks like if I have a logger handler with propagate = False and it is 
disabled, the "propagate" is still in affect.

I am considering this is a bug, because:
1. I have some random logging configuration with some logging handlers that 
have "propagate = True"
2. I am setting a new logging configuration by using logging.config.dictConfig 
with "disable_existing_loggers = True"
3. After that I still "feel" the effect of old config, because some log 
messages do not reach my new loggers.

What I am doing wrong? Or this is a bug? A bug in documentation?

--
components: Library (Lib)
messages: 284583
nosy: Oleg Serov
priority: normal
severity: normal
status: open
title: Logger should ignore propagate property for disabled handlers.
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



[issue29133] Minor inaccuracy in shlex.shlex punctuation_chars example

2017-01-03 Thread Marco Buttu

Marco Buttu added the comment:

Yes, you are right. Here is a patch.

--
Added file: http://bugs.python.org/file46128/issue29133_2nd.patch

___
Python tracker 

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



[issue29139] operator.concat/iconcat could only work if left operand is a sequence

2017-01-03 Thread Xiang Zhang

Xiang Zhang added the comment:

Actually this issue was discussed when import the pure Python implementation in 
#16694. There seems once an effort checking also the right operand but was 
later removed, but I couldn't understand why (though there is an explanation, 
but it's more about why removing __len__ checking). :-(

--
nosy: +rhettinger

___
Python tracker 

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



[issue29104] Left bracket remains in format string result when '\' preceeds it

2017-01-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch adds a warning.

--
Added file: http://bugs.python.org/file46127/fstring_backslash_2.patch

___
Python tracker 

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



[issue29104] Left bracket remains in format string result when '\' preceeds it

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

> There is no issue with f'\\{10}'. There is an issue with f'\{10}'.

Hum, I'm not sure that my previous comment is explicit: I suggest to raise a 
syntax error on f'\{10}' (or emit a warning, and raise an error in 3.7 if you 
insist ;-)).

--

___
Python tracker 

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



[issue29104] Left bracket remains in format string result when '\' preceeds it

2017-01-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> f'\\N{AMPERSAND}': reading a local variable looks like a typo or a security 
> vulnerability, rather than a nice feature.

This can look as a typo, but how would you write this if this is not a typo? 
f'\\N{AMPERSAND}' is legitimate syntax, and it would be weird to interpret this 
expression in any other way than as '\\' + 'N' + format(AMPERSAND).

> What is the issue with having to write "\\{10}" to get "\\10" string? It's 
> less error prone.

There is no issue with f'\\{10}'. There is an issue with f'\{10}'.

--

___
Python tracker 

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



[issue29139] operator.concat/iconcat could only work if left operand is a sequence

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

> More like a implementation detail for me.

IMHO it's a deliberate choice that the operator module behaves
differently for concat() and add().

--

___
Python tracker 

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



[issue28180] sys.getfilesystemencoding() should default to utf-8

2017-01-03 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self"

2017-01-03 Thread Claudio Freire

Claudio Freire added the comment:

Nice ideas, will give them a try

--

___
Python tracker 

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



[issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self"

2017-01-03 Thread Jeroen Demeyer

Jeroen Demeyer added the comment:

 If you are on POSIX, you could also use cysignals to get a 
traceback (simply import cysignals, which will install a handler for fatal 
signals like SIGSEGV).

--

___
Python tracker 

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



[issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self"

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

> The crash (the one we're experiencing) still happens with 2.7.13. But at this 
> point it's not clear whether it's a Python bug or a Cython bug, as jdemeyer's 
> patch doesn't fix it. We're having a hard time getting accurate backtraces to 
> actually debug this thing, as it only happens on production servers.

I suggest you to try faulthandler to try to get a traceback ;-)

--

___
Python tracker 

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



[issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self"

2017-01-03 Thread Claudio Freire

Claudio Freire added the comment:

The crash (the one we're experiencing) still happens with 2.7.13. But at this 
point it's not clear whether it's a Python bug or a Cython bug, as jdemeyer's 
patch doesn't fix it. We're having a hard time getting accurate backtraces to 
actually debug this thing, as it only happens on production servers.

--

___
Python tracker 

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



[issue28682] Bytes support in os.fwalk()

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue27671] FAQ: len() is still function for good reason.

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue28961] unittest.mock._Call ignores `name` parameter

2017-01-03 Thread Jiajun Huang

Jiajun Huang added the comment:

sorry about that, fixed.

--
Added file: http://bugs.python.org/file46126/mock.patch

___
Python tracker 

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



[issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self"

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

Claudio: "We're currently testing to try and reproduce the segfaults on 2.7.13, 
after that I'll try jdemeyer's patch and report the results."

Cool! Keep us in touch ;-)

--

___
Python tracker 

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



[issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self"

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

descr_ref-2.patch: patch rebased on the 2.7 branch.

--
Added file: http://bugs.python.org/file46125/descr_ref-2.patch

___
Python tracker 

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



[issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self"

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue29092] Sync os.stat's doc and doc string

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

Ignore my comment, I was thinking to something else (recent os.scandir change 
on Windows).

--

___
Python tracker 

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



[issue29092] Sync os.stat's doc and doc string

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

It's a recent change, before path type was always str.

--
nosy: +haypo, serhiy.storchaka

___
Python tracker 

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



[issue28969] lru_cache is not threadsafe

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue29090] PySerial crash on Windows XP and Python 3.4

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> out of date
status: open -> closed
title: python34.dll crash -> PySerial crash on Windows XP and Python 3.4

___
Python tracker 

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



[issue29090] python34.dll crash

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

> OS is Windows XP SP3

Oh wow, that's old! XP is not more supported by Python, but it's no more 
supported by Microsoft neither.

A crash can have various reasons. Usually, it's a buffer overflow or a race 
condition "somewhere". You should try to collect more information using 
faulthandler, or maybe using Visual Studio.
https://docs.python.org/dev/library/faulthandler.html

I suggest you to try to upgrade Windows and Python to more recent versions.

Anyway, as Zachary wrote, Python 3.4 is no more supported (only security fixes, 
nor more bug fixes).

--
nosy: +haypo

___
Python tracker 

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



[issue29096] unicode_concatenate() optimization is not signal-safe (not atomic)

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Signal Handlers reliably cause UnboundLocalErrors -> 
unicode_concatenate() optimization is not signal-safe (not atomic)
versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue28983] Windows: Python 3.5.2 won't install on my computer

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Python 3.5.2 won't install on my computer -> Windows: Python 3.5.2 won't 
install on my computer

___
Python tracker 

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



[issue28768] Warning: implicit declaration of function '_setmode'

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

Masayuki Yamamoto: Do you consider that Python 2.7 should be fixed as well? 
What is your use case for compiling Python 2.7 on Windows using Cygwin?

--

___
Python tracker 

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



[issue29142] urllib: no_proxy variable values with leading dot not properly handled

2017-01-03 Thread Thomas Loetzer

New submission from Thomas Loetzer:

Hi,

the fix for issue 26864 changed the behavior of urllib for no_proxy values with 
a leading dot to no longer match anything. This seems to be caused by always 
adding an additional dot between the hostname being checked and the entry.

Example:
no_proxy = '.company.internal'

I would expect 'somehost.company.internal' to be accessed without proxy, but 
this is not actually the case. Changing no_proxy to company.internal changes 
this and the host is accessed without proxy.

Python 2.7.11 and curl both handle this case fine and the proxy is not used.

Regards,
Thomas

--
components: Library (Lib)
messages: 284565
nosy: tloetzer
priority: normal
severity: normal
status: open
title: urllib: no_proxy variable values with leading dot not properly handled
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



[issue28961] unittest.mock._Call ignores `name` parameter

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

Please remove "import ipdb; ipdb.set_trace() # TODO remove it" before posting 
patches ;-)

--
nosy: +haypo

___
Python tracker 

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



[issue29140] time_hash() reads the wrong bytes to get microseconds

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +3.6regression

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
title: datetime.fromtimestamp() does crash for very small or very big timestamp 
-> datetime.fromtimestamp() doesn't check min/max year anymore: regression of 
Python 3.6

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +3.6regression

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() does crash for very small or very big timestamp

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

Attached datetime_check_args.patch fixes the issue: move argument checks into 
time(), date() and datetime() constructors of the _datetime module.

The patch requires the fix of the issue #29140 (time_hash bug), otherwise unit 
tests fail.

This issue is a regression introduced the implementation of the PEP 495. In 
Python 3.5, datetime_from_timet_and_us() calls datetime constructor which 
checks argument. In Python 3.6, datetime_from_timet_and_us() calls directly 
new_datetime_ex2() which doesn't check arguments anymore.

datetime_check_args.patch makes the _datetime module generally safer, not only 
for the report bug, because new_datetime_ex2() can be called by different ways, 
for example from the C API: "PyDateTime_CAPI".

The bug always shows a major lack of unit test in 
datetime.datetime.fromtimestamp() on dates out of the 0001-01-01 .. -12-31 
range. In Python 3.6, datetime.fromtimestamp() can create invalid datetime 
object greater than datetime.max!

$ python3.6 -c 'import datetime; print(datetime.datetime.fromtimestamp(2**38))'
10680-07-14 08:09:04

TODO: add unit tests.

--
keywords: +patch
nosy: +haypo
title: Core dump / OverflowError for datetime.fromtimestamp with overly large 
timestamp in Ubuntu 12.04 -> datetime.fromtimestamp() does crash for very small 
or very big timestamp
versions: +Python 3.7
Added file: http://bugs.python.org/file46124/datetime_check_args.patch

___
Python tracker 

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



[issue29141] error in 2to3

2017-01-03 Thread Sandeep Srinivasa

New submission from Sandeep Srinivasa:

docs_uploaded_at = dict(filter(lambda (x,y):True if len(y) == 3 else 
False,docs_uploaded_at.iteritems()))

produces

docs_uploaded_at = dict([x_y for x_y in iter(docs_uploaded_at.items()) if True 
if len(x_y[1]) == 3 else False])


without_transaction_users = filter(lambda x:False if x.phone in 
with_transaction_mobile else True,registered)

produces

without_transaction_users = [x for x in registered if False if x.phone in 
with_transaction_mobile else True]

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 284562
nosy: Sandeep Srinivasa
priority: normal
severity: normal
status: open
title: error in 2to3

___
Python tracker 

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



[issue29140] time_hash() reads the wrong bytes to get microseconds

2017-01-03 Thread STINNER Victor

New submission from STINNER Victor:

When the time is folded, time_hash() uses DATE_xxx() macros, instead of 
TIME_xxx() macros, and so reads microseconds from the wrong bytes.

Bug introduced by the implementation of the PEP 495 (Local Time Disambiguation).

#define PyDateTime_DATE_GET_MICROSECOND(o)  \
PyDateTime_DateTime*)o)->data[7] << 16) |   \
 (((PyDateTime_DateTime*)o)->data[8] << 8)  |   \
  ((PyDateTime_DateTime*)o)->data[9])

#define PyDateTime_TIME_GET_MICROSECOND(o)  \
PyDateTime_Time*)o)->data[3] << 16) |   \
 (((PyDateTime_Time*)o)->data[4] << 8)  |   \
  ((PyDateTime_Time*)o)->data[5])

Attached patch fixes time_hash().

I guess that it's a dummy copy-paste issue.

--
components: Library (Lib)
files: time_hash.patch
keywords: patch
messages: 284561
nosy: belopolsky, haypo
priority: normal
severity: normal
status: open
title: time_hash() reads the wrong bytes to get microseconds
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46123/time_hash.patch

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2017-01-03 Thread Ezio Melotti

Ezio Melotti added the comment:

> The +SKIP option and the testsetup and teardown directives are not visible in 
> the output.

So feel free to use them when needed :)

> But as you can see in issue28860, I was asked to add it. Before going
> on, I think we should have a clear policy about it.

If the priority is making the test pass, then adding sorted() is a viable 
solution -- if keeping the examples simple and to the point has higher 
priority, then the test could be skipped.  The priority depends on the case.

> An example could be wrong also if all the related unittests pass and
> it is still updated: there could be a typo in the code or in the 
> output, a missing import, and other kind of errors or lacks that make > the 
> example not working, getting confused the reader.

True.  In general, I think most of the current examples are fine, and whoever 
adds new ones or changes the behavior should take care that the examples 
(still) work.  If there is a mistake in an untested example, hopefully someone 
will report it.  While it's true that these mistakes might cause confusion, the 
same could be said for other changes done to the code to make the test pass 
(Why do I need to call sorted()/list()/etc.?  Why there are '...' in the 
output, is this an actual terminal session? etc.). 

> Ok to break the patch in more patches, but I did not get if you want
> me to open a new issue for each patch, or attach all the patches here 
> in this issue. Thanks again

It's probably fine to keep the discussion and patches on this issue, unless you 
prefer to handle discussions about specific parts separately -- just make sure 
that it's clear from the file description what patches should be applied.
As for the number of patches, probably 2-4 files are enough (e.g. one file 
could include all the trivial addition of +SKIP/.. doctest::, another the more 
"controversial" changes that add new files).

--

___
Python tracker 

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



[issue28845] Clean up known issues for AIX

2017-01-03 Thread Michael Felt

Michael Felt added the comment:

I request that you review issue27435 - in particular msg284557 - as I feel 
ctypes implementation for AIX is broken - at least as far as the supporting 
routines are concerned.

When you know the "magic" one can call ctypes.CDLL() and it 'works'. 
ctypes.util.find_library() always returns None (maybe it works if a stack of 
GNU tools are also loaded, but not on a 'generic' AIX install)

ctypes.LibraryLoader() is always successful (i.e., no Traceback) but I am 
(personally) unsure of the actual return value. It feels like a false positive.

Thank you for your time and consideration!

p.s. - a "fix/patch" is nearly accepted for Python3.7 (see issue26439) - needs 
more for the docs - however, I feel is is a great short-coming to limit this to 
versions that are yet to come!

--

___
Python tracker 

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



[issue29104] Left bracket remains in format string result when '\' preceeds it

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

The PEP 498 should be updated to define the expected behaviour of f'\{5}':
https://www.python.org/dev/peps/pep-0498/#escape-sequences

+self.assertEqual(f'\{6*7}', '\\42')
+self.assertEqual(f'\\{6*7}', '\\42')
+self.assertEqual(fr'\{6*7}', '\\42')
+
+AMPERSAND = 123
+self.assertEqual(f'\N{AMPERSAND}', '&')
+self.assertEqual(f'\\N{AMPERSAND}', '\\N123')
+self.assertEqual(fr'\N{AMPERSAND}', '\\N123')
+self.assertEqual(f'\\\N{AMPERSAND}', '\\&')

I'm not sure that I like this behaviour.

f'\\N{AMPERSAND}': reading a local variable looks like a typo or a security 
vulnerability, rather than a nice feature.

IMHO if you want an anti-slash (\) in the output string, it *must* be written 
"\\" since we *do* interpret other escape sequences:

* f'\n' returns '\n', the newline character U+000A
* f'\N{Snowman}' returns the nice snowman character U+2603 (☃)
* etc.

What is the issue with having to write "\\{10}" to get "\\10" string? It's less 
error prone.

--
nosy: +haypo

___
Python tracker 

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



[issue29117] dir() should include dunder attributes of the unbound method

2017-01-03 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue27435] ctypes library loading and AIX - also for 2.7.X (and later)

2017-01-03 Thread Michael Felt

Michael Felt added the comment:

Again, I would like to draw attention to this issue - BECAUSE -

it is possible to use ctypes.CDLL() ASIS, on AIX - however, 
ctypes.util.find_library() always seems to fail (i.e., returns None even when a 
.so file exists)

When the library names are hard-coded, rather than found by find_library() 
everything seems to work fine.

In short, I hope this will finally be recognized as a bug 
(ctypes.util.find_library()).

Ideally, RTLD_MEMBER logic would be added to the Lib/ctypes/__init__.py so that 
CDLL does not have to have RTLD_MEMBER added manually as it does now.

(I have not yet figured out how to use LibraryLoader() properly, it seems to 
never complain, or behave the same as ctypes.CDLL(None) which returns the 
"python process" namespace - if I understand that correctly.

p.s. a) I have a newer patch; b) PEP 8, etc. pickyness is encouraged (i.e., 
expect multiple iterations before a patch is accepted - I do not mind learning 
PEP 8 et al.);

imho - nothing new is being added to what python2 (and python3!) already can 
do. However, a fix to make it easier and clearer to use (there must be a PEP 
for that case as well) - is warranted.


Preparation:
a) the contents of the archive (example)
root@x064:[/data/prj/python/python-2.7.12.0]ar -Xany tv /usr/lib/libcurses.a
rwxr-xr-x   300/300   499495 Sep 26 22:35 2007 shr42.o
rwxr-xr-x   300/300   321459 Sep 26 22:04 2007 shr4.o
rwxr-xr-x   300/300   197552 Sep 26 22:04 2007 shr.o
rwxr-xr-x   300/300   591888 Sep 26 22:35 2007 shr42_64.o

b) create a empty .so file - MAYBE this will be found by the so-called "posix"
   routine in ctypes.util.find_library

root@x064:[/data/prj/python/python2-2.7.13]touch /usr/lib/libcurses.so

c) A test program
import sys
import ctypes
from ctypes import util

if sys.platform[:3] == "aix":
print ctypes.util.find_library("curses")
RTLD_MEMBER =  0x0004
if (sys.maxsize < 2**32):
print 32
print ctypes.CDLL("libcurses.a(shr.o)", RTLD_MEMBER)
else:
print 64
print ctypes.CDLL("libcurses.a(shr42_64.o)", RTLD_MEMBER)

Testing:
a) notice "None" as value printed by find_library
b) notice that ctypes.CDLL can load the library when RTLD_MEMBER isd added
root@x064:[/data/prj/python/python2-2.7.13]./python ../python2-2.7.13/test*.py
None
64


Changes:
-- since /usr/lib/libcurses.so is an empty file
   MAYBE - that is why the result was None
-- extract the 64-bit member and rename as /usr/lib/libcurses.so
-- test both find_library (still says None!) and CDLL of the extracted member
-- as it also loads, CDLL, i.e., dlopen(), works without RTLD_MEMBER
   (as it should)
-- there does not appear top be anything wrong with ctypes.CDLL,
   but only with the 'utils' included

root@x064:[/data/prj/python/python2-2.7.13]ar x /usr/lib/libcurses.a shr42_64.o
root@x064:[/data/prj/python/python2-2.7.13]mv shr42_64.o /usr/lib/libcurses.so

import sys
import ctypes
from ctypes import util

if sys.platform[:3] == "aix":
print ctypes.util.find_library("curses")
RTLD_MEMBER =  0x0004
if (sys.maxsize < 2**32):
print 32
print ctypes.CDLL("libcurses.a(shr.o)", RTLD_MEMBER)
else:
print 64
print ctypes.CDLL("libcurses.a(shr42_64.o)", RTLD_MEMBER)
print ctypes.CDLL("libcurses.so")

root@x064:[/data/prj/python/python2-2.7.13]./python ../python2-2.7.13/test*.py
None
64



Verification of (expected) behavior:
a) CDLL in both formats returns the same function pointer for 'addch'
b) LibraryLoader always returns something, even when it is nonsense
c) CDLL - fails - aka Traceback - when an argument cannot be loaded

from ctypes import util

if sys.platform[:3] == "aix":
print ctypes.util.find_library("curses")
RTLD_MEMBER =  0x0004
if (sys.maxsize < 2**32):
print 32
print ctypes.CDLL("libcurses.a(shr.o)", RTLD_MEMBER)
else:
print 64
print ctypes.CDLL("libcurses.a(shr42_64.o)", RTLD_MEMBER)
lib = ctypes.CDLL("libcurses.a(shr42_64.o)", RTLD_MEMBER)
if hasattr(lib, 'addch'):
print "addch found"
print lib.addch
else:
print "addch not found"
print ctypes.CDLL(None)
lib = ctypes.CDLL(None)
if hasattr(lib, 'addch'):
print "addch found"
print lib.addch
else:
print "addch not found"
print ctypes.CDLL("libcurses.so")
lib = ctypes.CDLL("libcurses.so")
if hasattr(lib, 'addch'):
print "addch found"
print lib.addch
else:
print "addch not found"
print "LibraryLoader tests"
print ctypes.LibraryLoader("libcurses.so")
lib = ctypes.LibraryLoader("libcurses.so")
print ctypes.LibraryLoader(None)
print ctypes.LibraryLoader("libcurses.a(shr42_64.o)")
print ctypes.LibraryLoader("libc.a(shr_64.o)")
print "LibraryLoader XXX tests show 

[issue29028] Use-After-Free in PyString_FromStringAndSize() of stringobject.c

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue29097] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue29130] Exit code 120 returned from Python unit test testing SystemExit

2017-01-03 Thread John Hagen

John Hagen added the comment:

I'm completely fine with closing this issue. Thanks for the help everyone.

If someone else doesn't close it in a couple days, I'll do it.

--

___
Python tracker 

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



[issue28911] Clarify the behaviour of assert_called_once_with

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue29063] Fixed timemodule compile warnings.

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

Not checking for integer overflow is more likely to hide bugs. Handling time is 
an hard problem, see a recent funny (or not) story from Cloudfare with the 
latest leap second added at midnight the 2016-12-31:
https://blog.cloudflare.com/how-and-why-the-leap-second-affected-cloudflare-dns/

Extract: "RRDNS is written in Go and uses Go’s time.Now() function to get the 
time. Unfortunately, this function does not guarantee monotonicity. Go 
currently doesn’t offer a monotonic time source (see issue 12914 for 
discussion)."

Hopefully, Python has time.monotonic() since Python 3.3 ;-)

--

___
Python tracker 

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



[issue29063] Fixed timemodule compile warnings.

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

The warning was introduced by a recent change:

changeset:   103680:a96101dd105c
user:Alexander Belopolsky 
date:Sun Sep 11 22:55:16 2016 -0400
files:   Doc/library/time.rst Misc/NEWS Modules/timemodule.c
description:
Closes #25283: Make tm_gmtoff and tm_zone available on all platforms.

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



[issue29063] Fixed timemodule compile warnings.

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

Downcasting to int doesn't seem good to me.

gmtoff_time_t.patch uses time_t instead of an int to store gmtoff. It raises an 
OverflowError if the value doesn't fit into a C long (at least max is at least 
2^31).

I guess that the issue only impacts Windows, I expect that most platforms have 
a tm_zone field in the "tm" structure?

/* Define to 1 if `tm_zone' is a member of `struct tm'. */
#define HAVE_STRUCT_TM_TM_ZONE 1

--
nosy: +haypo
Added file: http://bugs.python.org/file46122/gmtoff_time_t.patch

___
Python tracker 

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



[issue29070] Integration tests for pty.spawn on Linux and all other platforms

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

> That used to be true in FBSD, but then someone fixed (?) it, and now the 
> master side simply returns EOF when read-from.

Is it a behaviour change in a new version of Python? Or a change in FreeBSD? I 
don't understand.

--

___
Python tracker 

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



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue29054] pty.py: pty.spawn hangs after client disconnect over nc (netcat)

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue29020] email: collapse_rfc2231_value has inconsistent unquoting

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
title: collapse_rfc2231_value has inconsistent unquoting -> email: 
collapse_rfc2231_value has inconsistent unquoting

___
Python tracker 

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



[issue29053] mailbox: Implement >From_ decoding on input from mbox

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Implement >From_ decoding on input from mbox -> mailbox: Implement 
>From_ decoding on input from mbox

___
Python tracker 

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



[issue28945] email: get_boundary (and get_filename) invokes unquote twice

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
title: get_boundary (and get_filename) invokes unquote twice -> email: 
get_boundary (and get_filename) invokes unquote twice

___
Python tracker 

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



[issue29130] Exit code 120 returned from Python unit test testing SystemExit

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

This issue is not a bug in Python, but a bug in the author's code. I suggest to 
close the issue, since enough clues have been provided to fix the author's 
issue.

--
nosy: +haypo

___
Python tracker 

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



[issue28845] Clean up known issues for AIX

2017-01-03 Thread Michael Felt

Michael Felt added the comment:

FWIW: just build python-2.7.13 using xlC - and ncurses-6.0 installed.

root@x064:[/data/prj/python/python2-2.7.13]
root@x064:[/data/prj/python/python2-2.7.13]./python
Python 2.7.13 (default, Jan  3 2017, 11:16:59) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.
>>> import curses
>>> from curses import panel
>>> def mkpanel(scr):
...  win = curses.newwin(8,8,1,1)
...  pan = panel.new_panel(win)
...
>>> curses.wrapper(mkpanel)
>>>

So, even for AIX 5.3 and Python2.7 this test seems solved. If the above is all 
that is needed!

--

___
Python tracker 

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



[issue29139] operator.concat/iconcat could only work if left operand is a sequence

2017-01-03 Thread Xiang Zhang

Xiang Zhang added the comment:

> You can use operator.add() if you need to fall back to a __radd__ of the 
> right operand.

IMHO for sequences when defining __add__, __radd__, there is no difference 
between addition and concatenation, just as 
https://docs.python.org/3/reference/datamodel.html#emulating-container-types 
states. So it's confusing for me why must I use operator.add not 
operator.concate?

> operator.concat() is Python API to the sq_concat slot. It falls back to 
> __add__() just because instances of user classes defining an __add__() method 
> only have an nb_add slot, not an sq_concat slot.

More like a implementation detail for me. Users writing only Python won't 
realize such things.

> Third-party classes (maybe NumPy arrays, I don't know) can have different 
> implementations of sq_concat and nb_add.

Does this matter? Anyway operator.concat will fall to '+'. My intent is 
proposing something like:

if not hasattr(a, '__getitem__') and not hasattr(b, '__getitem__')

--

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2017-01-03 Thread Marco Buttu

Marco Buttu added the comment:

Hi Ezio, thanks for your time :) The +SKIP option and the testsetup and 
teardown directives are not visible in the output. The only extra code in the 
output is sorted(). I agree with you about the use of sorted(), and I think we 
do not have to add extra code just to make the example passes. But as you can 
see in issue28860, I was asked to add it. Before going on, I think we should 
have a clear policy about it.

I also think the examples are there do document, but I believe there are good 
reasons to test them. In fact, unittests and doctests have complete diffent 
purposes: the goal of doctests is to verify the examples work properly, that's 
all. An example could be wrong also if all the related unittests pass and it is 
still updated: there could be a typo in the code or in the output, a missing 
import, and other kind of errors or lacks that make the example not working, 
getting confused the reader. Unluckily there is not just the downside you 
pointed out :/

Ok to break the patch in more patches, but I did not get if you want me to open 
a new issue for each patch, or attach all the patches here in this issue. 
Thanks again

--

___
Python tracker 

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



[issue29134] contextlib doc bug

2017-01-03 Thread SilentGhost

Changes by SilentGhost :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
stage:  -> patch review
type:  -> behavior
versions: +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



  1   2   >