[issue25843] code_richcompare() don't use constant type when comparing code constants

2016-01-22 Thread STINNER Victor

STINNER Victor added the comment:

> I will probably remove the optimization on frozenset since it's only useful 
> for AST optimizers (the optimization is a new feature, I considered that it 
> was worth it to add it Python 3.6 as part of my work on the PEP 511).

Hum, it doesn't work: test_compile_ast() of test_compile fails without this 
code. The test relies (indirectly) on the fact that two code objects using a 
frozenset constant are equal.

--

___
Python tracker 

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



[issue26180] multiprocessing.util._afterfork_registry leak in threaded environment

2016-01-22 Thread Milan Zamazal

New submission from Milan Zamazal:

When calling multiprocessing.managers.BaseManager repeatedly from a client, 
each time from a new thread, new entry with (already existent) 
multiprocessing.util.ForkAwareLocal instance is inserted as a value into 
multiprocessing.util._afterfork_registry dictionary on each of the calls.  So 
the dictionary grows on each client call and may grow so indefinitely, causing 
memory leak if nothing else.

The attached file demonstrates the problem (Python 2.7 version, it's 
reproducible on 3.4 as well after 2->3 adjustments).  Just run it and look at 
the output.  The printed dictionary contains 10 entries holding the same 
ForkAwareLocal instance although there should be probably just one such entry 
there.

--
components: Library (Lib)
files: bug.py
messages: 258816
nosy: mzamazal
priority: normal
severity: normal
status: open
title: multiprocessing.util._afterfork_registry leak in threaded environment
type: resource usage
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file41690/bug.py

___
Python tracker 

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



[issue20120] Percent-signs (%) in .pypirc should not be interpolated

2016-01-22 Thread Thomas Levine

Thomas Levine added the comment:

I noticed something else that might be interesting.
If I delete my .pypirc and have setuptools create it,

  python3.5 -c 'import setuptools; setuptools.setup()' register

the .pypirc is created with the un-escaped percent sign and without error.
I receive the error when I try to use the .pypirc next time.

If a different config parser is being used in the writing, perhaps we could at 
least use the same one in both places.

--

___
Python tracker 

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



[issue26183] 2.7.11 won't clean install on Windows 10 x64

2016-01-22 Thread Roger Cook

New submission from Roger Cook:

The Windows installer stops the installation and backs out on a clean system. 
Here is the relevant section of the log file (msiexec /i 
python-2.7.11.amd64.msi /l*v):

MSI (s) (14:90) [15:13:32:577]: Executing op: ActionStart(Name=RemovePip,,)
Action 15:13:32: RemovePip. 
MSI (s) (14:90) [15:13:32:578]: Executing op: 
CustomActionSchedule(Action=RemovePip,ActionType=3090,Source=C:\Python27\python.exe,Target=-B
 -m ensurepip._uninstall,)
MSI (s) (14:90) [15:13:32:579]: Note: 1: 1721 2: RemovePip 3: 
C:\Python27\python.exe 4: -B -m ensurepip._uninstall 
MSI (s) (14:90) [15:13:32:579]: Note: 1: 2262 2: Error 3: -2147287038 
Error 1721. There is a problem with this Windows Installer package. A program 
required for this install to complete could not be run. Contact your support 
personnel or package vendor. Action: RemovePip, location: 
C:\Python27\python.exe, command: -B -m ensurepip._uninstall 
MSI (s) (14:90) [15:13:37:027]: Note: 1: 2262 2: Error 3: -2147287038 
MSI (s) (14:90) [15:13:37:027]: Product: Python 2.7.10 (64-bit) -- Error 1721. 
There is a problem with this Windows Installer package. A program required for 
this install to complete could not be run. Contact your support personnel or 
package vendor. Action: RemovePip, location: C:\Python27\python.exe, command: 
-B -m ensurepip._uninstall 

Action ended 15:13:37: InstallFinalize. Return value 3.

--- end log ---

It appears that the installer tries to call the Python executable before it has 
been put in place. This fails, and the installer backs out.

Workaround: Install 2.7.10, then install 2.7.11 over it.

--
components: Installation
messages: 258836
nosy: Roger Cook
priority: normal
severity: normal
status: open
title: 2.7.11 won't clean install on Windows 10 x64
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue21949] Document the Py_SIZE() macro.

2016-01-22 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
resolution: out of date -> fixed

