[issue26865] Meta-issue: support of the android platform

2016-05-21 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
dependencies: +Large files are not supported on Android, RTLD_* macros are not 
defined on Android, add is_android in test.support to detect Android platform, 
android: test_cmd_line fails, android: test_concurrent_futures fails, android: 
test_concurrent_futures hangs on armv7, android: test_ctypes crashes on armv7, 
android: test_distutils fails, android: test_faulthandler fails, android: 
test_functools hangs on armv7, android: test_importlib hangs on armv7, android: 
test_mmap fails, android: test_multiprocessing_main_handling fails, android: 
test_os fails, android: test_pipes fails, android: test_posix fails, android: 
test_posixpath fails, android: test_site fails, android: test_socket fails, 
android: test_strptime fails, android: test_sys fails, android: test_tarfile 
fails, android: test_threading hangs on armv7

___
Python tracker 

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



[issue26865] Meta-issue: support of the android platform

2016-05-21 Thread Xavier de Gaye

Xavier de Gaye added the comment:

No, regular users can't adjust dependencies, but I can now. Thanks Zachary.

--

___
Python tracker 

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



[issue27073] redundant checks in long_add and long_sub

2016-05-21 Thread Oren Milman

New submission from Oren Milman:

 the proposed changes 
I believe the following checks are redundant:
1. in Objects/longobject.c in long_add:
In case both a and b are negative, their absolute values are added 
using x_add, with the result stored in z.
If (z != NULL), it must be that x_add succeeded, and also it must be 
that (Py_SIZE(z) > 0), as it is guaranteed that the absolute values of a and b 
are both bigger than zero.
Thus, the check (Py_SIZE(z) != 0) here is redundant.
2. in Objects/longobject.c in long_sub:
In case a is negative, the absolute values of a and b are subtracted or 
added using x_sub or x_add, with the result stored in z.
Later on, if (z != NULL && Py_SIZE(z) != 0), then Py_SIZE(z) is 
negated. However, even though it might be that Py_SIZE(z) == 0, it doesn't 
really matter.
doing 'Py_SIZE(z) = -(Py_SIZE(z));' in that case would do nothing.
Thus, the check (Py_SIZE(z) != 0) here is redundant.

The original versions of both of these checks were added in revision 443 
(November 1991!). Back then, ob_size's was implemented using one's complement, 
and negating it was actually doing 'z->ob_size = ~z->ob_size;'. 
Of course, in that case the check (z->ob_size != 0) was necessary, but 
then, in revision 590, ob_size was changed to use two's complement, and the 
check (z->ob_size != 0) was left untouched, and remained there to this day.


 diff 
The patches diff is attached.


 tests 
I built the patched CPython for x86, and played with it a little. Everything 
seemed to work as usual.

In addition, I ran 'python -m test' (on my 64-bit Windows 10) before and after 
applying the patch, and got quite the same output.
the outputs of both runs are attached.

--
components: Interpreter Core
files: issue.diff
keywords: patch
messages: 265989
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: redundant checks in long_add and long_sub
Added file: http://bugs.python.org/file42920/issue.diff

___
Python tracker 

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



[issue27073] redundant checks in long_add and long_sub

2016-05-21 Thread Oren Milman

Changes by Oren Milman :


Added file: http://bugs.python.org/file42921/CPythonTestOutput.txt

___
Python tracker 

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



[issue27073] redundant checks in long_add and long_sub

2016-05-21 Thread Oren Milman

Changes by Oren Milman :


Added file: http://bugs.python.org/file42922/patchedCPythonTestOutput.txt

___
Python tracker 

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



[issue27074] Confusing text about __all__ in __init__.py in tutorial

2016-05-21 Thread Antti Haapala

New submission from Antti Haapala:

https://docs.python.org/3/tutorial/modules.html#importing-from-a-package

says that 

"The import statement uses the following convention: if a package’s __init__.py 
code defines a list named __all__, it is taken to be the list of module names 
that should be imported when from package import * is encountered."

However, of course this is not true. The behaviour is that `__all__` lists the 
names that are to be imported from the package with from package import *; only 
only those names that raise AttributeError at the time of import would be 
attempted to be imported as submodules.

--
assignee: docs@python
components: Documentation
messages: 265990
nosy: docs@python, ztane
priority: normal
severity: normal
status: open
title: Confusing text about __all__ in __init__.py in tutorial
type: enhancement

___
Python tracker 

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



[issue27073] redundant checks in long_add and long_sub

2016-05-21 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +haypo, serhiy.storchaka, yselivanov
stage:  -> patch review
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



[issue27075] Link to StreamReader/Writer from codecs.getreader/writer

2016-05-21 Thread Ville Skyttä

New submission from Ville Skyttä:

Patch attached.

--
assignee: docs@python
components: Documentation
files: codeclinks.patch
keywords: patch
messages: 265991
nosy: docs@python, scop
priority: normal
severity: normal
status: open
title: Link to StreamReader/Writer from codecs.getreader/writer
type: enhancement
Added file: http://bugs.python.org/file42923/codeclinks.patch

___
Python tracker 

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



[issue27076] Doc and comment spelling fixes

2016-05-21 Thread Ville Skyttä

New submission from Ville Skyttä:

Patch attached.

