[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-03 Thread Nick Coghlan

Nick Coghlan added the comment:

Attached patch covers the proposed documentation updates.

--
Added file: 
http://bugs.python.org/file45744/issue23722_documentation_updates.diff

___
Python tracker 

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



[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-03 Thread Emanuel Barry

Changes by Emanuel Barry :


--
nosy: +ebarry

___
Python tracker 

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



[issue28862] test_import.py leaks on 2.7

2016-12-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6e9939e1f933 by Benjamin Peterson in branch '2.7':
simplify cleanup of test_replace_parent_in_sys_modules (closes #28862)
https://hg.python.org/cpython/rev/6e9939e1f933

--
nosy: +python-dev
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



[issue28797] Modifying class __dict__ inside __set_name__

2016-12-03 Thread Nick Coghlan

Nick Coghlan added the comment:

Regarding the docs suggestion above, I need to make some other docs changes for 
issue 23722, so I'll roll that update in with those.

Given that, I think we can mark this issue as resolved.

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



[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-03 Thread Nick Coghlan

Nick Coghlan added the comment:

In the meantime, I'll try to work out a suitable documentation patch.

--

___
Python tracker 

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



[issue28857] SyncManager and Main Process fail to communicate after reboot or stoping with Ctrl - C

2016-12-03 Thread Nagarjuna Arigapudi

Nagarjuna Arigapudi added the comment:

I  added logs just to provide additional info. The problem is one of the 
process uses " /tmp/pymp-xTqdkd" for communication and other uses 
"/tmp/pymp-LOMHoT/listener-EbLeup". because of mismatch porcesse could 
communicate and multiprocess application shuts down, with message "process 
shutting down". The files/directories (temporary files in tmp) are not user 
defined, they are generated by Python.

This behavior is seen only after a running application is sent  (Ctrl C) or the 
server is rebooted while application is running. In Simple terms non-clean 
shutdown of application make application not runnable, because synchronization 
of multiprocess gets corrupted, rebooting or clearing /tmp does not fix the 
issue. 

Relevent Logs (both SyncManager-1 and MainProcess) is python code ( in 
multiprocessing package/module).


[INFO/SyncManager-1] created temp directory /tmp/pymp-xTqdkd

[DEBUG/MainProcess] failed to connect to address 
/tmp/pymp-LOMHoT/listener-EbLeup


This results in File not found error, and application shuts down.
The code in multiprocessing should be using same directory for communication.

Thanks

--

___
Python tracker 

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



[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-03 Thread Nick Coghlan

Nick Coghlan added the comment:

Reassigning to Ned for now, pending finding another commit reviewer.

--
assignee: ncoghlan -> ned.deily

___
Python tracker 

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



[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-03 Thread Nick Coghlan

Nick Coghlan added the comment:

This latest patch restores the behaviour where a reference to the class cell is 
returned from the class-defining closure.

That restoration allows __build_class__ to implement a sanity check that 
ensures that the class referenced from the cell is the one that was just 
defined, and complain if they don't match.

To give metaclasses like the Django one a chance to adjust, not setting it at 
all is just a deprecation warning for 3.6, while setting it incorrectly is a 
TypeError.

--
stage: needs patch -> commit review
versions: +Python 3.6, Python 3.7 -Python 3.5
Added file: 
http://bugs.python.org/file45743/issue23722_classcell_reference_validation.diff

___
Python tracker 

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



[issue28864] Add devnull file-like object

2016-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If you need true file object, with name, fileno() etc, you can use 
open(os.devnull, 'w'). If the simple file-like object is enough, it is just few 
lines:

class NullWriter:
def write(self, s): pass

io.StringIO() works in most cases well too.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28860] Fixed all the doctest failures in Doc/library/configparser.rst

2016-12-03 Thread Zachary Ware

Zachary Ware added the comment:

Indeed, thank you Marco for continuing this work!

The patches that I committed [1] were mostly done by Jelle Zijlstra.  There 
were not many tests that had dict ordering issues; but it looks like we used 
sorted() rather than list() in a few places.  I think using sorted() here is 
fine as well (though for the third one, I'd recommend turning the list 
comprehension into a generator expression argument to sorted, rather than 
sticking sorted() in the middle of the listcomp).

As far as why these patches are not compatible with Rietveld, they appear to 
have been generated by `diff` between two discrete files rather than by `hg 
diff` or `git diff`, and Reitveld can't find the files as named to be able to 
apply the patch.


[1] Viewable in aggregate here: 
https://hg.python.org/cpython/rev/769355e031:d0302d8ecbc1

--
stage:  -> patch review

___
Python tracker 

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



[issue28864] Add devnull file-like object

2016-12-03 Thread Raymond Hettinger

New submission from Raymond Hettinger:

Uses cases are the same as /dev/null:

with redirect_stderr(io.DevNull()):
some_func_using_stdout_and_stderr()

--
messages: 282314
nosy: ncoghlan, pitrou, rhettinger
priority: low
severity: normal
status: open
title: Add devnull file-like object
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue28861] Type Hints Syntax

2016-12-03 Thread YoSTEALTH

YoSTEALTH added the comment:

I was told to post this in python-ideas and also i totally missed the most 
important part (type aliases) in my example (rushed it)

--
status: open -> closed

___
Python tracker 

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



[issue28860] Fixed all the doctest failures in Doc/library/configparser.rst

2016-12-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

For some reason, not obvious to me, these patches cannot be reviewed on 
Rietveld.

--

___
Python tracker 

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



[issue28860] Fixed all the doctest failures in Doc/library/configparser.rst

2016-12-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Marco, thank you for adding more energy to improving the docs. #27200 is the 
master issue for fixing failing doc doctests.  The goal is to be able to have a 
buildbot run 'make doctest' or the Windows equivalent and expect success.

For this issue, I mildly agree with Brett.  Adding sorted is something a user 
might do.  But I am curious what policy Zack followed for the other 9 patches.

--
nosy: +terry.reedy, zach.ware

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2016-12-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

#10225, still open, has a old 3.2 patch that might be useful.  If it is not, it 
should be closed.  Note that Raymond does not like the patch for the sorting 
help doc.

--

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2016-12-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

#28860 has a patch for configparser.  Jelle, if you have more patches for some 
of the items listed above, please upload them so Marco can focus on the others.

--
dependencies: +Fixed all the doctest failures in Doc/library/configparser.rst
nosy: +terry.reedy

___
Python tracker 

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



[issue28754] Argument Clinic for bisect.bisect_left

2016-12-03 Thread Martin Panter

Martin Panter added the comment:

Fair enough, I don’t really mind if it is (lo=0, hi=None). I think I have only 
used bisect with both defaults anyway.

--

___
Python tracker 

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



[issue28863] Doc/includes/*.py files and doctests

2016-12-03 Thread Marco Buttu

New submission from Marco Buttu:

In the Doc/includes directory, some of the *.py file names have a dash 
character. For instance: Doc/includes/tzinfo-examples.py. I am trying to make 
all of the code examples pass the doctests, and I usually need to import from 
these files some code. Importing from these modules also allow us to test them, 
and I think that is important because their code is included in the 
documentation.

There are two problems:

1) I can not directly import them, because of the - character, so I have to use 
__import__('file-name') and write other ugly tricks. I can import them in the 
setuptests, so the reader will not see these imports, but it is still ugly, and 
in addition the code examples will be not complete, and the reader will not be 
able to try the code

2) the dash in the file names is un-pythonic. As the PEP 0008 says, the 
preferred way is to use underscores: "Modules should have short, all-lowercase 
names. Underscores can be used in the module name if it improves readability."

In conclusion, I propose to change the Doc/includes/*.py file names, replacing 
the dash character with an underscore. If you agree, I will do it step by step: 
I will change each file name only when I will work with the related 
documentation and code examples. 

PS. To include these files in the code examples, I also need to add the 
Doc/includes directory to the sys.path (in conf.py).

--
assignee: docs@python
components: Documentation
messages: 282307
nosy: docs@python, marco.buttu
priority: normal
severity: normal
status: open
title: Doc/includes/*.py files and doctests
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue28862] test_import.py leaks on 2.7

2016-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Following patch fixes a warning. I didn't run the test in debug mode, but 
suppose that the leak also is fixed.

--
keywords: +patch
nosy: +serhiy.storchaka
stage:  -> patch review
Added file: http://bugs.python.org/file45742/test_import-leak-2.7.patch

___
Python tracker 

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



[issue28862] test_import.py leaks on 2.7

2016-12-03 Thread Benjamin Peterson

New submission from Benjamin Peterson:

It looks like the test if not the fix for #15578 reveals a reference leak 
somewhere in the import system:

$ ./python Lib/test/regrtest.py -R :: test_import
[1/1] test_import
beginning 9 repetitions
123456789
.
test_import leaked [1, 1, 1, 1] references, sum=4
Warning -- sys.path was modified by test_import
1 test failed:
test_import
[57131 refs]

--
messages: 282305
nosy: benjamin.peterson, eric.snow
priority: normal
severity: normal
status: open
title: test_import.py leaks on 2.7
versions: Python 2.7

___
Python tracker 

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



[issue28861] Type Hints Syntax

2016-12-03 Thread YoSTEALTH

New submission from YoSTEALTH:

Type Hints Syntax
-

Goal: Is to make it easy to read function/methods arguments, yet keep the new 
and cool Type Hints.

For example this is a code from one of my function. Its getting to that point 
of what the heck is going on here?

def find_replace(string: str, find: (str, dict, list, tuple, set), replace: 
(str, list, tuple, set)='') -> str:
pass

I know it can be rewritten as:

T = (str, dict, list, tuple, set)
def find_replace(string: str, find: T, replace: T='') -> str:
pass

But when you start using variable to represent another variables type... maybe 
we are losing the plot here!

What if we could have both? Readability and type reference, what if it could be 
written as:

def find_replace(string, find, replace):
targ str, *(str, dict, list, tuple, set) -> str
# code here ...

targ = type argument (like *args and **kwargs)

Calling a "targ" like we call "global" but to represent types.

Simple Examples:

def Redirect(url='', code=301):
targ (str, int) -> None


Just think about it...

--
messages: 282304
nosy: YoSTEALTH
priority: normal
severity: normal
status: open
title: Type Hints Syntax
type: enhancement

___
Python tracker 

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



[issue28846] Add a ProviderKey to the installer bundle

2016-12-03 Thread Steve Dower

Steve Dower added the comment:

This bloated into a couple of extra build/installer fixes, including *finally* 
fixing the sys._mercurial bug (I hope). I can also now merge fairly cleanly 
between 3.5 and 3.6 again, so I'm happy for a while :)

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



[issue28846] Add a ProviderKey to the installer bundle

2016-12-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 68530c0a1487 by Steve Dower in branch '3.5':
Issue #28846: Various installer fixes
https://hg.python.org/cpython/rev/68530c0a1487

New changeset 5171bd86a36f by Steve Dower in branch '3.6':
Issue #28846: Various installer fixes
https://hg.python.org/cpython/rev/5171bd86a36f

New changeset 014f52fe1da1 by Steve Dower in branch 'default':
Issue #28846: Various installer fixes
https://hg.python.org/cpython/rev/014f52fe1da1

--
nosy: +python-dev

___
Python tracker 

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



[issue21147] sqlite3 doesn't complain if the request contains a null character

2016-12-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e358aaf9563f by Benjamin Peterson in branch '2.7':
fix refleak in null-containing error case (#21147)
https://hg.python.org/cpython/rev/e358aaf9563f

--

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2016-12-03 Thread Edward K. Ream

Edward K. Ream added the comment:

On Sat, Dec 3, 2016 at 1:37 PM, Steve Dower  wrote:

​Thanks, Steve and David, for your replies. Getting this issue fixed
eventually will do.​ Glad to hear it was a mistake, and not policy ;-)

EKR

--

___
Python tracker 

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



[issue27305] Crash with "pip list --outdated" on Windows 10 with Python 2.7.12rc1

2016-12-03 Thread Steve Dower

Steve Dower added the comment:

It works for me. Can you confirm your operating system, and add the full output 
from running these commands:

>>> print sys.version
>>> from urllib2 import urlopen
>>> urlopen('http://www.google.co.uk')
>>> urlopen('https://www.google.co.uk')

--

___
Python tracker 

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



[issue6135] subprocess seems to use local encoding and give no choice

2016-12-03 Thread Steve Dower

Steve Dower added the comment:

> looks like only way to specify console's codepage is with
`encoding=os.device_encoding(2)` which will have to be used for 99% of cases

That's true, but it only applies when the subprocess is using the same call 
(GetConsoleCP) to determine what encoding to use to write to something *other* 
than the console, which is incorrect. The defaults in this cause ought to be 
ACP, but it depends entirely on the target application and there is no good 
"99%" default.

To see this demonstrated, check the difference between these two commands (with 
3.5 or earlier):

python -c "import sys; print(sys.stdin.encoding)"
python -c "import sys; print(sys.stdin.encoding)" < textfile.txt

When stdin is redirected, the default encoding is not the console encoding 
(unless it happens to match your ACP). And ACP is not the correct encoding for 
a file anyway - it just happens to be the default for TextIOWrapper - so to do 
it properly you need to detect that it's not a console (sys.stdin.isatty()) and 
then use the raw stream rather than the default wrapper. (Or you specify that 
your program requires ACP files, or that PYTHONIOENCODING should be set, or 
that it requires any other encoding and you explicitly switch to that one.)

In short, character encoding is hard, and the only way to get it right is for 
the developer to be aware of it. No good defaults exist.

--

___
Python tracker 

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



[issue28860] Fixed all the doctest failures in Doc/library/configparser.rst

2016-12-03 Thread Marco Buttu

Marco Buttu added the comment:

I usually keep the code examples focused, because I think extra code added just 
in order to have more tests can get the example less clear. But of course, 
there is an important downside :/ So, if your policy and goal is to have a 
better coverage of the code examples, here is another patch that uses sorted().

Thank you very much for your time :-)

--
Added file: http://bugs.python.org/file45741/configparser2nd.patch

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2016-12-03 Thread Steve Dower

Steve Dower added the comment:

This looks like it was my fault - I said I'd commit the patches and then never 
got back to it.

I've assigned the issue to me so it doesn't fall off my radar again (though if 
someone else wants to do it first they're welcome to). But at this stage I 
suspect it's best not to change 3.6.0.

--
assignee:  -> steve.dower
versions: +Python 3.7

___
Python tracker 

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



[issue24339] iso6937 encoding missing

2016-12-03 Thread John Helour

Changes by John Helour :


Added file: http://bugs.python.org/file45740/iso6937.py

___
Python tracker 

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



[issue24339] iso6937 encoding missing

2016-12-03 Thread John Helour

Changes by John Helour :


Removed file: http://bugs.python.org/file45708/iso6937.py

___
Python tracker 

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



[issue25455] Some repr implementations don't check for self-referential structures

2016-12-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ea1edf1bf362 by Benjamin Peterson in branch '2.7':
when you enter repr, you must leave, too (#25455)
https://hg.python.org/cpython/rev/ea1edf1bf362

--

___
Python tracker 

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



[issue6135] subprocess seems to use local encoding and give no choice

2016-12-03 Thread Dāvis

Dāvis added the comment:

And looks like only way to specify console's codepage is with
`encoding=os.device_encoding(2)` which will have to be used for 99% of cases. I 
don't see other way...

--

___
Python tracker 

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



[issue27870] Left shift of zero allocates memory

2016-12-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2b190bfd9ab4 by Benjamin Peterson in branch '2.7':
fix refleak in the shift-by-zero case (#27870)
https://hg.python.org/cpython/rev/2b190bfd9ab4

--

___
Python tracker 

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



[issue28860] Fixed all the doctest failures in Doc/library/configparser.rst

2016-12-03 Thread Brett Cannon

Brett Cannon added the comment:

For the iteration of dictionary keys, can you pass the keys through sorted() to 
have a deterministic order?

--
nosy: +brett.cannon

___
Python tracker 

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



[issue6135] subprocess seems to use local encoding and give no choice

2016-12-03 Thread Dāvis

Dāvis added the comment:

Still can't specify encoding for getstatusoutput and getoutput. Also it uses 
wrong encoding by default, most of time it will be console's codepage instead 
of ANSI codepage which is used now.

--
nosy: +davispuh

___
Python tracker 

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



[issue28853] locals() and free variables

2016-12-03 Thread Marco Buttu

Marco Buttu added the comment:

I close it because the meaning of "free variable" is not clear. We are 
discussing about it in issue 26683.

--
resolution:  -> postponed
status: open -> closed

___
Python tracker 

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



[issue27647] Update Windows build to Tcl/Tk 8.6.6

2016-12-03 Thread Ned Deily

Ned Deily added the comment:

Please don't change Mac/BuildScript.  The code there to build Tcl and Tk is 
currently not used.

--
nosy: +ned.deily

___
Python tracker 

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



[issue28596] on Android _bootlocale on startup relies on too many library modules

2016-12-03 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
assignee:  -> xdegaye
stage: needs patch -> patch review
type: behavior -> performance
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



[issue28853] locals() and free variables

2016-12-03 Thread Julien Palard

Julien Palard added the comment:

Should this issue be closed so?

--

___
Python tracker 

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



[issue28849] do not define sys.implementation._multiarch on Android

2016-12-03 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The MULTIARCH triplet:
  * is used by the build system in the suffix of the name of the _sysconfigdata 
private module, it may have any value (including being empty) when the platform 
is non-multiarch - for example cross-compiling for an Android emulator with the 
'foo-bar-foobar' MULTIARCH triplet works just fine (without the patch)
  * is not used by the interpreter
  * the Python user may not use it (sys.implementation_multiarch is private)
  * is not used in the standard library, except by the sysconfig modules to get 
the name of the _sysconfigdata module (and it may be empty)
  * is not needed any more to cross-compile non-multiarch platforms (even 
without the patch) since issue 28046, where platform-specific directories have 
been removed

On Android the MULTIARCH triplet adds the burden of having to maintain the list 
of Android processors and abis in configure.ac through a set of complex 
conditionals (see below [1]) whose correctness is uncertain and not verified. 
This is useless and removed since it is not needed anymore.

[1] The Android set of conditionals in configure.ac:

#if defined(__ANDROID__)
# if defined(__x86_64__) && defined(__LP64__)
x86_64-linux-android
# elif defined(__i386__)
i686-linux-android
# elif defined(__aarch64__) && defined(__AARCH64EL__)
#  if defined(__ILP32__)
aarch64_ilp32-linux-android
#  else
aarch64-linux-android
#  endif
# elif defined(__ARM_EABI__) && defined(__ARMEL__)
arm-linux-androideabi
# elif defined(__mips_hard_float) && defined(_MIPSEL)
#  if _MIPS_SIM == _ABIO32
mipsel-linux-android
#  elif _MIPS_SIM == _ABI64
mips64el-linux-android
#  else
#   error unknown platform triplet
#  endif
# else
#   error unknown platform triplet
# endif

--

___
Python tracker 

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



[issue28849] do not define sys.implementation._multiarch on Android

2016-12-03 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The change made by the patch in Makefile.pre.in handles the removing of the 
dangling underscore in the patch of issue 28833, it is not needed.
android_multiarch_2.patch is simpler: the change in Makefile.pre.in has been 
removed and test_triplet_in_ext_suffix is now skipped when sys.implementation 
does not have the _multiarch attribute instead of only for android as 
previously.

--
Added file: http://bugs.python.org/file45739/android_multiarch_2.patch

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2016-12-03 Thread R. David Murray

R. David Murray added the comment:

Looks like it fell off everyone's radar.It is now also too late in the 3.6 
release cycle: it isn't "release critical" in the sense of being a breaking 
regression from 3.5, so it is not likely to get in.

Keep in mind that this is a distributed, mostly volunteer community.  Clearly 
no one else thought it was a release blocker, but you have presented a case for 
making it so.  I haven't evaluated that case; I'm leaving that to the windows 
devs.  Having your input a few weeks ago would have made it more likely to get 
in to 3.6, regardless of whether or not anyone else thought it was a release 
blocker.

And please check back after the 3.6 release, and advocate for getting it in to 
the next release of both 3.5 and 3.6.

--
priority: normal -> deferred blocker

___
Python tracker 

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



[issue26683] Questionable terminology for describing what locals() does

2016-12-03 Thread Marco Buttu

Marco Buttu added the comment:

The documentation [1] says: "If a variable is used in a code block but not 
defined there, it is a free variable." According to this description,  it seems 
to me that the variable ``x`` is free in ``foo()``::

  >>> def foo():
  ... print(x)

But actually for the code object it is not::

  >>> foo.__code__.co_freevars
  ()

The meaning of free variable used for the code object is consistent with the 
``locals()`` documentation [2]: "Free variables are returned by locals() when 
it is called in function blocks". In fact, in the following code ``x` is not a 
free variable for ``locals()``::

  >>> def foo():
  ... print(x)
  ... print(locals())
  ... 
  >>> x = 3
  >>> foo()
  3
  {}

So, I thing there is an inconsistency between the definition of "free variable" 
given in [1] and the meaning of "free variable" both in the code object and in 
the ``locals()`` documentation [2]. 
But if we change the definition of "free variable" according to the meaning of 
both the code object and ``locals()``, I am afraid we go in the wrong 
direction, because I suspect for most people the proper definition of free 
variable is the one given in [1]. Also for Wikipedia [3]: "In computer 
programming, the term free variable refers to variables used in a function that 
are neither local variables nor parameters of that function.".

Instead, if we keep or remove the definition of "free variable" given in [1], I 
agree with Terry to change the ``locals()`` documentation, writing that 
"``locals()`` includes also the locals of the surrounding function contexts, 
even though they are called 'nonlocal' within the nested function.". Maybe it 
is also worth adding a shell example, to better clarify. 

So, at the end, to me the ideal solution would be to keep in [1] the current 
definition of "free variable", to change the ``locals()`` documentation 
according to Terry suggestion, and to change the behavior of 
``code.co_freevars`` (maybe not only this) in order to fit the definition.


[1] https://docs.python.org/3/reference/executionmodel.html#naming-and-binding
[2] https://docs.python.org/3/library/functions.html#locals
[3] https://en.wikipedia.org/wiki/Free_variables_and_bound_variables

--
nosy: +marco.buttu

___
Python tracker 

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



[issue28853] locals() and free variables

2016-12-03 Thread Marco Buttu

Marco Buttu added the comment:

Sorry, in the last example, for the code object ``x`` is not free both in 
``foo()`` and ``moo()``, but this does not affect the conclusion.

--

___
Python tracker 

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



[issue28853] locals() and free variables

2016-12-03 Thread Marco Buttu

Marco Buttu added the comment:

Martin, I removed the class blocks by accident. In any case, I reject the patch 
by myself, because to me the definition of "free variable" is not clear. 
The documentation [1] says: "If a variable is used in a code block but not 
defined there, it is a free variable." According to this description,  it seems 
to me that ``x`` is free both in ``foo()`` and in ``moo()``:


>>> def foo():
... print(x)
... def moo():
... print(x)
... return moo


But actually for the code object it is not:


>>> foo.__code__.co_freevars
()
>>> moo.__code__.co_freevars
('x',)


Thank you for your feedback, I will continue the discussion in issue 26683.

[1] https://docs.python.org/3/reference/executionmodel.html#naming-and-binding

--

___
Python tracker 

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



[issue27305] Crash with "pip list --outdated" on Windows 10 with Python 2.7.12rc1

2016-12-03 Thread Максим Лукоянов

Максим Лукоянов added the comment:

I still got the same issue with 2.7.12 x64 release version from 
https://www.python.org/downloads/release/python-2712/

--
nosy: +Максим Лукоянов

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2016-12-03 Thread Edward K. Ream

Edward K. Ream added the comment:

The last message on this thread was in January, and this item is Open. 
According to Pep 478, 3.5.2 final was released Sunday, June 26, 2016.

How is this issue not a release blocker?

Why does there appear to be no urgency in fixing this bug?

This bug bites for 64-bit versions of Python 3. When it bit, it caused Leo to 
crash during startup. When it bit, it was reason to recommend Python 2 over 
Python 3.

I have just released an ugly workaround in Leo. So now Leo itself can start up, 
but there is no guarantee that user plugins and scripts will work.

Imo, no future version of Python 3 should go out the door until this bug is 
fixed, for sure, and for all time. If you want people to use Python 3, it can 
NOT have this kind of bug in it.

--
nosy: +Edward.K..Ream

___
Python tracker 

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



[issue28638] Creating namedtuple is too slow to be used in common stdlib (e.g. functools)

2016-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Argument Clinic is used just for running the generating code and inlining the 
result. This is the simplest part of Argument Clinic and using it looks an 
overhead. Argument Clinic has other disadvantages:

* In any case you need a rule in Makefile, otherwise the generated code can 
became outdated.

* Generated code depends not just on the generator code, but on the code of the 
collections module.

* Even tiny change in the generating code, namedtuple implementation or 
Argument Clinic code could need regenerating generated code with different 
checksums.

My second idea, more general solution, was making namedtuple itself using 
external caching. This would add a benefit for all users of namedtuple without 
changing a user code or with minimal changes.

namedtuple itself can save a bytecode and a source in files (like Java creates 
additional .class files for internal classes) and use a bytecode if it is not 
outdated. Generalized import machinery could be used for supporting generated 
code in a sync.

--

___
Python tracker 

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



[issue28638] Creating namedtuple is too slow to be used in common stdlib (e.g. functools)

2016-12-03 Thread INADA Naoki

INADA Naoki added the comment:

> That leads into my main comment on the AC patch: the files that are 
> explicitly listed as triggering a new clinic run should be factored out into 
> a named variable and that list commented accordingly.

done.

--
Added file: http://bugs.python.org/file45738/namedtuple-clinic3.patch

___
Python tracker 

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



[issue27647] Update Windows build to Tcl/Tk 8.6.6

2016-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch updates Tcl/Tk versions to 8.5.19 and Tix version to 8.4.3.6 in 
Python 2.7 on Windows and Mac OS X. But needed to update 
http://svn.python.org/projects/external/ . Is there special script or 
instruction?

--
keywords: +patch
Added file: http://bugs.python.org/file45737/update-tk-2.7.patch

___
Python tracker 

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