___
Python tracker 

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



[issue21949] Document the Py_SIZE() macro.

2016-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 63183596db79 by Gregory P. Smith in branch '2.7':
Per issue21949 and issue1629: Document the Py_SIZE, Py_TYPE, Py_REFCNT macros.
https://hg.python.org/cpython/rev/63183596db79

--
nosy: +python-dev

___
Python tracker 

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



[issue1629] Py_Size() should be named Py_SIZE()

2016-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 63183596db79 by Gregory P. Smith in branch '2.7':
Per issue21949 and issue1629: Document the Py_SIZE, Py_TYPE, Py_REFCNT macros.
https://hg.python.org/cpython/rev/63183596db79

--
nosy: +python-dev

___
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-22 Thread Guido van Rossum

Guido van Rossum added the comment:

Am I really still needed on this issue?

On Tue, Jan 19, 2016 at 7:46 PM, Hiroyuki Takagi 
wrote:

>
> Hiroyuki Takagi added the comment:
>
> Thank you for reviewing patch.
>
> I wrote test and updated patch. To pass the test, both this patch and
> issue25599's patch are required.
>
> Changes of the patch:
> - copy __code__ not only functions but also methods
> - add autospec (create_autospec) suppoort
>
> I have completely missed about autospec, thank you for a mention about it.
> For autospec, simply copying original __code__ to funcopy makes error on
> existing tests.
> That's why I changed the src of exec, but it seems to be quite ad-hoc. It
> may be better to be improved, but I don't have any good idea, sorry.
>
> On the tests of this patch, I wonder if it's better to use assertIs(..,
> True/False) instead of assertTrue/False, since it was one of the problem in
> issue25599.
> To apply this change and pass test, need to change
> asyncio.iscoroutinefunction to return bool. The change would be very easy,
> just update issue25599's patch like `return_value = bool(getattr(func, ...`.
>
> --
> Added file: http://bugs.python.org/file41664/mock2.patch
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue26182] Deprecation warnings for the future async and await keywords

2016-01-22 Thread Marco Buttu

New submission from Marco Buttu:

I saw that async and await will become keywords in Python 3.7 :

https://www.python.org/dev/peps/pep-0492/#deprecation-plans

I enabled the deprecation warnings in Python 3.5.1 and Python 3.6 dev, and I 
noticed that assigning to async or await does not issue any deprecation 
warning: 

$ python -Wd -c "import sys; print(sys.version); async = 33"
3.5.1 (default, Jan 21 2016, 19:59:28)
[GCC 4.8.4]

$ python -Wd -c "import sys; print(sys.version); async = 33"
3.6.0a0 (default:4b434a4770a9, Jan 12 2016, 13:01:29)
[GCC 4.8.4]

--
components: Interpreter Core
messages: 258833
nosy: marco.buttu
priority: normal
severity: normal
status: open
title: Deprecation warnings for the future async and await keywords
type: enhancement
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



[issue26177] tkinter: Canvas().keys returns empty strings.

2016-01-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

split() has many warts, it shouldn't be used. It is enough just call 
splitlist() for elements of a list.

Proposed patch fixes Misc.keys(). It also adds tests for missed options (some 
of them are not explicitly documented).

--
components: +Library (Lib), Tkinter
keywords: +patch
Added file: http://bugs.python.org/file41686/tkinter_keys.patch

___
Python tracker 

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



[issue26049] Poor performance when reading large xmlrpc data

2016-01-22 Thread Raimon Esteve

Changes by Raimon Esteve :


--
nosy: +resteve

___
Python tracker 

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



[issue20120] Percent-signs (%) in .pypirc should not be interpolated

2016-01-22 Thread Jason R. Coombs

Jason R. Coombs added the comment:

Setuptools 19 has been out for over a month now with no adverse consequences. 
Łukasz and David, as you both originally tagged this as won't fix, how would 
you feel about interpreting this as a defect and regression over Python 2.7 and 
fixing it it all Python 3 versions that receive bug fixes and bringing it into 
parity with Setuptools? If you give me the green light, I'll apply the patches.

--

___
Python tracker 

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



[issue26184] raise an error when create_module() is not defined by exec_module() is for loaders

2016-01-22 Thread Brett Cannon

New submission from Brett Cannon:

As explained in https://docs.python.org/3/reference/import.html#loaders, as of 
Python 3.6 an error is to be raised when a loader defines exec_module() but not 
create_module(). Probably should raise a TypeError.