--
assignee: docs@python
components: Documentation, Library (Lib)
files: docs.patch
keywords: patch
messages: 265992
nosy: docs@python, scop
priority: normal
severity: normal
status: open
title: Doc and comment spelling fixes
type: enhancement
Added file: http://bugs.python.org/file42924/docs.patch

___
Python tracker 

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



[issue27070] Add ability to freeze (seal) mutable objects

2016-05-21 Thread Eric V. Smith

Eric V. Smith added the comment:

There's a link in the PEP to the discussion on why it was rejected. There's a 
lot to read in the thread (I just spent 30 minutes re-reading it!).

I'm going to close this. If you'd like to re-open the discussion with new 
insights, I'd suggest posting to python-ideas. But, given the existing 
discussion referenced by the PEP, I don't have high hopes, unless you have a 
compelling use case (which is always possible, of course).

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



[issue27075] Link to StreamReader/Writer from codecs.getreader/writer

2016-05-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c1628c1162a4 by Berker Peksag in branch '3.5':
Issue #27075: Link to StreamReader and StreamWriter docs
https://hg.python.org/cpython/rev/c1628c1162a4

New changeset b11b71aaf864 by Berker Peksag in branch 'default':
Issue #27075: Link to StreamReader and StreamWriter docs
https://hg.python.org/cpython/rev/b11b71aaf864

--
nosy: +python-dev

___
Python tracker 

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



[issue27075] Link to StreamReader/Writer from codecs.getreader/writer

2016-05-21 Thread Berker Peksag

Berker Peksag added the comment:

Thanks, Ville.

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
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



[issue27076] Doc and comment spelling fixes

2016-05-21 Thread Martin Panter

Martin Panter added the comment:

Thanks Ville for this. It mostly looks good. I left some comments regarding 
“heterogenous”.

I extended the patch with related fixes, mainly outside the Doc/ and Lib/ 
directories. Whoever commits this should also regenerate importlib, the 
configure script, and Arg Clinic code (not included in patches).

I’m not too sure about the Lib/msilib/schema.py file because it looks like 
generated code. But I see that other people have fixed it, so maybe that is 
okay.

--
nosy: +martin.panter
stage:  -> patch review
versions: +Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file42925/docs.v2.patch

___
Python tracker 

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



[issue27067] Improve curses tests

2016-05-21 Thread Martin Panter

Martin Panter added the comment:

I guess this might help Issue 12669 (running the test on buildbots)? I had 
assumed a real terminal was required, but it looks like you are substituting a 
temporary file.

--
nosy: +martin.panter

___
Python tracker 

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



[issue27077] test_port_parameter_types fails with BytesWarning

2016-05-21 Thread Berker Peksag

New submission from Berker Peksag:

The relevant changeset is 1570e3855ce8. Here is a traceback from a random 
buildbot:

==
ERROR: test_port_parameter_types 
(test.test_asyncio.test_base_events.BaseEventTests)
--
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/test_asyncio/test_base_events.py",
 line 143, in test_port_parameter_types
base_events._ipaddr_info('1.2.3.4', b'1', INET, STREAM, TCP))
BytesWarning: Comparison between bytes and string

http://buildbot.python.org/all/builders/s390x%20Debian%203.x/builds/1100/steps/test/logs/stdio

--
components: Tests
messages: 265998
nosy: berker.peksag, yselivanov
priority: normal
severity: normal
stage: needs patch
status: open
title: test_port_parameter_types fails with BytesWarning
type: behavior
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



[issue27064] Make py.exe default to Python 3 when used interactively

2016-05-21 Thread Paul Moore

Paul Moore added the comment:

Terry: Correct.

As 3.4 is in security fix mode, and 2.7 doesn't come with the launcher (which I 
hadn't realised - thanks for pointing this out Zach!) the only real backport 
candidate is 3.5, so I definitely don't think it's worth backporting just for 
that.

Maybe it would be worth making a link available to the latest version of the 
installer, though, for people who want to upgrade. What do you think, Steve? 
From what you said I get the impression it's already there, just needs adding 
to the download page.

--

___
Python tracker 

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



[issue22558] Missing doc links to source code

2016-05-21 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Yoni. Like Guido said in msg257586, we only want to add 
links for pure Python modules. Can you update your patch to remove C modules 
please?

I'd prefer keep curses docs untouched. Lib/curses/* is basically a wrapper to 
_cursesmodule.c with some utility functions (sqlite3 is another example of 
this).

Another candidates for removal are distutils.core, wsgiref, ensurepip, 
formatted (it's deprecated), test (Lib/test is basically the test suite of 
CPython) modules.

--
nosy: +berker.peksag
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



[issue27073] redundant checks in long_add and long_sub

2016-05-21 Thread Mark Dickinson

Mark Dickinson added the comment:

Your analysis and patch look good to me.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue27073] redundant checks in long_add and long_sub

2016-05-21 Thread STINNER Victor

STINNER Victor added the comment:

Sorry, I didn't check if the change is valid or not, but:

>  issue.diff 

Please keep the check but as an assertion (Put it in the if block).

--

___
Python tracker 

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



[issue5187] distutils upload should prompt for the user/password too

2016-05-21 Thread Berker Peksag

Berker Peksag added the comment:

Issue 18454 is a duplicate of this, but I'm going to close this one (there are 
patches for 2.7 and 3.5 in issue 18454).

--
nosy: +berker.peksag
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> distutils crashes when uploading to PyPI having only the 
username (no pw) defined

___
Python tracker 

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



