[issue6500] urllib2 maximum recursion depth exceeded

2016-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d34fdd1736f2 by Serhiy Storchaka in branch '2.7':
Issue #6500: Fixed infinite recursion in urllib2.Request.__getattr__().
https://hg.python.org/cpython/rev/d34fdd1736f2

--

___
Python tracker 

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



[issue26121] Use C99 functions in math if available

2016-01-18 Thread Mark Dickinson

Mark Dickinson added the comment:

LGTM. What platform are the benchmarks on?

Is there some way that this can be submitted to the buildbots *before* applying 
to the 3.6 branch, so that we can get a sense of how widespread (if at all) 
libm problems are?

--

___
Python tracker 

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



[issue26100] PEP 511: Add test.support.optim_args_from_interpreter_flags()

2016-01-18 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Add test.support.optim_args_from_interpreter_flags() -> PEP 511: Add 
test.support.optim_args_from_interpreter_flags()

___
Python tracker 

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



[issue6500] urllib2 maximum recursion depth exceeded

2016-01-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for the review Senthil.

--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

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



[issue26100] Add test.support.optim_args_from_interpreter_flags()

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

Lib/distutils/util.py must also be modified: see attached distutils.patch.

--
Added file: http://bugs.python.org/file41642/distutils.patch

___
Python tracker 

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



[issue26121] Use C99 functions in math if available

2016-01-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The benchmarks were ran on 32-bit Linux with AMD processor.

I'll try to run custom build on buildbots.

--

___
Python tracker 

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



[issue26145] PEP 511: Add sys.set_code_transformers()

2016-01-18 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch implements the largest part of the PEP 511:

* add sys.get_code_transformers() and sys.set_code_transformers()
* add sys.implementation.optim_tag
* add -o command line option setting sys.implementation.optim_tag
* modify importlib to use sys.implementation.optim_tag to build .pyc filenames
* modify importlib to raise an ImportError when the .pyc file is missing, the 
.py is available, and the optimizer tag created from code transformers is 
different than the current sys.implementation.optim_tag
* add Lib/test/test_pep511.py: test changes especially bytecode and AST 
transformers
* add a PeepholeOptimizer object created by default for 
sys.set_code_transformers()
* skip the peephole optimizer when -o noopt is used
* add sys field to the PyInterpreterState structure: used by 
_PySys_GetCodeTransformers() to get code transformers
* update unit tests to use the optimizer to create the .pyc filename

An optimizer tag must contain characters: '.', '-', directory separators or NUL 
character.

Brett Canon proposed to not include the optimizer tag in .pyc filenames if it 
is "opt" to limit backward incompatible changes.

Note: The PEP 511 is under discussion on python-ideas. The patch implements the 
first version of the PEP, sent to python-ideas, so it doesn't include proposed 
changes like changing code_transformer() prototype to "def 
code_transformer(self, code, context)".

See also the issue #26100: add test.support.optim_args_from_interpreter_flags().

--
files: transformers.patch
keywords: patch
messages: 258509
nosy: brett.cannon, haypo
priority: normal
severity: normal
status: open
title: PEP 511: Add sys.set_code_transformers()
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file41643/transformers.patch

___
Python tracker 

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



[issue26099] site ignores ImportError when running sitecustomize and usercustomize

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

Example of the bug:


$ cat Lib/sitecustomize.py
print("before")
import xxx
print("after")

haypo@smithers$ ./python -q -c pass
before


The line "after" is not executed and *no* error nor warning is raised. With the 
patch:


$ ./python -q -c pass
before
Error in sitecustomize; set PYTHONVERBOSE for traceback:
ImportError: No module named 'xxx'

$ PYTHONVERBOSE=1 ./python -q -c pass
(...)
# /home/haypo/prog/python/3.5/Lib/__pycache__/sitecustomize.cpython-35.pyc 
matches /home/haypo/prog/python/3.5/Lib/sitecustomize.py
# code object from 
'/home/haypo/prog/python/3.5/Lib/__pycache__/sitecustomize.cpython-35.pyc'
before
Traceback (most recent call last):
  File "/home/haypo/prog/python/3.5/Lib/site.py", line 508, in execsitecustomize
import sitecustomize
  File "", line 969, in _find_and_load
  File "", line 958, in _find_and_load_unlocked
  File "", line 673, in _load_unlocked
  File "", line 662, in exec_module
  File "", line 222, in _call_with_frames_removed
  File "/home/haypo/prog/python/3.5/Lib/sitecustomize.py", line 2, in 
import xxx
  File "", line 969, in _find_and_load
  File "", line 956, in _find_and_load_unlocked
ImportError: No module named 'xxx'
# destroy sitecustomize
(...)


Brett Cannon: "This is a change in semantics."

Can you please elaborate? Even if importing sitecustomize changes, Python 
continue its execution. Only a warning is emited.

Brett Cannon: "It might be better to log an ImportWarning when the import fails 
and keep the current semantics (and be careful about importing warnings)."

With my patch, a message "Error in sitecustomize; set PYTHONVERBOSE for 
traceback:" is logged. I used the same behaviour then the code to handle site 
import.

Note: I found this issue when I worked on the PEP 511 to register a code 
transformer at startup. The bug is really annoying: the code transformers may 
or may not be registered depending if required modules can be important, I 
expect an error (or at least a warning).

--

___
Python tracker 

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



[issue26145] PEP 511: Add sys.set_code_transformers()

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

Missing patch for test_sys testing the new sys.get/set_code_transformers() 
functions.

--
Added file: http://bugs.python.org/file41644/test_sys.patch