--
components: Interpreter Core
messages: 258840
nosy: brett.cannon, eric.snow, ncoghlan
priority: normal
severity: normal
stage: test needed
status: open
title: raise an error when create_module() is not defined by exec_module() is 
for loaders
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue26169] Pasting 900000 chars into a tk Entry widget fails

2016-01-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I understand now what you were thinking. Even a timeout might not work for this 
because one could paste and within a second click Find-next and likely trigger 
the crash.

I tested printing, copying, and finding 'a'*1 and it worked.  I think this 
is good enough, with probability 1.0, for any real use ;-).

--

___
Python tracker 

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



[issue26177] tkinter: Canvas().keys returns empty strings.

2016-01-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue25843] code_richcompare() don't use constant type when comparing code constants

2016-01-22 Thread STINNER Victor

STINNER Victor added the comment:

I pushed my latest patch with minor changes in comments.

I will wait for buildbots before backporting the change to Python 2.7 and 3.5. 
For the backport, I will probably remove the optimization on frozenset since 
it's only useful for AST optimizers (the optimization is a new feature, I 
considered that it was worth it to add it Python 3.6 as part of my work on the 
PEP 511).

--

___
Python tracker 

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



[issue19883] Integer overflow in zipimport.c

2016-01-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Synchronized with current sources.

--
components: +Extension Modules
keywords: +needs review
nosy: +benjamin.peterson
versions:  -Python 3.4
Added file: http://bugs.python.org/file41687/zipimport_int_overflow_3.patch

___
Python tracker 

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



[issue19225] lack of PyExc_BufferError doc

2016-01-22 Thread Gedai Tamás Bence

Gedai Tamás Bence added the comment:

I've created a new table for warnings and added the missing exceptions to the 
exceptions table.

I did not find a link for VMSError, but I added it to the table.

Note that the exceptions table is not absolutely in alphabetical order, I can 
fix it as well, if it's needed.

--
keywords: +patch
Added file: http://bugs.python.org/file41688/doc_exceptions.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-22 Thread STINNER Victor

STINNER Victor added the comment:

Brett: "Semantics are fine (I initially misread what you wanted to do; sorry)."

Ok, I pushed my change.

Brett: "And I wouldn't backport since it's an enhancement and not a bugfix."

Ok, fine.

--
resolution:  -> fixed
status: open -> closed
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



[issue26099] site ignores ImportError when running sitecustomize and usercustomize

2016-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c873a479a6a3 by Victor Stinner in branch 'default':
site: error on sitecustomize import error
https://hg.python.org/cpython/rev/c873a479a6a3

--
nosy: +python-dev

___
Python tracker 

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



[issue26169] Pasting 900000 chars into a tk Entry widget fails

2016-01-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I want to say that may be we can make a workaround for this issue in IDLE if it 
is worth. The "wont fix" resolution looks reasonable to me, but this doesn't 
mean that the issue couldn't be solved in principle (though the solution can be 
very costly). I'm closing this issue, but only because we have too  much other 
open IDLE issues, and with very good chance this issue will never solved.

Other issue is that it would be nice to make IDLE and Tkinter more responsive. 
Allow to interrupt long-running Tk operation and ask the user to save his files 
before quit. But this is separate issue.

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



[issue25843] code_richcompare() don't use constant type when comparing code constants

2016-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6c33d4cc9b8f by Victor Stinner in branch 'default':
code_richcompare() now uses the constants types
https://hg.python.org/cpython/rev/6c33d4cc9b8f

--
nosy: +python-dev

___
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-22 Thread STINNER Victor

STINNER Victor added the comment:

Patch version 2:

- rework the whole patch
- add unit tests
- fix AST validation: the code was completly wrong in patch 1, I don't 
understand how it worked :-p Validate also correctly nested tuple and nested 
frozenset.
- add a comment to explain why obj2ast_constant() doesn't have to Py_INCREF() 
singletons
- handle also Ellipsis
- revert changes on set_context(). It seems like set_context() is only called 
with code emited directly by the compiler (not by compile(custom_ast_tree, 
...)). If someone finds a way to call set_context() with an ast.Constant, we 
can support this case later.

--
Added file: http://bugs.python.org/file41689/constant-2.patch

___
Python tracker 

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