[issue27073] redundant checks in long_add and long_sub

2016-05-21 Thread Oren Milman

Oren Milman added the comment:

Thanks for the reviews!

I added an assert in long_add (in long_sub it might be that the result is 0).
The updated diff file is attached.

--
Added file: http://bugs.python.org/file42926/issue27073.diff

___
Python tracker 

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



[issue13615] setup.py register fails with -r argument

2016-05-21 Thread Berker Peksag

Berker Peksag added the comment:

The repository URL has been changed to https://pypi.python.org/pypi in 
2b5cd6d4d149. I'm -1 on making https://pypi.python.org/ a special case.

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



[issue27051] Create PIP gui

2016-05-21 Thread Upendra Kumar

Upendra Kumar added the comment:

I have uploaded my first iteration of design process for Tkinter. In the 
uploaded document "Design_notes_v1.docx", we have tried to identify different 
use cases and tasks to be fulfilled by the PIP GUI.

If there are any suggestions regarding further changes or possible use cases, 
please let me know. I will upload design of different page layouts for the GUI 
soon.

--
Added file: http://bugs.python.org/file42927/Design_notes_v1.docx

___
Python tracker 

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



[issue26928] _bootlocale imports locale at startup on Android

2016-05-21 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Sorry for the confusion, the file system encoding is not the locale encoding.