___
Python tracker 

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



[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread STINNER Victor

Changes by STINNER Victor :


--
title: code.co_lnotab: use signed line number delta to support moving 
instructions in an optimizer -> PEP 511: code.co_lnotab: use signed line number 
delta to support moving instructions in an optimizer

___
Python tracker 

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



[issue26101] Lib/test/test_compileall.py fails when run directly

2016-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c6a0f424837a by Victor Stinner in branch 'default':
Fix test_compilepath() of test_compileall
https://hg.python.org/cpython/rev/c6a0f424837a

--
nosy: +python-dev

___
Python tracker 

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



[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

Patch version 2 to take Serhiy's review in account:

* complete Objects/lnotab_notes.txt update. Replace (300, 300) delta example 
with (300, 200) delta for better readability (300 is the bytecode offset delta, 
200 is the line number delta)
* fix added assertion in peephole: don't check the reference counter for empty 
byte string (which can be the empty byte string singleton)
* restore addrmap name in peephole
* don't change importlib MAGIC: we only change it between Python minor 
versions, it was already changed for Python 3.6a0
* assemble_lnotab() divide with positive numbers to avoid undefined behaviour 
on C
* dis.py: use "if line_incr >= 0x80: line_incr -= 0x100" instead of 
struct.unpack() to convert unsigned to signed

Note: avoid also useless "if (x != NULL)" checks before calling PyMem_Free(). 
PyMem_Free(NULL) is well specified: do nothing.

--
Added file: http://bugs.python.org/file41645/lnotab-2.patch

___
Python tracker 

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



[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

Patch version 3:

* When I reviewed issue #16956 patch, I noticed that I forgot to extract my 
changes on codeobject.c :-/ (FAT Python became a giant patch, it's hard to 
browse it!)
* Fix typo in dis.py (regression of patch 2)

--
Added file: http://bugs.python.org/file41646/lnotab-3.patch

___
Python tracker 

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



[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

> A patch was proposed in issue16956. And issue17611 is related.

I don't see directly the link between this issue and the issue17611, but cool 
if it helps to implement new optimizations :-)

I compared my patch with issue16956 patch:

* my patch mentions also the change in Lib/importlib/_bootstrap_external.py
* my patch updates also dis.py
* my patch updates also Objects/lnotab_notes.txt
* issue16956 patch changes compiler_while(), this change is not directly 
related to making line number delta signed

Additionally, my patch uses better names in the peephole optimizer, but it's 
not directly related to the issue. By the way, this change should be commited 
in a separated patch.

I prefer to push my recent. By the way, it's up to date, whereas issue16956 
patch requires a rebase.

--

___
Python tracker 

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



[issue26101] Lib/test/test_compileall.py fails when run directly

2016-01-18 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +Tests
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue26100] PEP 511: Add test.support.optim_args_from_interpreter_flags()

2016-01-18 Thread STINNER Victor

Changes by STINNER Victor :


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

___
Python tracker 

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



[issue26100] PEP 511: Add test.support.optim_args_from_interpreter_flags()

2016-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ac6d33317eda by Victor Stinner in branch 'default':
subprocess._optim_args_from_interpreter_flags()
https://hg.python.org/cpython/rev/ac6d33317eda

--
nosy: +python-dev

___
Python tracker 

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



[issue13886] readline-related test_builtin failure

2016-01-18 Thread Martin Panter

Martin Panter added the comment:

I don’t think this affects Python 2. The failing tests were added in revision 
421c8e291221, Issue 13342, for 3.2+ only. They invole input() doing text 
decoding. AFAIK Python 2’s equivalent, raw_input(), does not do text decoding.

I suspect we can’t really change how Readline handles text encoding errors, 
which seems to be what Nadeem was trying to do. I suggest to just fix the tests 
without changing Readline.

As far as I know there is no way to un-register the Readline module once it has 
been loaded. A quick and dirty workaround might be to skip the test(s) if the 
Readline has been loaded ("readline" in sys.modules). But a better fix would 
probably be to run the test in a subprocess, where we can start a new 
interpreter from scratch and control whether Readline is loaded.

Looking closer at the tests, they mention invoking Gnu Readline. But the 
associated bug fix is in the wrapper code around PyOS_Readline(), which may 
call Gnu Readline if it is loaded, or may call a simpler internal routine 
otherwise. So ideally the tests should be repeated with Readline unloaded and 
loaded.

Also, the comment for test_input_tty_non_ascii() implies it is testing UTF-8 
encoding. But the data is not valid UTF-8 so it ends up testing the error 
handling. I think that test should use valid UTF-8 input.

--
components: +Tests -Extension Modules
nosy: +martin.panter
versions: +Python 3.5, Python 3.6 -Python 2.7, Python 3.2, 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



[issue26139] libmpdec: disable /W4 warning (non-standard dllimport behavior)

2016-01-18 Thread Stefan Krah

Stefan Krah added the comment:

This is *exactly* what I want.  As the sole author of libmpdec I *know*
that the broken dllimport behavior cannot affect anything in memory.c,
since there are no function pointer comparisons.

Please stop educating us.

--

___
Python tracker 

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



[issue26139] libmpdec: disable /W4 warning (non-standard dllimport behavior)

2016-01-18 Thread Alexander Riccio

Alexander Riccio added the comment:

> Please stop educating us.

Sorry, not what was intended! Tone transmits poorly.

--

___
Python tracker 

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



[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, you patch supersedes issue16956 patch.

Added new comments on Rietveld for lnotab_notes.txt.

I afraid this patch can cause problems with code tracing where it is assumed 
that lines are increased monotonically and *instr_lb <= frame->f_lasti < 
*instr_ub. We should carefully analyze the effect of the patch on the tracing.

Before committing you must ask Guido for approval. AFAIK his had objections 
against code transformations that make debugging harder.

--

___
Python tracker 

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



[issue26140] inspect.iscoroutinefunction raises TypeError when checks Mock of function or coroutinefunction

2016-01-18 Thread Hiroyuki Takagi

Hiroyuki Takagi added the comment:

Thank you for review and comment.

Honestly speaking, I couldn't find any other good place to fix it.

One possible solution might be to use isinstance(mock, Mock) in 
iscoroutinefunction, but I don't think it's good for inspect module to add 
special check and depend on unittest.mock. Mocks are usually used only in 
debug/test, but iscoroutinefunction is used in production code. Adding some 
check to iscoroutinefunction only for test is not good for performance (though, 
actually its effect will be very small).

The reasons why I think this behavior should be fixed are,

- Raising error and stopping test is not kind for mock users
- After the patch (issue25599), no mock object can become `True` to 
iscoroutinefunction, which will make it impossible to test the block after 
if-iscoroutinefunction by using mock.


Now, I checked inspect module again, and found one more unexpected behavior 
(not error).

>>> def a(): yield 1
>>> inspect.isgeneratorfunction(a)
True

>>> inspect.isgeneratorfunction(Mock(a))
False

With the patch, inspect.isgeneratorfunction(Mock(a)) returns True.

--

___
Python tracker 

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



[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

We have many unit test in the Python test suite which rely on exact line 
numbers. Examples:

* test_sys_settrace
* test_pdb
* test_dis

I know them because they were all broken when my fatoptimizer project had bugs 
related to line numbers :-)

With my patch, the full Python test suite pass whereas my patch doesn't modify 
any test.


> I afraid this patch can cause problems with code tracing where it is assumed 
> that lines are increased monotonically and *instr_lb <= frame->f_lasti < 
> *instr_ub. We should carefully analyze the effect of the patch on the tracing.

First, my patch has no impact on frame->f_lasti.

The trace module and test_sys_settrace use frame.f_lineno which 
PyFrame_GetLineNumber(). This function returns f->f_lineno if the frame has a 
trace function, or PyCode_Addr2Line(). PyCode_Addr2Line() and 
PyFrame_GetLineNumber() still work with my patch.

When you trace a program, "negative line delta" and "negative instruction 
offset" are not new in Python: it's a basic requirement to support loop, when 
you compare two instructions seen by the tracer.

To be clear, my patch does *not* introduce negative line number delta in 
co_lnotab. It only *adds support* for negative line number delta. If a tool 
decodes co_lnotab using 8-bit unsigned number for line number delta, the tool 
still works even with the patch. It only starts to return wrong line numbers if 
you start debugging a program which has negative line numbers.

If you use fatoptimizer, you get such negative delta. But if you use an 
optimizer, you should be prepared to some subtle differences. The good practice 
is to disable all optimizers when you debug code. It's also really hard (or 
impossible) to debug C code optimized with -O3. I always use gcc -O0 to debug 
CPython.


> Before committing you must ask Guido for approval. AFAIK his had objections 
> against code transformations that make debugging harder.

Are you aware of tools decoding directly co_lnotab?

Oh, I forgot the old Misc/gdbinit script which *does* decode directly 
co_lnotab. Does anyone still use it? If yes, it should also be updated.

I failed to reproduce the bug with Misc/gdbinit, beacuse bug only occurs if you 
debug a program which uses negative line number, and CPython doesn't produce 
negative line number in co_lnotab by default... So it would be "nice" to also 
support negative line number in Misc/gdbinit, but maybe it's ok to let this old 
script dying? :-D

--

___
Python tracker 

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



[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

> Are you aware of tools decoding directly co_lnotab?

Ah! I found Ned Batchelder's coverage project which has a _bytes_lines() method 
"adapted from dis.py in the standard library". The method uses directly 
co_lnotab to compute line numbers.

Ok, *this project* will have to be updated if it wants to support fatoptimizer 
and other code transformers producing negative line numbers.

Maybe I can contribute to it with a patch if my change to CPython 3.6 is 
accepted ;-)

--

___
Python tracker 

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



[issue26119] Windows Installer can sometimes silently fail pip stage

2016-01-18 Thread Paul Hammant

Paul Hammant added the comment:

That's all the files in the %TEMP% dir beginning with Python* - right?

--

___
Python tracker 

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



[issue26129] Difference in behaviour with grp.getgrgid and pwd.getpwuid

2016-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 65e0e06b70b6 by Serhiy Storchaka in branch 'default':
Issue #26129: Deprecated accepting non-integers in grp.getgrgid().
https://hg.python.org/cpython/rev/65e0e06b70b6

--
nosy: +python-dev

___
Python tracker 

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



[issue26129] Difference in behaviour with grp.getgrgid and pwd.getpwuid

2016-01-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Brett.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread Brett Cannon

Brett Cannon added the comment:

I just wanted to comment on "don't change importlib MAGIC: we only change it 
between Python minor versions": that's actually not true. Feel free to up the 
number whenever you make a change that affects eval.c or bytecode. Otherwise 
.pyc files won't be regenerated. And that number is cheap anyway and isn't 
about to run out, so don't worry about updating it multiple times before the 
code sees a public release.

--

___
Python tracker 

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



[issue26146] PEP 511: Add ast.Constant to allow AST optimizer to emit constants

2016-01-18 Thread STINNER Victor

New submission from STINNER Victor:

Currently, the Python parser emits ast.Tuple AST nodes which are compiled to 
multiple LOAD_xxx instructions followed a final BUILD_TUPLE instruction. The 
Python peephole optimizer detect LOAD_CONST x n + BUILD_TUPLE instructions to 
replace it directly with a tuple constant.

IHMO it's better to implement this optimization early at the AST level in an 
AST optimizer. The PEP 511 proposes to add a new ast.Constant AST node for that.

With this new AST node, the AST optimizer can emit tuple constants, but also 
any kind of constant like frozenset. For example, it's also possible to 
optimize "x in {1, 2}" to "x in frozenset({1, 2})" where frozenset({1, 2}) is a 
constant (don't call frozenset type at runtime). (Again, this optimization is 
already implemented in the peephole optimizer, it's just an example.)

Attached patch adds the new ast.Constant type but update also code consuming 
AST to handle this new kind of node:

* add the node: Parser/Python.asdl, Parser/asdl.py, Parser/asdl_c.py
* generated changes: Include/asdl.h, Include/Python-ast.h, Python/Python-ast.c
* accept the node kind: Python/symtable.c, Python/ast.c
* accept Constant instead of Num or Str: Lib/ast.py, Python/future.c, 
Tools/parser/unparse.py
* emit constants to bytecode: Python/compile.c

I didn't change the compiler to emit directly ast.Constant nodes to reduce the 
impact on the backward compatibility. This change can be done. An AST optimizer 
is responsible to convert NameConstant (False, True, None), Num (int, float, 
complex), Str, Bytes, Tuple to Constant. Example with fatoptimizer:
https://github.com/haypo/fatoptimizer/blob/2d794f511fe23ccde320725c6d12ce5ce8ffbdfe/fatoptimizer/convert_const.py

ast.Constant also simplifies AST optimizers: no need to check each time if a 
node is constant or not.

Adding a new kind of node was already proposed in the old issue #11549: the 
patch adds ast.Lit (it was proposed to rename it to ast.Literal).

--
files: constant.patch
keywords: patch
messages: 258528
nosy: benjamin.peterson, brett.cannon, haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: PEP 511: Add ast.Constant to allow AST optimizer to emit constants
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file41647/constant.patch

___
Python tracker 

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



[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

Brett Cannon added the comment:
> I just wanted to comment on "don't change importlib MAGIC: we only change it 
> between Python minor versions": that's actually not true. Feel free to up the 
> number whenever you make a change that affects eval.c or bytecode. Otherwise 
> .pyc files won't be regenerated. And that number is cheap anyway and isn't 
> about to run out, so don't worry about updating it multiple times before the 
> code sees a public release.

Since my patch may break setup of multiple python developers, it can
be worth to increase this number, ok :-)

--

___
Python tracker 

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



[issue25731] Assigning and deleting __new__ attr on the class does not allow to create instances of this class

2016-01-18 Thread Bohuslav "Slavek" Kabrda

Bohuslav "Slavek" Kabrda added the comment:

Hi, I'm maintainer of flexmock [1] and some users of my library have started 
hitting this bug [2] - when one tries to mock __new__ and then revert this mock 
at the end of testcase to the original one (either by deleting the mock __new__ 
or replacing mock __new__ by the old one), then one gets "TypeError: object() 
takes no parameters".

I think that solution proposed by Eryk is correct, but I don't have that much 
insight into Python internals to confirm that 100 %. I would appreciate this 
getting fixed. Thanks!

[1] https://github.com/bkabrda/flexmock
[2] https://github.com/bkabrda/flexmock/issues/13

--
nosy: +bkabrda

___
Python tracker 

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



[issue26146] PEP 511: Add ast.Constant to allow AST optimizer to emit constants

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

To support emiting constants from ast.Constant, we will also need the fix for 
the issue #25843. Currently, the compile merges constants (0, 0) and (0.0, 0.0) 
because they are equal, but item types are different.

--

___
Python tracker 

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



[issue25843] lambdas on the same line may incorrectly share code objects

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

FYI this issue is linked to the issue #26146 which allows to emit constants 
from an AST optimizer (see also the PEP 511).

--

___
Python tracker 

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



[issue557704] netrc module can't handle all passwords

2016-01-18 Thread R. David Murray

R. David Murray added the comment:

If it is a matter of following "the normal rules" about quoting in a place 
where we currently don't do that, I think it would be sensible to add it, but 
IMO it should be the full set of "normal rules".  Presumably shlex provides 
facilities to do that...I haven't looked at the netrc code in quite a while so 
I don't remember how it all fits together.

As for reopening the issue...there was something that was fixed here, so what 
we should do instead is open a new issue with your documentation about current 
reality, a quick summary of this discussion, and a mention of this issue as 
part of the backstory.

--

___
Python tracker 

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



[issue9006] xml-rpc Server object does not propagate the encoding to Unmarshaller

2016-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 04e95f05aafe by Serhiy Storchaka in branch '2.7':
Issue #9006: Added tests for XML RPC with non-UTF-8 encoding.
https://hg.python.org/cpython/rev/04e95f05aafe

New changeset 59cb8811286a by Serhiy Storchaka in branch '3.5':
Issue #9006: Added tests for XML RPC with non-UTF-8 encoding.
https://hg.python.org/cpython/rev/59cb8811286a

New changeset 96a7603d25ea by Serhiy Storchaka in branch 'default':
Issue #9006: Added tests for XML RPC with non-UTF-8 encoding.
https://hg.python.org/cpython/rev/96a7603d25ea

--
nosy: +python-dev

___
Python tracker 

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



[issue21847] Fix xmlrpc in unicodeless build

2016-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f602dfd35cd4 by Serhiy Storchaka in branch '2.7':
Issue #21847: Fixed xmlrpclib and tests on Unicode-disabled builds.
https://hg.python.org/cpython/rev/f602dfd35cd4

--
nosy: +python-dev

___
Python tracker 

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



[issue21847] Fix xmlrpc in unicodeless build

2016-01-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
dependencies:  -Fix unicodeless build of Python
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



[issue9006] xml-rpc Server object does not propagate the encoding to Unmarshaller

2016-01-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> rejected
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



[issue26146] PEP 511: Add ast.Constant to allow AST optimizer to emit constants

2016-01-18 Thread Brett Cannon

Brett Cannon added the comment:

Would it make sense to tag the type of the constant in the node somehow?

We also make no backwards-compatibility guarantees about the AST, so if it 
simplifies things to switch entirely to Constant from Num, etc. then I said do 
it.

--

___
Python tracker 

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



[issue26147] Encoding errors in xmlrpc

2016-01-18 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch fixes issue with sending non-encodable string via XML RPC. This 
issue caused raising an exception or even hanging.

--
components: Library (Lib), XML
files: xmlrpc_escape_nonencodable-3.x.patch
keywords: patch
messages: 258537
nosy: loewis, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Encoding errors in xmlrpc
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6
Added file: 
http://bugs.python.org/file41648/xmlrpc_escape_nonencodable-3.x.patch

___
Python tracker 

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



[issue26147] Encoding errors in xmlrpc

2016-01-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: 
http://bugs.python.org/file41649/xmlrpc_escape_nonencodable-2.7.patch

___
Python tracker 

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



[issue25843] lambdas on the same line may incorrectly share code objects

2016-01-18 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue26140] inspect.iscoroutinefunction raises TypeError when checks Mock of function or coroutinefunction

2016-01-18 Thread Yury Selivanov

Yury Selivanov added the comment:

It looks like this should be fixed in the mock module, as special casing it in 
inspect doesn't look right.  Unfortunately, I can't review this patch, as I 
don't know the mock module internals and I don't think I understand all 
consequences of this patch.

Michael, what do you think?

--
nosy: +michael.foord

___
Python tracker 

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



[issue26145] PEP 511: Add sys.set_code_transformers()

2016-01-18 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy: +yselivanov

___
Python tracker 

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



[issue25958] Implicit ABCs have no means of "anti-registration"

2016-01-18 Thread Andrew Barnert

Andrew Barnert added the comment:

Style changes based on Martin's review

--
Added file: http://bugs.python.org/file41650/patch5.diff

___
Python tracker 

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



[issue25958] Implicit ABCs have no means of "anti-registration"

2016-01-18 Thread Andrew Barnert

Changes by Andrew Barnert :


Removed file: http://bugs.python.org/file41650/patch5.diff

___
Python tracker 

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



[issue25958] Implicit ABCs have no means of "anti-registration"

2016-01-18 Thread Andrew Barnert

Changes by Andrew Barnert :


Added file: http://bugs.python.org/file41651/patch5.diff

___
Python tracker 

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



[issue26013] Pickle protocol 2.0 not loading in python 3.5

2016-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 270add17f203 by Serhiy Storchaka in branch '3.5':
Issue #26013: Added compatibility with broken protocol 2 pickles created
https://hg.python.org/cpython/rev/270add17f203

New changeset 35ff0976b211 by Serhiy Storchaka in branch 'default':
Issue #26013: Added compatibility with broken protocol 2 pickles created
https://hg.python.org/cpython/rev/35ff0976b211

--
nosy: +python-dev

___
Python tracker 

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



[issue26013] Pickle protocol 2.0 not loading in python 3.5

2016-01-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue16620] Avoid using private function glob.glob1() in msi module and tools

2016-01-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It looks to me that the glob() method of msilib.Directory is broken from the 
born. It uses the function from the glob module, but the glob module is not 
imported in this source file.

Even if add missed import, returned value is incorrect in Python 3. In Python 2 
glob.glob1() always returned a list, but in in Python 3 it can return an empty 
list or an iterator. After iterating on it msilib.Directory returns an empty 
list or exhausted iterator.

--
type: enhancement -> behavior
versions: +Python 2.7, Python 3.5

___
Python tracker 

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



[issue26148] String literals are not interned if in a tuple

2016-01-18 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Usually string literals are interned. But not if they are a part of constant 
tuple.

>>> def abc(): pass
... 
>>> x = 'abc'
>>> x is abc.__name__
True
>>> x = ('abc',)
>>> x[0] is abc.__name__
False

This makes effect on namedtuples (issue25981). May make effect on __slots__ or 
other uses of constant tuples since searching a value in a tuple when values 
are not identical is a little slower that when they are identical.

--
components: Interpreter Core
messages: 258542
nosy: benjamin.peterson, brett.cannon, georg.brandl, haypo, ncoghlan, 
rhettinger, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: String literals are not interned if in a tuple

___
Python tracker 

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



[issue26036] Unnecessary arguments on smtpd.SMTPServer

2016-01-18 Thread R. David Murray

Changes by R. David Murray :


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



[issue26146] PEP 511: Add ast.Constant to allow AST optimizer to emit constants

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

Brett Cannon: "Would it make sense to tag the type of the constant in the node 
somehow?"

It's easy to get the type of a constant: type(node.value). I like using 
isinstance().

Brett Cannon: "We also make no backwards-compatibility guarantees about the 
AST, so if it simplifies things to switch entirely to Constant from Num, etc. 
then I said do it."

Oh, I forgot an important point from the PEP: "[ast.Constant] does not contain 
line number and column offset informations on tuple or frozenset items." I 
don't know if it's an issue or not.

I prefer to move step by step. As I wrote, we can decide to use directly 
ast.Constant later, even before the Python 3.6 release.

--

___
Python tracker 

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



[issue26013] Pickle protocol 2.0 not loading in python 3.5

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

Buildbots are unhappy.

http://buildbot.python.org/all/builders/PPC64%20Fedora%203.5/builds/344/steps/test/logs/stdio

==
FAIL: test_reverse_import_mapping (test.test_pickle.CompatPickleTests) 
[('cStringIO', 'io')]
--
Traceback (most recent call last):
  File 
"/home/shager/cpython-buildarea/3.5.edelsohn-fedora-ppc64/build/Lib/test/test_pickle.py",
 line 353, in test_reverse_import_mapping
(module3, module2))
AssertionError: No reverse mapping from 'io' to 'cStringIO'