[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2016-01-22 Thread Brett Cannon

Brett Cannon added the comment:

Thanks to everyone for providing feedback. I went with ImportError in the end 
as that's what the pure Python implementation of __import__() already raised.

--
resolution:  -> fixed
stage: test needed -> 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



[issue26128] Let the subprocess.STARTUPINFO constructor take arguments

2016-01-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

STARTUPINFO is a class whose instances have 5 attributes.  Being able to set 
attributes on creation is pretty normal.  If one can optionally be set in 
__init__, same should be true for all.  I would recommend that params be 
keyword-only.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue26128] Let the subprocess.STARTUPINFO constructor take arguments

2016-01-22 Thread Ram Rachum

Ram Rachum added the comment:

Agreed on keywords-only.

--

___
Python tracker 

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



[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2016-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c4e4886c6052 by Brett Cannon in branch 'default':
Issue #18018: Raise an ImportError if a relative import is attempted
https://hg.python.org/cpython/rev/c4e4886c6052

--
nosy: +python-dev

___
Python tracker 

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



[issue25791] Raise an ImportWarning when __spec__.parent/__package__ isn't defined for a relative import

2016-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 219c44fe8968 by Brett Cannon in branch 'default':
Issue #25791: Warn when __package__ != __spec__.parent.
https://hg.python.org/cpython/rev/219c44fe8968

--

___
Python tracker 

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



[issue21762] update the import machinery to only use __spec__

2016-01-22 Thread Brett Cannon

Brett Cannon added the comment:

I think that leaves the following attributes to be updated/checked for 
dependencies in importlib (and if they are found, raise ImportWarning when they 
differ):

1. __path__
2. __loader__
3. __file__
4. __cached__

--

___
Python tracker 

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



[issue26095] Update porting HOWTO to special-case Python 2 code, not Python 3

2016-01-22 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee: docs@python -> brett.cannon

___
Python tracker 

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



[issue25234] test_eintr.test_os_open hangs under Xcode 7

2016-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9d65a195246b by Brett Cannon in branch 'default':
Issue #25234: Skip test_eintr.test_open() under OS X to avoid hanging
https://hg.python.org/cpython/rev/9d65a195246b

--

___
Python tracker 

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



[issue25234] test_eintr.test_os_open hangs under Xcode 7

2016-01-22 Thread Brett Cannon

Changes by Brett Cannon :


--
status: open -> closed

___
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-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Berker, I agree with you.  The doc section is woefully incomplete and 
unix-specific.  It probably dates back to when Python only ran on unix.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue25934] ICC compiler: ICC treats denormal floating point numbers as 0.0

2016-01-22 Thread Zachary Ware

Zachary Ware added the comment:

Here's a patch that specifies /fp:strict if it looks like ICC is being used for 
the build.  It also adds a convenient property for checking whether it's an ICC 
build ($(ICCBuild)).  This doesn't change anything for MSVC builds but allows 
ICC builds to pass test_math, test_cmath, test_audioop, etc.; as such, it 
should be applied to all three branches.

As far as replacing the non-constants that MSVC doesn't like, I'm +1 but not 
too bothered about it.  I'm happy to test if anyone supplies a patch for it.

--
keywords: +patch
versions: +Python 2.7
Added file: http://bugs.python.org/file41696/issue25934.diff

___
Python tracker 

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