In issue #9548, Antoine proposed a patch that avoids the import of the re, 
collections and functools modules by the _io module on startup, by refactoring 
and moving code from locale to _bootlocale. The attached refactor_locale.patch 
does that for python 3.6. The reasons for why Antoine patch has not been pushed 
still apply to this patch :(

The patch does fix the problem for Android though.

--
keywords: +patch
title: android: test_site fails -> _bootlocale imports locale at startup on 
Android
Added file: http://bugs.python.org/file42928/refactor_locale.patch

___
Python tracker 

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



[issue26928] _bootlocale imports locale at startup on Android

2016-05-21 Thread Xavier de Gaye

Xavier de Gaye added the comment:

An improvement to Python startup time on Android (Android does not have 
nl_langinfo()) is to have _bootlocale.getpreferredencoding() return 'ascii' 
without importing locale, when none of the locale environment variables is set. 
With patch no-locale-envvar.patch, test_site runs ok on android-21-x86 emulator 
when the locale environment variables are not set.

Committing this patch while leaving the current issue open would also allow 
removing this issue from the dependencies of the Android meta-issue #26865.

--
Added file: http://bugs.python.org/file42929/no-locale-envvar.patch

___
Python tracker 

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



[issue27064] Make py.exe default to Python 3 when used interactively

2016-05-21 Thread Steve Dower

Steve Dower added the comment:

Unfortunately, the current MSI for the launcher doesn't have a great interface 
when used separately from the main installer. It happens to be more functional 
than the rest (i.e. double-clicking it will give you a very quick per-user 
install, whereas the other MSIs that make up the installer will fail), but it's 
not at a point where I'd be comfortable to link directly to it.

Could I get it there? Absolutely. Not a real high priority though - there are 
some weird upgrade/modify edge cases that I'd rather figure out first.

--

___
Python tracker 

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



[issue27051] Create PIP gui

2016-05-21 Thread lorenzogotuned

lorenzogotuned added the comment:

Ok Upendra. Nice summary. 

In the next days:
- Explain each *top task* (install, unistall, update) and in detail the way the 
underlying pip commands work (underline mandatory and optional parameters, 
requests performed to servers, filesystem storage and anything involved)
- Map your natural explanation into different *page views* (each page view 
conrainig well defined UI components and structures)
- Design and *sketch* each page (upload image files. I saw you had started 
doing it in the previous issue; make them much more explicative, name or assign 
a number to each view and UI component)
- Simplify and optimize each task flow and page (get familiar and be precise 
with the vocabulary needed to describe the UI)
- write at least one user case for command (install: user search the xyz string 
in a package in the input box, user clicks on a item in the ywz panel, the user 
clicks the abc button, etc) in the shape of ordered lists or better flow charts.

This will complete the first design iteration.

After receiving feedback and adjusting the sketches, I think we can dive into 
tkinter to find the right objects/patterns to start coding.

--

___
Python tracker 

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



[issue23551] IDLE to provide menu link to PIP gui.

2016-05-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Upendra Kumar's GSOC pip-gui proposal has been accepted.  It is issue #27051 
and progress can be followed there.  I leave this issue open, at least for now, 
for invoking the gui from IDLE.

--

___
Python tracker 

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



[issue27067] Improve curses tests

2016-05-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 55852de7d032 by Serhiy Storchaka in branch '3.5':
Issue #27067: Improved curses tests.
https://hg.python.org/cpython/rev/55852de7d032

New changeset 2917a3ce988e by Serhiy Storchaka in branch 'default':
Issue #27067: Improved curses tests.
https://hg.python.org/cpython/rev/2917a3ce988e

--
nosy: +python-dev

___
Python tracker 

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



[issue27067] Improve curses tests

2016-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Berker.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed
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



[issue27051] Create PIP gui

2016-05-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I posted notice of this issue on #23551.

I did some research on simulating user interaction for testing.  The results 
are exemplified in the attached tk.generate_event.py with test setups and 
assertions.

Events are generated, to fire event handlers, with
  widget.generate_event(event, **kwds)
where keywords are used to set event attributes.  The uploaded file has 
examples.  The method is briefly described in
  http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/universal.html
This reference has a more extensive coverage of events in a separate chapter.

The above does not mention the need to update the widget first.  I learned this 
from Stackoverflow answers to 'How to make generate_event work?" questions.  
The tcl/tk doc, tcl.tk/man/tcl8.6/TkCmd/event.htm, adds the fact that text 
widgets require focus.

Even though button commands fire when releasing the 'main' button, event 
'' does not work to fire commands.  Instead, use 
'button.invoke()'.

--
stage:  -> test needed
versions: +Python 3.6
Added file: http://bugs.python.org/file42930/tk_generate_event.py

___
Python tracker 

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



[issue27051] Create PIP gui

2016-05-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

My main concern is that the project produce something good enough, even if not 
'perfect' and 'complete', to commit before 3.6.0 beta 1, scheduled 09-07 
https://www.python.org/dev/peps/pep-0494/.  I would actually like to have a 
preliminary version in alpha 4 (08-08) or even alpha 3 (07-11).  It would be 
good to get user feedback before the summer is over.  I will try to document 
the GUI in such a way that the detailed layout and operation are not locked in, 
but can be amended and augmented.

For style, follow PEP 8.  Ask any questions about alternatives and ambiguities 
here.

--

___
Python tracker 

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



[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-05-21 Thread Antti Haapala

New submission from Antti Haapala:

I benchmarked some f'' strings against .format, and surprisingly f'' was slower 
than .format in about all the simple cases I could think of. I guess this is 
because f'' strings implicitly use `''.join([])`.

The byte code for f'foo is {foo}' currently is

  1   0 LOAD_CONST   1 ('')
  3 LOAD_ATTR0 (join)
  6 LOAD_CONST   2 ('foo is ')
  9 LOAD_GLOBAL  1 (foo)
 12 FORMAT_VALUE 0
 15 BUILD_LIST   2
 18 CALL_FUNCTION1 (1 positional, 0 keyword pair)

It was mentioned here https://bugs.python.org/issue24965 but since I came up 
with the idea when inspecting this, I'd propose again here that a new opcode be 
added for f'' strings - BUILD_STRING n, with which f'foo is {foo}' could be 
compiled to 

  0 LOAD_CONST   2 ('foo is ')
  3 LOAD_GLOBAL  1 (foo)
  6 FORMAT_VALUE 0
  9 BUILD_STRING 2

instead. Internally this wouldn't even need to call `PyUnicode_Join`, but 
instead `seplen == 0` case could be refactored into a separate function. Not 
only with this is it possible to know the length of the string, but also the 
number of string components are already known, so it'd be possible to build a 
tuple fast from the values on stack.

And that way people doing micro benchmarks would find out that the new Python 
3.6 feature would not only look nice but also be a way to write 
better-performing code.

--
components: Interpreter Core
messages: 266016
nosy: ztane
priority: normal
severity: normal
status: open
title: Make f'' strings faster than .format: BUILD_STRING opcode?
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



[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-05-21 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +eric.smith

___
Python tracker 

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



[issue27077] test_port_parameter_types fails with BytesWarning

2016-05-21 Thread Yury Selivanov

Yury Selivanov added the comment:

I really can't figure out what's going on. I can't reproduce this, and the 
exception doesn't make any sense :(

--

___
Python tracker 

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



[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-05-21 Thread Eric V. Smith

Changes by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 

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



[issue27077] test_port_parameter_types fails with BytesWarning

2016-05-21 Thread Yury Selivanov

Yury Selivanov added the comment:

Alright, I think I know what's going on here -- this seems to be a bug of 
functools.lrucache.  Serhiy, would you be able to look into this?

Testcase:

test.py:

import functools

@functools.lru_cache()
def foo(a):
return

foo('')
foo(b'')

$ python3.5 -bb test.py
Traceback (most recent call last):
  File "test.py", line 8, in 
foo(b'')
BytesWarning: Comparison between bytes and string

--
nosy: +haypo, rhettinger, serhiy.storchaka

___
Python tracker 

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



[issue27064] Make py.exe default to Python 3 when used interactively

2016-05-21 Thread Paul Moore

Paul Moore added the comment:

OK, no problem. Like you say, not a high priority.

--

___
Python tracker 

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



[issue27079] Bugs in curses.ascii predicates

2016-05-21 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Most curses.ascii predicates corresponds C functions declared in . But 
there are some differences:

1. isblank() returns True for space and backspace instead of space and tab.

2. ispunct() returns True for non-ASCII and control characters.

3. iscntrl() returns False for '\x7f'. Note that there is different function 
isctrl().

These differences look as bugs. Proposed patch fixes them and adds tests for 
all curses.ascii functions.

--
components: Library (Lib)
files: curses_ascii.patch
keywords: patch
messages: 266020
nosy: serhiy.storchaka, twouters
priority: normal
severity: normal
stage: patch review
status: open
title: Bugs in curses.ascii predicates
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file42931/curses_ascii.patch

___
Python tracker 

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



[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-05-21 Thread Eric V. Smith

Eric V. Smith added the comment:

I considered doing this, and have some of it implemented. I discussed it with 
Larry Hastings and Mark Shannon at PyCon Ireland, and we decided to just use 
''.format() and the new FORMAT_VALUE opcode, since that was the simplest way to 
fix the previous implementation's faults. That doesn't mean I've given up on 
improving it, of course.

The speed increase would indeed come from avoiding the LOAD_ATTR lookup, not 
building list, and not calling a function.

I'm curious about your benchmarks. Can you share them? I've found f-strings to 
be typically faster than .format(). But I can't say my benchmarks are 
particularly awesome.

--

___
Python tracker 

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



[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-05-21 Thread Eric V. Smith

Eric V. Smith added the comment:

I've created issue 27080 to track the formatting part of this.

--

___
Python tracker 

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



[issue27077] test_port_parameter_types fails with BytesWarning

2016-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The workaround is using lru_cache(typed=True).

--

___
Python tracker 

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



[issue27080] Implement the formatting part of PEP 515, '_' in numeric literals.

2016-05-21 Thread Eric V. Smith

New submission from Eric V. Smith:

I've separated this out from issue 26331, so as to not interfere with 
discussions and code reviews for the parsing portion of the PEP.

--
assignee: eric.smith
components: Interpreter Core
messages: 266023
nosy: eric.smith
priority: normal
severity: normal
status: open
title: Implement the formatting part of PEP 515, '_' in numeric literals.
type: enhancement

___
Python tracker 

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



[issue27080] Implement the formatting part of PEP 515, '_' in numeric literals.

2016-05-21 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +georg.brandl

___
Python tracker 

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



[issue27077] test_port_parameter_types fails with BytesWarning

2016-05-21 Thread Yury Selivanov

Yury Selivanov added the comment:

> The workaround is using lru_cache(typed=True).

Yes, seems to be working! Thanks.

--

___
Python tracker 

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



[issue27081] Multiprocessing is not robust against sys.stderr changes

2016-05-21 Thread ppperry

New submission from ppperry:

In this code, one would expect that the entire traceback from the uncaught 
recursion error would get put onto the queue, where it could be read in the 
main process.
  queue = multiprocessing.Queue()
  def do_stderr(queue):
class f:
def write(self, data):
queue.put(data)
def flush(self):
pass
import sys
sys.stderr = f()
def g():
g()
g()
multiprocessing.Process(target=do_stderr,args=(queue,)).start()

However, only some of the output actually gets enqueued:

 Process IdleProcess-6:
 Traceback (most recent call last):
 File "C:\Python34\lib\multiprocessing\process.py", line 254, in _bootstrap
self.run()
  File "C:\Python34\lib\multiprocessing\process.py", line 93, in run
self._target(*self._args, **self._kwargs)
  File "", line 12, in do_stderr
  File "", line 11, in g
  File "", line 11, in g
  File "", line 11, in g
  File "", line 11, in g
  File "", line 11, in g
  File "", line 11, in g
  File "", line 11, in g
  File "", line 11, in g
  File "", line 11, in g
  File "", line 11, in g
  File "", line 11, in g
  File "", line 11, in g
  File "", line 11, in g

The rest of the data is not accessible.

--
components: Library (Lib)
messages: 266026
nosy: ppperry
priority: normal
severity: normal
status: open
title: Multiprocessing is not robust against sys.stderr changes
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



[issue27081] Multiprocessing is not robust against sys.stderr changes

2016-05-21 Thread ppperry

Changes by ppperry :


--
nosy: +jnoller, sbt

___
Python tracker 

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



[issue27077] test_port_parameter_types fails with BytesWarning

2016-05-21 Thread Yury Selivanov

Yury Selivanov added the comment:

Berker, it should be fixed now in 
https://hg.python.org/cpython/rev/bdfb15aa3ac5 (sorry, I forgot to reference 
the issue in the commit message)

--

___
Python tracker 

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



[issue27081] Multiprocessing is not robust against sys.stderr changes

2016-05-21 Thread ppperry

ppperry added the comment:

Replacing the first line with `queue = multiprocessing.SimpleQueue()` fixes 
this issue.

--

___
Python tracker 

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



[issue26928] _bootlocale imports locale at startup on Android, causing test_site to fail

2016-05-21 Thread ppperry

Changes by ppperry :


--
title: _bootlocale imports locale at startup on Android -> _bootlocale imports 
locale at startup on Android, causing test_site to fail

___
Python tracker 

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



[issue27077] test_port_parameter_types fails with BytesWarning

2016-05-21 Thread Berker Peksag

Berker Peksag added the comment:

Yes, buildbots look happy now. Thanks!

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



[issue27077] test_port_parameter_types fails with BytesWarning

2016-05-21 Thread STINNER Victor

STINNER Victor added the comment:

On Python 3, comparison between str and bytes raises a BytesWarning exception 
if python3 is started with -bb. But sometimes, you really want to compare str 
with bytes. For example, os.get_exec_path() changes temporarely the 
BytesWarning warning for that!

# {b'PATH': ...}.get('PATH') and {'PATH': ...}.get(b'PATH') emit a
# BytesWarning when using python -b or python -bb: ignore the warning
with warnings.catch_warnings():
warnings.simplefilter("ignore", BytesWarning)
...

--

___
Python tracker 

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



[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-05-21 Thread Martijn Pieters

Changes by Martijn Pieters :


--
nosy: +mjpieters

___
Python tracker 

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



[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-05-21 Thread Martijn Pieters

Martijn Pieters added the comment:

The catalyst for this question was a Stack Overflow question I answered: 


https://stackoverflow.com/questions/37365311/why-are-python-3-6-literal-formatted-strings-so-slow

Compared the `str.format()` the BUILD_LIST is the bottleneck here; dropping the 
LOAD_ATTR and CALL_FUNCTION opcodes are nice bonuses.

--

___
Python tracker 

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



[issue27081] Multiprocessing is not robust against sys.stderr changes

2016-05-21 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +davin

___
Python tracker 

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



[issue24459] Mention PYTHONFAULTHANDLER in the man page

2016-05-21 Thread Joshua Jay Herman

Joshua Jay Herman added the comment:

Hi, I have alphabetized and added the missing Environment Variables according 
to Section 1.2 
https://docs.python.org/3.6/using/cmdline.html#environment-variables . I also 
added the missing environment variables from that documentation section.

Should Section 1.2 also be alphabetized? I noticed it wasn't.

This is my first contribution to python (I also just filled out the contributor 
forms) any comments and criticism is appreciated.

--
keywords: +patch
nosy: +zitterbewegung
Added file: 
http://bugs.python.org/file42932/addMissingEnvVarsAndAlphabetize.patch

___
Python tracker 

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



[issue27067] Improve curses tests

2016-05-21 Thread Martin Panter

Martin Panter added the comment:

A couple buildbots don’t look happy with this change, e.g.

http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.5/builds/903/steps/test/logs/stdio

==
ERROR: test_colors_funcs (test.test_curses.TestCurses)
--
Traceback (most recent call last):
  File 
"/srv/buildbot/buildarea/3.5.bolen-ubuntu/build/Lib/test/test_curses.py", line 
66, in setUp
curses.savetty()
_curses.error: savetty() returned ERR

(more failures follow)

--
status: closed -> open

___
Python tracker 

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



[issue27072] random.getrandbits is limited to 2**31-1 bits on 64-bit Windows

2016-05-21 Thread Campbell Barton

Campbell Barton added the comment:

> This probably isn't an issue on non-Windows or 64-bit systems.

In fact it is, the limitation applies to 64bit Linux too. (tested in CPython 
3.5.1)

--
nosy: +ideasman42

___
Python tracker 

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



[issue22558] Missing doc links to source code

2016-05-21 Thread Yoni Lavi

Yoni Lavi added the comment:

Thank you for the review, Berker.
I removed source code links from all the modules you specifically mentioned, 
and all links to C code, including stat.rst which already had such a link 
before.

But I have to say that I don't quite understand the rationale here and (as a 
user) would personally prefer easy access to all source code, both C and 
Python. It is my opinion that a handy link to the source would help promote the 
conversion of library users to contributors.

--
Added file: http://bugs.python.org/file42933/mywork2.patch

___
Python tracker 

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



[issue27072] random.getrandbits is limited to 2**31-1 bits on 64-bit Windows

2016-05-21 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue27072] random.getrandbits is limited to 2**31-1 bits on 64-bit Windows

2016-05-21 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27072] random.getrandbits is limited to 2**31-1 bits on 64-bit Windows

2016-05-21 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Since the downstream calls to PyMem_Malloc and _PyLong_FromByteArray both 
accept size_t for their sizing, there isn't a problem there.

That said, I think the current limitation nicely protects us from harm.  If you 
were to run getrandbits(2**60) it would take a long time, eat all your memory, 
trigger swaps until your harddrive was full, and you wouldn't be able to break 
out of the tight loop with a keyboard interrupt.

Even with the current limit, the resultant int object is ridiculously big in a 
way that is awkward to manipulate after it is created (don't bother trying to 
print it, jsonify it, or doing any interesting math it).

Also, if a person wants a lot of bits, it is effortless to make repeated calls 
getrandbits() using the current API.  Doing so would likely improve their code 
and be a better design (consuming bits as generated rather than creating them 
all at once and extracting them later).

In short, just because we can do it, doesn't mean we should.

--

___
Python tracker 

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



[issue24550] maxint on 64 bit platforms breaks os.read

2016-05-21 Thread Martin Panter

Martin Panter added the comment:

Sorry in Python 3.5 the change was actually Issue 21932 (not Arg Clinic). But 
Victor said that change shouldn’t go into Python 2.

BTW Issue 21199 is about Python 2’s file.read() method, not os.read().

--
resolution: duplicate -> wont fix
superseder:  -> os.read() must use Py_ssize_t for the size parameter

___
Python tracker 

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



[issue25548] Show the address in the repr for class objects

2016-05-21 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> I don't quite get why the memory address is helpful

For the same reason that we've found the address to helpful in other reprs, it 
helps people understand that classes are objects just like anything else and to 
know which objects are distinct.

My instructors have found that this matters when teaching Python and more than 
one of them immediately noticed the loss of information when switching from 
teaching Python 2 to Python 3.

--

___
Python tracker 

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



[issue27072] random.getrandbits is limited to 2**31-1 bits on 64-bit Windows

2016-05-21 Thread Campbell Barton

Campbell Barton added the comment:

@rhettinger, agree that very large ints in this case aren't going to give very 
usable results.

On the other hand, this limit isn't imposed elsewhere (you can power-of 
operator to create bigger numbers).

Nevertheless this isn't going to give good/usable performance.



Might having a method added to `randome.Random` that returns random bits (as 
os.urandom does), be something Python project would consider accepting?

--

___
Python tracker 

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



[issue18100] socket.sendall() cannot send buffers of 2GB or more

2016-05-21 Thread Martin Panter

Martin Panter added the comment:

Looks like this was fixed in 3.1 and 3.2 by r84150.

--
nosy: +martin.panter
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



[issue27082] IDLE seriously degrades during and after printing large single line strings

2016-05-21 Thread Raymond Hettinger

New submission from Raymond Hettinger:

IDLE should check the size of lines in a result string before printing it.  
Perhaps it should have a "..." after some user settable limit is reached.

>>> '=' * 10# Destroys IDLE
>>> json.load(somebigfile)  # Makes IDLE unusably sluggish

The problem only occurs when an individual line is long:

>>> s = 'some reasonable single line\n' * 1000)
>>> print(s)  # Separate lines are no problem
>>> s # A big single line repr renders IDLE sluggish

Note, the sluggishness persists across sessions -- a "Restart Shell" doesn't 
help.

In my Python classes, this is a common and recurring problem that negatively 
impacts the learner's user experience.

--
assignee: terry.reedy
components: IDLE
messages: 266041
nosy: rhettinger, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE seriously degrades during and after printing large single line 
strings
type: resource usage

___
Python tracker 

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



[issue27082] IDLE seriously degrades during and after printing large single line strings

2016-05-21 Thread Tim Peters

Tim Peters added the comment:

Ya, this annoyance has been there forever.  As I recall, the source of the 
problem is the Tk text widget (which slows horribly when displaying long lines).

--
nosy: +tim.peters

___
Python tracker 

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



[issue20699] Document that binary IO classes work with bytes-likes objects

2016-05-21 Thread Martin Panter

Martin Panter added the comment:

I updated my patch thanks to Serhiy’s comments. Also omitted Arg Clinic 
generated code in this version to avoid future merge conflicts with the hashes.

--
versions: +Python 3.6 -Python 3.4
Added file: http://bugs.python.org/file42934/bytes-like-param.v6.patch

___
Python tracker 

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



[issue27072] random.getrandbits is limited to 2**31-1 bits on 64-bit Windows

2016-05-21 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> On the other hand, this limit isn't imposed elsewhere.

There are a number of places in the language with these limits.  In general, 
we're opening them up to wider limits if there are valid use cases and if it 
doesn't immediately shoot you in the foot like it does here.

Practicality is a reasonable design consideration.  Mitigation of harm is also 
reasonable design consideration.  Foolish consistently is, well, you know how 
the saying goes :-)

> Might having a method added to `randome.Random` that returns 
> random bits (as os.urandom does), be something Python project
> would consider accepting?

It isn't needed.  As far as I know, there has never been a user request for 
this functionality nor a presentation of use cases that benefit it.  The API is 
already bloated and we already have one way to do it with int.to_bytes().  
Also, we should keep this tracker entry focused on the OP's report and not 
meander.

--

___
Python tracker 

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



[issue27072] random.getrandbits is limited to 2**31-1 bits on 64-bit Windows

2016-05-21 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +tim.peters

___
Python tracker 

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



[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-05-21 Thread Demur Rumed

Demur Rumed added the comment:

Based on serhiy's LGTM I'm uploading hopefully final touches based on his 
feedback

New in this are changes to Makefile.pre & PCbuild files. I can't really test 
PCbuild but I did test that make followed by modifying wordcode_helpers.h 
followed by make rebuilds peephole & compile. There's now also modification of 
PC/launcher.c to include 3370 as 3.6

Doc/library/dis.rst: I've reverted changes to HAVE_ARGUMENT description since 
most of my 'pedantic' changes to differentiate between using arguments & 
ignoring arguments have been reverted

--
Added file: http://bugs.python.org/file42935/wpy9.patch

___
Python tracker 

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



[issue27082] IDLE seriously degrades during and after printing large single line strings

2016-05-21 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> IDLE shell window gets very slow when displaying long lines

___
Python tracker 

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



[issue27067] Improve curses tests

2016-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

My bad. I tested only with stdout redirected, the test fail if both stdout and 
stderr are redirected.

Proposed patch fixes this.

--
Added file: http://bugs.python.org/file42936/test_curses_no_atty.patch

___
Python tracker 

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



[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2016-05-21 Thread Martin Panter

Martin Panter added the comment:

I am inclined to go with Alex’s patch. I am uploading a new version of it, 
issue18383_avoid_dups_3.diff, which resolves conflicts with recent changes.

--
versions:  -Python 3.4
Added file: http://bugs.python.org/file42937/issue18383_avoid_dups_3.diff

___
Python tracker 

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



[issue26742] imports in test_warnings changes warnings.filters

2016-05-21 Thread Martin Panter

Martin Panter added the comment:

I suggest to use the patch from Issue 18383.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> test_warnings modifies warnings.filters when running with "-W 
default"

___
Python tracker 

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



[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2016-05-21 Thread Martin Panter

Changes by Martin Panter :


Removed file: http://bugs.python.org/file42937/issue18383_avoid_dups_3.diff

___
Python tracker 

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



[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2016-05-21 Thread Martin Panter

Martin Panter added the comment:

Forgot to refresh my patch

--
Added file: http://bugs.python.org/file42938/issue18383_avoid_dups_3.diff

___
Python tracker 

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



[issue17599] mingw: detect REPARSE_DATA_BUFFER

2016-05-21 Thread Martin Panter

Martin Panter added the comment:

Would it be better to define all the things in "winreparse.h" with names that 
are less likely to conflict, say Py_REPARSE_DATA_BUFFER etc? This would be a 
more general way to avoid conflicts, and also avoid hacking the configure 
script.

Also, is the “#ifndef MAXIMUM_REPARSE_DATA_BUFFER_SIZE” condition necessary?

--
components: +Windows -Cross-Build
nosy: +martin.panter, paul.moore, steve.dower, tim.golden, zach.ware
stage:  -> patch review

___
Python tracker 

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



[issue22636] avoid using a shell in ctypes.util: replace os.popen with subprocess

2016-05-21 Thread Martin Panter

Martin Panter added the comment:

FTR the Python 2.3 compatibility restriction was lifted; see 
.

--

___
Python tracker 

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



[issue26955] Implement equivalent to `pip.locations.distutils_scheme` in distutils

2016-05-21 Thread Ned Deily

Ned Deily added the comment:

"When installing a python package that has `headers`, these headers are usually 
installed under the main python include directory".  Can you give some specific 
examples of packages and platforms where that is the case?  Just taking a quick 
look at some packages I happen to have installed, like lxml and cffi using a 
vanilla pip with a vanilla Unix-y Python 3.5.1, their header files get 
installed in the site-packages directory by default (using pip), not the main 
Python include directory.  And various distributors of Python have their own 
preferences where to install things, for example, the locations you cite are 
those used by Homebrew on OS X and differ from other OS X Pythons.  I'm not 
sure that there is a general solution as things stand now; I think there is 
probably a lot of variability among packages (e.g. their setup.py) and Python 
distributions.

--
nosy: +ned.deily

___
Python tracker 

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



[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

wpy9.patch looks mostly good to me, but there compiler warnings.

--

___
Python tracker 

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



[issue27072] random.getrandbits is limited to 2**31-1 bits on 64-bit Windows

2016-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The only case I know that would benefit is generating random data for tests. On 
my computer generating 2*28 bits with getrandbits() takes 2 sec (including 1 
sec for converting from bytes to int), plus 1.4 sec for converting from int to 
bytes. Special API would speed up generating random bytes by 3.4 times. I would 
request for this functionality, but I don't want to clutter the API.

As for getrandbits.diff, I think that we should follow the principle "we're all 
consenting adults here".

--

___
Python tracker 

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



[issue20699] Document that binary IO classes work with bytes-likes objects

2016-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

bytes-like-param.v6.patch LGTM.

--

___
Python tracker 

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



[issue26971] python v3.5.1: sys.paths not respecting DESTDIRS and DESTSHARED

2016-05-21 Thread Ned Deily

Ned Deily added the comment:

Sorry, I'm not able to reproduce your results on a vanilla Debian system.  
Building from scratch with ./configure --prefix=/usr and make steps results in:

$ /usr/bin/python3.5
Python 3.5.1 (default, May 22 2016, 02:26:09)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import base64
>>> import sys, _struct
>>> _struct.__file__
'/usr/lib/python3.5/lib-dynload/_struct.cpython-35m-x86_64-linux-gnu.so'
>>> sys.path
['', '/usr/lib/python35.zip', '/usr/lib/python3.5', 
'/usr/lib/python3.5/plat-linux', '/usr/lib/python3.5/lib-dynload', 
'/home/sysadmin/.local/lib/python3.5/site-packages', 
'/usr/lib/python3.5/site-packages']
>>>

Is it possible you had a virtual environment in effect?  Try repeating with 
"/usr/bin/python3.5" and verifying the build timestamp.  As far as I know, an 
unpatched Python 3.5 will not attempt to install anything into /usr/lib64 by 
default.

--
nosy: +ned.deily

___
Python tracker 

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



[issue27083] PYTHONCASEOK is ignored on Windows

2016-05-21 Thread Eryk Sun

New submission from Eryk Sun:

importlib ignores the PYTHONCASEOK environment variable on Windows. _relax_case 
checks for b'PYTHONCASEOK' in os.environ, which is never true because 
os.environ is Unicode. On Windows, _make_relax_case should return a function 
that instead checks for 'PYTHONCASEOK'.

The following test demonstrates that case-insensitive imports otherwise appear 
to work correctly in 3.5:

>>> import sys, importlib, glob
>>> glob.glob('*.py')
['Test.py']

>>> importlib._bootstrap_external._relax_case()
False
>>> import test
>>> test.__file__
'C:\\Program Files\\Python35\\lib\\test\\__init__.py'

patched:

>>> src = "_relax_case = lambda: 'PYTHONCASEOK' in _os.environ"
>>> exec(src, vars(importlib._bootstrap_external))
>>> importlib._bootstrap_external._relax_case()
True
>>> del sys.modules['test']
>>> import test
this is a test
>>> test.__file__
'C:\\Temp\\test.py'

It would be better if __file__ were the actual filename "Test.py" instead of 
"test.py".

--
components: Library (Lib), Windows
keywords: easy
messages: 266057
nosy: brett.cannon, eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: PYTHONCASEOK is ignored on Windows
type: behavior
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



[issue26980] The path argument of asyncio.BaseEventLoop.create_unix_connection is not documented

2016-05-21 Thread Ned Deily

Changes by Ned Deily :


--
components: +asyncio
nosy: +gvanrossum, haypo, yselivanov
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