--
nosy: +haypo
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue26043] ON DELETE CASCADE does not work when using sqlite3 library

2016-01-18 Thread R. David Murray

Changes by R. David Murray :


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



[issue26013] Pickle protocol 2.0 not loading in python 3.5

2016-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7215d13baa2d by Serhiy Storchaka in branch '3.5':
Added exceptins for testing non-reversible import mapping for Issue #26013.
https://hg.python.org/cpython/rev/7215d13baa2d

New changeset 16cfc1652844 by Serhiy Storchaka in branch 'default':
Added exceptins for testing non-reversible import mapping for Issue #26013.
https://hg.python.org/cpython/rev/16cfc1652844

--

___
Python tracker 

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



[issue26013] Pickle protocol 2.0 not loading in python 3.5

2016-01-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Victor.

--

___
Python tracker 

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



[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-18 Thread R. David Murray

Changes by R. David Murray :


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



[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

But there is no need to increase it by 10. I suppose the gap is added to allow 
updating bytecode in maintained releases, but in process of developing next 
version we don't need this.

--

___
Python tracker 

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



[issue26092] doctest should allow custom sys.displayhook

2016-01-18 Thread R. David Murray

R. David Murray added the comment:

What problem does replacing __displayhook__ provoke?  What solution do you 
propose instead of 8048, which fixed a bug?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread Brett Cannon

Brett Cannon added the comment:

There's technically no need to worry about ranged values as the magic number is 
purely an equality check to see if the interpreter matches what the .pyc was 
created with. I guess there might be third-party code that does a range check, 
but that's bad as importlib checks the raw bytes only; using a number is mostly 
a convenience for changing it.

--

___
Python tracker 

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



[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-18 Thread R. David Murray

R. David Murray added the comment:

Quote is for quoting shell special characters, not command names.  It would be 
fairly straightforward to add that to the docs ("Return a version of the string 
s will with all shell special characters (including whitespace) escaped 
according to shell escaping rules."  Wordier, but more accurate, and not *too* 
much longer.

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



[issue26149] Suggest PyCharm Community as an editor for Unix platforms

2016-01-18 Thread John Hagen

New submission from John Hagen:

The Python documentation recommends editors that can be used on Unix:
https://docs.python.org/3.5/using/unix.html#editors

If the intent is to advertise very excellent IDEs (as Geany and Komodo Edit are 
listed), I suggest that PyCharm Community Edition 
(https://www.jetbrains.com/pycharm/download/) be added to the list.

It is free, has a very powerful static analyzer, comes with PEP8 checking 
installed by default, supports type hinting, ... 
(https://www.jetbrains.com/pycharm/features/)

--
assignee: docs@python
components: Documentation
messages: 258551
nosy: John Hagen, docs@python
priority: normal
severity: normal
status: open
title: Suggest PyCharm Community as an editor for Unix platforms
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The launcher on Windows does a range check.

--

___
Python tracker 

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



[issue16907] Distutils fails to build extension in path with spaces

2016-01-18 Thread Zachary Ware

Zachary Ware added the comment:

This isn't obviously a distutils bug, but sounds strikingly similar to #4508.  
Closing as a duplicate of #4508.

--
assignee: eric.araujo -> 
nosy: +zach.ware
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> distutils compiler not handling spaces in path to output/src 
files

___
Python tracker 

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



[issue26149] Suggest PyCharm Community as an editor for Unix platforms

2016-01-18 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report. It would be better to refer to 
https://wiki.python.org/moin/PythonEditors and 
https://wiki.python.org/moin/IntegratedDevelopmentEnvironments instead of 
maintaining duplicate and outdated lists.

--
keywords: +easy
nosy: +berker.peksag
stage:  -> needs patch
versions:  -Python 3.4

___
Python tracker 

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



[issue26119] Windows Installer can sometimes silently fail pip stage

2016-01-18 Thread Steve Dower

Steve Dower added the comment:

Preferably just one group of them (created around the same time) for a failed 
installation.

--

___
Python tracker 

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



[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

Patch version 4:

* finish to update Objects/lnotab_notes.txt
* update _PyCode_CheckLineNumber() in codeobject.c
* set importlib MAGIC to 3361

I don't expect my patch to be complete nor perfect. IMHO it's fine to adjust 
the code later if needed.

I would like to integrate FAT Python changes step by step. It looks like the 
general idea of AST optimizers is well accepted.

--
Added file: http://bugs.python.org/file41652/lnotab-4.patch

___
Python tracker 

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



[issue21277] don't try to link _ctypes with a ffi_convenience library

2016-01-18 Thread Zachary Ware

Zachary Ware added the comment:

It's not easy to find anything with a google search for 'ffi_convenience' 
that's not this issue.  I did find doko's patch to GCC to not install 
libffi_convenience, which included a comment from the author of libffi saying 
he didn't recommend that GCC install libffi_convenience in the first place[1].

For the record, #146 is the issue that added the line in question in the 
first place.

[1] https://www.sourceware.org/ml/libffi-discuss/2013/msg00125.html

--
nosy: +zach.ware
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue24922] assertWarnsRegex doesn't allow multiple warning messages

2016-01-18 Thread Rose Ames

Rose Ames added the comment:

Would this mean that we expect any one of the warnings to be raised, or all of 
them?  If it's one, the example you give would be equivalent to:

self.assertWarnsRegex(UserWarning, "^W100[01]")

Matching all of the warnings seems more interesting, but I'm not sure how to 
handle the context manager attributes.  For instance, right now you can do:

with self.assertWarnsRegex(FooWarning, "Bar") as cm:
blah()
self.assertEquals(cm.lineno, 1000)

Would lineno and filename become lists?  It seems kind of ugly.  What's the 
advantage over simply testing for each warning separately?

--
nosy: +superluser

___
Python tracker 

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



[issue20556] Use specific asserts in threading tests

2016-01-18 Thread Berker Peksag

Berker Peksag added the comment:

test_threading_asserts_2.patch looks good to me.

--
nosy: +berker.peksag
stage: patch review -> commit review
versions:  -Python 3.4

___
Python tracker 

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



[issue26145] PEP 511: Add sys.set_code_transformers()

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

main.c:


+case 'o':
+if (wcslen(_PyOS_optarg) == 0
+   || wcschr(_PyOS_optarg, L'.')
+   || wcschr(_PyOS_optarg, L'-')
...

'-' character must be valid for -o argument.

--

___
Python tracker 

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



[issue24823] ctypes.create_string_buffer does not add NUL if len(init) == size

2016-01-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:

(Tracker notes:

I added as nosy the people listed as active 'experts' for ctypes on 
https://docs.python.org/devguide/experts.html#experts.  This was easily done by 
going to the end of the nosy list, typing a comma ',', typing 'ctypes', and 
then clicking the box that appeared.  This can be done for any module and the 
other topics listed on the page.

The Documentation component is for issues that only change the docs, and not 
the code.  That is why Documentation issues are auto-assigned to docs@python.  
Adding 'Documentation' amounts to rejecting this patch or anything else that 
changes the code.

asyncio, ctypes, IDLE (idlelib), IO, and (T)tkinter are all parts of the stdlib 
and AFAIK, issues marked for them do not have to also be marked 'Library'.)
---

I looked at ctypes.py with hg annotate.  Create_string_buffer is part of Thomas 
Heller's original 2006-03-08 patch that moved ctypes from an external source 
into the stdlib.  The only changes are in the isinstance class checks and the 
raise statement; the conditional bodies, including the one in question, are 
unchanged.

Tom, we disagree on our reading of the current docs.  The default number of 
NULL bytes added is 1.  Is the second argument required to be large enough to 
keep the number positive?  You think yes, I think no, though I agree with Eryk 
that the second quoted sentence could and should be clearer.  I will not assume 
that T. Heller meant 'yes' when he wrote 'no' in the code.  What do the listed 
experts think?

If the doc matches the code, there is no implementation bug and this is not a 
behavior issue. It is still possible to request a design change as an 
enhancement.  I think this would require agreement of at least two core 
developers.  A deprecation notice would normally be needed.  A third 
possibility is to decide that this is a security issue severe enough to 
possibly break code in 3.6 and possibly sooner.  I think this would require 
pydev discussion.

One problem with changing ctypes is that it is not used in the stdlib, so we 
have no local examples to draw on.  In this case, the question would be how 
often is 'size' used to suppress the default NULL byte and how legitimate are 
such uses.

--
components: +Devguide -Documentation, Library (Lib), ctypes
nosy: +amaury.forgeotdarc, belopolsky, ezio.melotti, meador.inge, terry.reedy, 
willingc

___
Python tracker 

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



[issue25366] test_venv fails with --without-threads

2016-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2a201272daed by Berker Peksag in branch '3.5':
Issue #25366: Skip test_with_pip when threading module is not available
https://hg.python.org/cpython/rev/2a201272daed

New changeset 27d4f06c3720 by Berker Peksag in branch 'default':
Issue #25366: Skip test_with_pip when threading module is not available
https://hg.python.org/cpython/rev/27d4f06c3720

--
nosy: +python-dev

___
Python tracker 

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



[issue25366] test_venv fails with --without-threads

2016-01-18 Thread Berker Peksag

Berker Peksag added the comment:

Fixed. Thanks for the report, Arfrever

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

___
Python tracker 

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



[issue13886] readline-related test_builtin failure

2016-01-18 Thread Martin Panter

Martin Panter added the comment:

Here is a possible patch which:

* Runs the three test_input_tty() tests in a fresh child Python interpreter, 
for control over whether Readline is loaded. A pseudoterminal is used for stdin 
and stdout, and stderr is left untouched to easily see error messages.
* Repeats each test with and without Readline enabled
* Only tests the error handling without Readline
* Fixes the non-error test to use proper UTF-8 input

With my patch applied, there are a couple of prompts mixed up in the test log 
output via stderr, due to Issue 1927. It is not a major problem, but perhaps we 
should work on fixing that bug first.

--
dependencies: +raw_input behavior incorrect if readline not enabled
stage: needs patch -> patch review

___
Python tracker 

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



[issue13886] readline-related test_builtin failure

2016-01-18 Thread Martin Panter

Changes by Martin Panter :


Added file: http://bugs.python.org/file41653/input-readline.patch

___
Python tracker 

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



[issue5626] misleading comment in socket.gethostname() documentation

2016-01-18 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Given that we have not received any more reports on users tripping up on this 
message, it seems to me that we could just ignore this report and close it. 
Thoughts?

--
nosy: +orsenthil

___
Python tracker 

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



[issue25859] EOFError in test_nntplib.NetworkedNNTPTests.test_starttls()

2016-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a9fca95f119a by Martin Panter in branch '3.5':
Issue #25859: Reimplement NNTP test_starttls() using local server
https://hg.python.org/cpython/rev/a9fca95f119a

New changeset c44bfa733526 by Martin Panter in branch 'default':
Issue #25859: Merge NNTP test server from 3.5
https://hg.python.org/cpython/rev/c44bfa733526

--
nosy: +python-dev

___
Python tracker 

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



[issue5626] misleading comment in socket.gethostname() documentation

2016-01-18 Thread Ned Deily

Ned Deily added the comment:

The point still stands that speaking of "the current machine's IP address" is 
misleading at best.  I'd say either apply Berker's suggested patch or expand 
the description to better reflect the real world of multiple interfaces.  Of 
course I'm biased.

--

___
Python tracker 

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



[issue23962] Incorrect TimeoutError referenced in concurrent.futures documentation

2016-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 673d1ccea050 by Senthil Kumaran in branch '3.5':
issue23962 - Reference the correct TimeoutError in concurrent.futures 
documentation.
https://hg.python.org/cpython/rev/673d1ccea050

New changeset 2b0c7b67eca5 by Senthil Kumaran in branch 'default':
merge from 3.5
https://hg.python.org/cpython/rev/2b0c7b67eca5

--
nosy: +python-dev

___
Python tracker 

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



[issue23962] Incorrect TimeoutError referenced in concurrent.futures documentation

2016-01-18 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks for the report and the patch. I have fixed that in 3.5 and 3.6 docs. I 
found it reasonable to include the full module path for TimeoutError makeing it 
consist with asyncio and multiprocessing TimeoutError.

Also, Error exception is not exposed via __all__ so, left this out in the 
documentation.

--
assignee: docs@python -> orsenthil
nosy: +orsenthil
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue12869] PyOS_StdioReadline is printing the prompt on stderr

2016-01-18 Thread Martin Panter

Martin Panter added the comment:

Adam: My experiments were assuming that PyOS_Readline() only ever uses the 
basic implementation or the Readline library, in order to see if there was any 
consistency with how Python worked in common situations.

There is actually a test that waits for the interpreter prompt on stderr; see 
test_cmd_line_script.CmdLineTest.interactive_python(). I realized that changing 
this would have to be considered carefully, because it could easily break other 
code as well. It certainly should not be done in a bug fix release.

Anyway I am proposing a patch in Issue 1927 to fix PyOS_StdioReadline(), so 
closing this as a duplicate.

--
components: +Interpreter Core -Extension Modules
resolution:  -> duplicate
status: open -> closed
superseder:  -> raw_input behavior incorrect if readline not enabled

___
Python tracker 

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



[issue1927] raw_input behavior incorrect if readline not enabled

2016-01-18 Thread Martin Panter

Martin Panter added the comment:

Tal: thanks for testing.

This v3 patch changes the interactive interpreter to pass stderr as the 
sys_stdout parameter. This means we should maintain compatibility with the 
interpreter prompt going to stderr, but still fix input().

--
versions:  -Python 3.4
Added file: http://bugs.python.org/file41654/promptOutputFix3.v3.patch

___
Python tracker 

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



[issue25859] EOFError in test_nntplib.NetworkedNNTPTests.test_starttls()

2016-01-18 Thread Martin Panter

Changes by Martin Panter :


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



[issue26059] Integer Overflow in strop.replace()

2016-01-18 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution: wont fix -> 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



[issue25731] Assigning and deleting __new__ attr on the class does not allow to create instances of this class

2016-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3c9512d8ac0d by Benjamin Peterson in branch '3.5':
set tp_new from the class in the hierarchy that actually owns the descriptor 
(closes #25731)
https://hg.python.org/cpython/rev/3c9512d8ac0d

New changeset e7062dd9085e by Benjamin Peterson in branch '2.7':
set tp_new from the class in the hierarchy that actually owns the descriptor 
(closes #25731)
https://hg.python.org/cpython/rev/e7062dd9085e

New changeset a7953ee29f1c by Benjamin Peterson in branch 'default':
merge 3.5 (#25731)
https://hg.python.org/cpython/rev/a7953ee29f1c

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue26145] PEP 511: Add sys.set_code_transformers()

2016-01-18 Thread STINNER Victor

STINNER Victor added the comment:

sys_init_code_transformer: Py_DECREF(name); must be Py_XDECREF(name); at exit, 
it can NULL. An unit test on an invalid transformer (with no name) is missing?

--

___
Python tracker 

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



[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2016-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bf997b22df06 by Victor Stinner in branch '3.5':
Fix BytecodeTestCase.assertNotInBytecode()
https://hg.python.org/cpython/rev/bf997b22df06

--

___
Python tracker 

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