[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2016-01-22 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +yselivanov

___
Python tracker 

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



[issue25907] Documentation i18n: Added trans tags in sphinx templates

2016-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b1615165fa4a by Victor Stinner in branch '3.5':
doc: i18n HTML templates
https://hg.python.org/cpython/rev/b1615165fa4a

New changeset 5af5b36c197e by Victor Stinner in branch 'default':
Merge 3.5 (i18n doc, issue #25907)
https://hg.python.org/cpython/rev/5af5b36c197e

--
nosy: +python-dev

___
Python tracker 

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



[issue26163] FAIL: test_hash_effectiveness (test.test_set.TestFrozenSet)

2016-01-22 Thread STINNER Victor

STINNER Victor added the comment:

as i expected, the bug disappeared. I'm not interested to investigate a random 
failure which only occurred once. I close the issue.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue25907] Documentation i18n: Added trans tags in sphinx templates

2016-01-22 Thread STINNER Victor

STINNER Victor added the comment:

I applied 3 patches to branches 3.5 and default (3.6), but the patches don't 
apply cleanly to Python 2.7.

Can you please cook patches for Python 2.7?

(I suggest to focus on translation of the Python 3 documentation, but for me, 
it's cheap to apply such patch to Python 2.7.)

--
versions: +Python 2.7, Python 3.5, 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



[issue26164] test_with_pip() of test_venv fails on Windows buildbots

2016-01-22 Thread STINNER Victor

STINNER Victor added the comment:

It looks like the issue was fixed with the upgrade of pip to 8.0.2: changeset 
c75802aaa4de (merge into default: changeset ca78f5e41012).

--

___
Python tracker 

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



[issue26161] Use Py_uintptr_t instead of void* for atomic pointers

2016-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ff68ffcc6244 by Victor Stinner in branch 'default':
Use Py_uintptr_t for atomic pointers
https://hg.python.org/cpython/rev/ff68ffcc6244

--
nosy: +python-dev

___
Python tracker 

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



[issue26161] Use Py_uintptr_t instead of void* for atomic pointers

2016-01-22 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



[issue26178] Python C-API: __all__ Creator

2016-01-22 Thread Devyn Johnson

New submission from Devyn Johnson:

When creating Python modules via th C-API, it would be wonderful if there were 
an easier and more efficient way of creating an "__all__" for the module. In my 
opinion, an API function should be made; i.e., something like PyALL("FUNC1", 
"FUNC2", ...)


Currently, I use something like the below code.

"""
PyObject *create_all(void);

PyObject *create_all(void) {  // Create __all__
#define _ALLSTRING "[ss"
#define _ENDSTRING "]"
return Py_BuildValue(
_ALLSTRING
#if defined(ENV64BIT) && (defined(__x86_64__) || defined(__x86_64))
"sss"
#ifdef __BMI2__
""
#endif
#endif
_ENDSTRING,
// STRING CONVERSIONS
"lowercasestr",
"uppercasestr",
// FIND AND REPLACE/REMOVE
"strreplace",
"strreplace_once",
"rmgravequote",
// ASSEMBLY-RELATED COMMANDS
#if defined(ENV64BIT) && (defined(__x86_64__) || defined(__x86_64))
"rdtsc",
"get_vendor_id",
"get_cpu_stepping",
#ifdef __BMI2__
"is_fpu_aval",
"is_avx_aval",
"is_fma_aval",
"is_aes_aval",
#endif
#endif
"nop"
);
}

// Some code excluded

MODINIT {  // Initialize module
PyObject *m;
m = PyModule_Create();
PyModule_AddObject(m, "__all__", create_all());
PyModule_AddStringConstant(m, "__author__", __author__);
PyModule_AddStringConstant(m, "__version__", __version__);
if (m == NULL)
return NULL;
return m;
}
"""

--
components: Interpreter Core
messages: 258804
nosy: Devyn Johnson
priority: normal
severity: normal
status: open
title: Python C-API: __all__ Creator
type: enhancement
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



[issue25876] test_gdb: use subprocess._args_from_interpreter_flags() to test Python with more options

2016-01-22 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



[issue26178] Python C-API: __all__ Creator

2016-01-22 Thread Devyn Johnson

Devyn Johnson added the comment:

Thanks, @skrah and @haypo . I never thought of it that way. I made "__all__" in 
my extensions because "__all__" was used in many Python scripts. Thanks for the 
alternative perspective.

--
status: open -> closed

___
Python tracker 

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



[issue25876] test_gdb: use subprocess._args_from_interpreter_flags() to test Python with more options

2016-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9faa15da2dde by Victor Stinner in branch 'default':
Issue #25876: Fix also test_set() of test_gdb when -E command line is used
https://hg.python.org/cpython/rev/9faa15da2dde

--

___
Python tracker 

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



[issue26108] Calling PyInitialize with 2.7.11 on Windows x64 terminates process

2016-01-22 Thread Eryk Sun

Changes by Eryk Sun :


--
stage:  -> resolved

___
Python tracker 

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



[issue25876] test_gdb: use subprocess._args_from_interpreter_flags() to test Python with more options

2016-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 05ea3efadead by Victor Stinner in branch 'default':
Issue #25876: test_gdb: use subprocess._args_from_interpreter_flags() to test
https://hg.python.org/cpython/rev/05ea3efadead

--
nosy: +python-dev

___
Python tracker 

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



[issue26178] Python C-API: __all__ Creator

2016-01-22 Thread STINNER Victor

STINNER Victor added the comment:

Seting __all__ is usually need to exclude some symbols from "from module import 
*". In Python, it's common to write public or private (name prefixed by "_") 
helper functions which are excluded from __all__. In C extensions, you have to 
explicitly expose a function. Why would you expose a function but exclude it 
from __all__?

--
nosy: +haypo

___
Python tracker 

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



[issue26178] Python C-API: __all__ Creator

2016-01-22 Thread Stefan Krah

Stefan Krah added the comment:

I agree, and that's pretty much what Guido said here, too:

https://mail.python.org/pipermail/python-dev/2001-February/012591.html

--
nosy: +skrah

___
Python tracker 

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



[issue26164] test_with_pip() of test_venv fails on Windows buildbots

2016-01-22 Thread Donald Stufft

Donald Stufft added the comment:

Yes, it should have been. Sorry forgot this issue was opened.

--

___
Python tracker 

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



[issue26164] test_with_pip() of test_venv fails on Windows buildbots

2016-01-22 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



[issue26108] Calling PyInitialize with 2.7.11 on Windows x64 terminates process

2016-01-22 Thread Eryk Sun

Changes by Eryk Sun :


--
resolution: not a bug -> duplicate
superseder:  -> 32-bit 2.7.11 installer creates registry keys that are 
incompatible with the installed python27.dll

___
Python tracker 

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



[issue26179] Python C-API "unused-parameter" warnings

2016-01-22 Thread Devyn Johnson

New submission from Devyn Johnson:

When compiling Python C-API extensions with "-Wextra", warnings like 

warning: unused parameter ‘self’ [-Wunused-parameter]

appear for code (like below). It seems like a minor issue for a warning to 
appear when "PyObject *self, PyObject *args" is required. Is there an 
underlying issue in the API?

static PyObject *mathfunc_ismersenneprime(PyObject *self, PyObject *args) {
sllint num;
ASSERT_LONGLONG_ARG(num);
if (num < (sllint)0) ERR_POSITIVE_INT;
returnbool(islonglongmersenneprime(num));
}

--
components: Interpreter Core
messages: 258809
nosy: Devyn Johnson
priority: normal
severity: normal
status: open
title: Python C-API "unused-parameter" warnings
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue26179] Python C-API "unused-parameter" warnings

2016-01-22 Thread STINNER Victor

STINNER Victor added the comment:

> Is there an underlying issue in the API?

You can use self if your code. If you don't need it, you can use Py_UNUSED() 
macro available since Python 3.4.

--
nosy: +haypo

___
Python tracker 

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



[issue26179] Python C-API "unused-parameter" warnings

2016-01-22 Thread STINNER Victor

STINNER Victor added the comment:

Please don't open bug reports to ask questions on your own code. The bug 
tracker is not forum.

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



[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-22 Thread Yury Selivanov

Yury Selivanov added the comment:

> Patch version 5: a global counter is now used to set ma_version field of 
> dictionaries. The global counter is incremented each time that a dictionary 
> is created and each time that a dictionary is modified.

This is great, thank you, Victor.

--

___
Python tracker 

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



[issue21949] Document the Py_SIZE() macro.

2016-01-22 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for triaging! The relevant commit is 760c5cfacbaa.

--
nosy: +berker.peksag
resolution:  -> out of date
stage: needs patch -> 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



[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-22 Thread STINNER Victor

STINNER Victor added the comment:

> This is great, thank you, Victor.

I will update the PEP 509 later for the global counter.

--

___
Python tracker 

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



[issue25907] Documentation i18n: Added trans tags in sphinx templates

2016-01-22 Thread Julien

Julien added the comment:

And tags for the layout template.

--
Added file: http://bugs.python.org/file41694/i18n-tags-in-layout.patch

___
Python tracker 

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



[issue25907] Documentation i18n: Added trans tags in sphinx templates

2016-01-22 Thread Julien

Julien added the comment:

And here are the i18n tags for the sidebar, thanks @haypo it was a good idea to 
translate them too ^-^

--
Added file: http://bugs.python.org/file41693/i18n-tags-in-sidebar.patch

___
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-22 Thread STINNER Victor

STINNER Victor added the comment:

Patch version 4: Fix sys_set_code_transformers(), initialize seq to NULL to fix 
a crash on error handling.

--
Added file: http://bugs.python.org/file41695/transformers-4.patch

___
Python tracker 

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



[issue25843] code_richcompare() don't use constant type when comparing code constants

2016-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8e0a736b82ff by Victor Stinner in branch '3.5':
code_richcompare() now uses the constants types
https://hg.python.org/cpython/rev/8e0a736b82ff

--

___
Python tracker 

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



[issue25843] code_richcompare() don't use constant type when comparing code constants

2016-01-22 Thread STINNER Victor

STINNER Victor added the comment:

Ok, the fix is now pushed to Python 2.7, 3.5 and 3.6.

Thanks Tijs Van Oevelen for your bug report ;-)

A workaround look to define the two lambda functions on two different lines. Or 
maybe cast explicitly to float? I don't think that it's a common bug so you 
should be able to survive with it until the next bugfix version is released :-)

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



[issue21949] Document the Py_SIZE() macro.

2016-01-22 Thread Gedai Tamás Bence

Gedai Tamás Bence added the comment:

Py_SIZE: https://docs.python.org/3.5/c-api/structures.html#c.Py_SIZE
PyList_New: https://docs.python.org/3.5/c-api/list.html#c.PyList_New

I think they're documented now, so I guess the issue can be closed.

--
nosy: +beng94

___
Python tracker 

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



[issue26181] argparse can't handle positional argument after list (help message is wrong)

2016-01-22 Thread Alex

New submission from Alex:

This code is meant to take a filename and a list of integers as arguments.  The 
filename is required, the integers are optional:

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('filename')
parser.add_argument('-L', metavar='integer', type=int, nargs='+')
args = parser.parse_args()
print(args)  # see what we got

It produces the following help message:
usage: demo.py [-h] [-L integer [integer ...]] filename

However, the filename argument does not work if it's given in that position 
(after the list of ints).  Instead, it tries to use filename as another list 
element:

$ python demo.py -L 1 2 3 test.txt
usage: demo.py [-h] [-L integer [integer ...]] filename
demo.py: error: argument -L: invalid int value: 'test.txt'

Changing the order of the arguments works as intended:

$ python demo.py test.txt -L 1 2 3 
Namespace(L=[1, 2, 3], filename='test.txt')

Probably the simplest fix would be to amend the help message to show the 
positional argument before the list:

usage: demo.py [-h] filename [-L integer [integer ...]]

--
components: Library (Lib)
messages: 258823
nosy: atpage
priority: normal
severity: normal
status: open
title: argparse can't handle positional argument after list (help message is 
wrong)
type: behavior
versions: Python 2.7, Python 3.4

___
Python tracker 

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



[issue25843] code_richcompare() don't use constant type when comparing code constants

2016-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9e13d97ceca2 by Victor Stinner in branch '2.7':
code_richcompare() now uses the constants types
https://hg.python.org/cpython/rev/9e13d97ceca2

--

___
Python tracker 

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



[issue24520] Stop using deprecated floating-point environment functions on FreeBSD

2016-01-22 Thread STINNER Victor

STINNER Victor added the comment:

> @koobs: sorry, 3.4 now only accept security fixes :-p

I wrote a table giving the status of each Python branch to know which ones 
still accept bugfixes or not:
https://docs.python.org/devguide/#status-of-python-branches

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



[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-22 Thread STINNER Victor

STINNER Victor added the comment:

Patch version 5: a global counter is now used to set ma_version field of 
dictionaries. The global counter is incremented each time that a dictionary is 
created and each time that a dictionary is modified.

A dictionary version is now unique: two dictionaries cannot have the same 
version. So if a guard stores a version, the check on the version will fail if 
a different dictionary is used.

--
Added file: http://bugs.python.org/file41691/dict_version-5.patch

___
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-22 Thread STINNER Victor

STINNER Victor added the comment:

Rebased patch.

--
Added file: http://bugs.python.org/file41692/transformers-3.patch

___
Python tracker 

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



[issue25791] Raise an ImportWarning when __spec__.parent/__package__ isn't defined for a relative import

2016-01-22 Thread Brett Cannon

Changes by Brett Cannon :


--
status: open -> closed

___
Python tracker 

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



[issue26180] multiprocessing.util._afterfork_registry leak in threaded environment

2016-01-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Please post your 3.x version.  3.4 only gets security patches now.

--
nosy: +terry.reedy
versions: +Python 3.5, 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