[issue2943] Distutils should generate a better error message when the SDK is not installed

2016-03-30 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue26673] Tkinter error when opening IDLE configuration menu

2016-03-30 Thread SilentGhost

Changes by SilentGhost :


--
components: +Tkinter
nosy: +gpolo, kbk, roger.serwy, serhiy.storchaka, terry.reedy

___
Python tracker 

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



[issue26488] hashlib command line interface

2016-03-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I concur.  The blocksize should be fixed and large (perhaps 256kB).

--

___
Python tracker 

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



[issue26653] bisect raises a TypeError when hi is None

2016-03-30 Thread Mike Lenzen

Mike Lenzen added the comment:

Sounds good, but then I think the docs could be clearer about this. I scratched 
my head at the function signature bisect.bisect_left(a, x, lo=0, hi=len(a)) 
because it isn't valid (in Python, maybe in C?), so I checked the source and 
saw hi=None. I'm not sure how to concisely describe it though. Listing two 
signatures doesn't seem ideal.

--

___
Python tracker 

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



[issue26675] Appending to a large list flushes old entries

2016-03-30 Thread Swaprava Nath

Swaprava Nath added the comment:

I realised that this is a normal behavior, I just had two for loops, nested, 
and every time the inner for loop runs, the list flushes. No worries, sorry!

--
resolution:  -> not a bug

___
Python tracker 

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



[issue26675] Appending to a large list flushes old entries

2016-03-30 Thread Swaprava Nath

Changes by Swaprava Nath :


--
status: open -> closed

___
Python tracker 

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



[issue26675] Appending to a large list flushes old entries

2016-03-30 Thread Swaprava Nath

Changes by Swaprava Nath :


Removed file: http://bugs.python.org/file42330/knapsack.py

___
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-03-30 Thread Demur Rumed

Demur Rumed added the comment:

Added back HAVE_ARGUMENT & HAS_ARG. As a result printing has removed arguments

Removed some code which was labelled unrelated

This does _not_ include having f_lasti be -1 instead of -2

--
Added file: http://bugs.python.org/file42331/wpy2.patch

___
Python tracker 

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



[issue26675] Appending to a large list flushes old entries

2016-03-30 Thread Swaprava Nath

New submission from Swaprava Nath:

I'm storing several variables in a list after a computation in a for loop. I'm 
bundling the variables in a tuple and appending this tuple to a list. So, the 
structure should be:

iter 1: list = [tuple1]
iter 2: list = [tuple1, tuple2]
iter 3: list = [tuple1, tuple2, tuple3] etc.

and the tuple has dissimilar objects. Surprisingly, I see that the list grows 
until a point and then suddenly all old entries are flushed out and new tuple_n 
is the only entry

iter n: list = [tuple_n]

Is this a bug? Or is there a cap on the size of the list?

--
files: knapsack.py
messages: 262683
nosy: Swaprava Nath
priority: normal
severity: normal
status: open
title: Appending to a large list flushes old entries
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file42330/knapsack.py

___
Python tracker 

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



[issue26674] 【typo】 Japanese Documentation

2016-03-30 Thread Ezio Melotti

Ezio Melotti added the comment:

The Japanese translation is not officially maintained by us -- you should 
report this to the translators.

They should also update the page at http://docs.python.jp/3/bugs.html since it 
points to this bug tracker (I assume this is how you got here).  Thanks anyway 
for reporting the typo!

--
nosy: +ezio.melotti
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue26674] 【typo】 Japanese Documentation

2016-03-30 Thread Eitaro Kuwabara

New submission from Eitaro Kuwabara:

I found a tiny typo in Japanese Documentation(Python3.5.1)

http://docs.python.jp/3/library/pathlib.html#general-properties

あなたが今までこのモジュールを使用したことがないか、あなたの作業にどのクラスを使うのが正しいのか自身がないのであれば、Path 
はもっともあなたに必要なものです。Path はコードが実行されているプラットフォーム用の 具象パス のインスタンスを作成します。
「自身」→「自信」

--
messages: 262681
nosy: Eitaro Kuwabara
priority: normal
severity: normal
status: open
title: 【typo】 Japanese Documentation
versions: Python 3.5

___
Python tracker 

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



[issue26658] test_os fails when run on Windows ramdisk

2016-03-30 Thread Jeremy Kloth

Jeremy Kloth added the comment:

I'm fine with the tests for CreateFunction failing for an ImDisk virtual drive, 
however something needs to be changed with the test to not remove the test 
directory on tearDown().

Changing it to use a temporary directory to link against is a workaround, but 
still leaves remnants once finished.  My solution of using lexists() in 
tearDown() however, ensures that any created items are cleaned up regardless of 
the test result.

--

___
Python tracker 

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



[issue2943] Distutils should generate a better error message when the SDK is not installed

2016-03-30 Thread Karl Stahl

Changes by Karl Stahl :


--
nosy: +Karl Stahl

___
Python tracker 

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



[issue26351] Occasionally check for Ctrl-C in long-running operations like sum

2016-03-30 Thread wim glenn

Changes by wim glenn :


--
nosy: +wim.glenn

___
Python tracker 

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



[issue26623] JSON encode: more informative error

2016-03-30 Thread Mahmoud Lababidi

Mahmoud Lababidi added the comment:

Is there a use case where the representation is too long? I think it may be 
useful to see the representation, but perhaps you are correct.

--

___
Python tracker 

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



[issue18844] allow weights in random.choice

2016-03-30 Thread Steven Basart

Steven Basart added the comment:

Hey serhiy.storchaka

I can edit the code to output just one value if called with simply a list and 
then return a list of values if called with the optional amount parameter.  My 
code also needs to check that amount >= 1.  

My code was mostly just to restart this discussion as I personally like the 
idea of the function for weighted choice and would like it to be standard in 
the random library. 

I have no qualms with adding both weighted_choice and weighted_choice_generator 
but my concern is mostly that you are asking too much and it won't go through 
by trying to add two functions at the same time.  The other thing is that I 
believe that weighted_choice could suffice with just one function call.

I just think my last concern is that generators are different from the other 
functions in random.py.  Whereas they are more intuitive and accepted in the 
builtins like map and zip etc.  There isn't any other functions in the random 
library that return that type of object when called. They instead return a 
numerical result.  

Those are my concerns and hence why I rewrote the code.

--

___
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-03-30 Thread Brett Cannon

Brett Cannon added the comment:

Thanks to Demur and Raymond for running the benchmarks. All of these numbers 
look good and with Raymond saying the code looks cleaner and everyone so far -- 
including me -- liking the overall idea this definitely seems worth continuing 
to work on. Thanks for starting this, Demur, and I hope you feel up for 
continuing to work on making this work!

--

___
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-03-30 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +josh.r

___
Python tracker 

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



[issue26494] Double deallocation on iterator exhausting

2016-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 905b5944119c by Serhiy Storchaka in branch '3.5':
Issue #26494: Fixed crash on iterating exhausting iterators.
https://hg.python.org/cpython/rev/905b5944119c

New changeset 73ce47d4a7b2 by Serhiy Storchaka in branch 'default':
Issue #26494: Fixed crash on iterating exhausting iterators.
https://hg.python.org/cpython/rev/73ce47d4a7b2

New changeset cff06d875678 by Serhiy Storchaka in branch '2.7':
Issue #26494: Fixed crash on iterating exhausting iterators.
https://hg.python.org/cpython/rev/cff06d875678

--
nosy: +python-dev

___
Python tracker 

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



[issue26624] Windows hangs in call to CRT setlocale()

2016-03-30 Thread Steve Dower

Steve Dower added the comment:

Ergh... that's awkward (but it explains why some of my own machines are missing 
bits).

Victor, I'll get back to you about the watchdog once I'm at an actual PC. This 
week I'm at a conference.

--

___
Python tracker 

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



[issue26658] test_os fails when run on Windows ramdisk

2016-03-30 Thread Eryk Sun

Eryk Sun added the comment:

I see now. It's not a problem with the junction. In the stat implementation, 
after verifying that the directory or file is a reparse point, it opens it 
again without FILE_FLAG_OPEN_REPARSE_POINT, in order to open the target instead 
of the link. I don't understand why it doesn't use this handle to call 
GetFileInformationByHandle again, this time on the target. Instead it calls 
get_target_path in order to recursively call stat on the target path. 

To get the target path it calls GetFinalPathNameByHandle and requests the DOS 
name, which requires a drive letter. At this point Windows has a native NT path 
(e.g. \Device\ImDisk0\python-default\PCBuild), so it has to query the 
mountpoint manager to get the DOS drive letter mapping (i.e. \Device\ImDisk0 => 
P:). This is done by opening a handle for \\.\MountPointManager and calling 
DeviceIoControl to query the drive letter. This is the call that fails with 
ERROR_INVALID_FUNCTION (1). Indeed, you'll get the same error if you try 
calling os.path._getfinalpathname on any directory or file on this drive.

It's probably the case that the ImDisk driver doesn't support the mountpoint 
manager at all. For example, in the \Global?? object directory there's no GUID 
symbolic link assigned to the device, which is normally assigned by the 
mountpoint manager. Also, mountvol.exe doesn't list the ImDisk drive.

--

___
Python tracker 

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



[issue26624] Windows hangs in call to CRT setlocale()

2016-03-30 Thread Jeremy Kloth

Jeremy Kloth added the comment:

After attempting to find the installer for ucrtbased.dll on my dev machine and 
reading various blog posts on the Visual C++ Team Blog and hunting through 
several KB articles, I've come across what I think is needed for an up-to-date 
Universal CRT.

When installing (or in this case modifying) VS2015, the Windows 10 SDK *MUST* 
also be installed.  It is unhelpfully located in the setup menu under "Windows 
and Web Development" (good) -> "Universal Windows App Development Tools" (not 
so good) -> "Tools (1.2) and Windows 10 SDK (10.0.10586)".  As Python is not an 
UWP app, I thought nothing of this submenu when installing VS2015 initially.

With the SDK installed, my ucrtbased.dll is at version 10.0.10586.15.  Now we 
wait and see if the deadlocking still happens.

--

___
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-03-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Report on Darwin Raymonds-2013-MacBook-Pro.local 15.4.0 Darwin Kernel Version 
15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 
x86_64 i386
Total CPU cores: 8

### 2to3 ###
Min: 4.680941 -> 4.437426: 1.05x faster
Avg: 4.703692 -> 4.498773: 1.05x faster
Significant (t=9.57)
Stddev: 0.02670 -> 0.03972: 1.4874x larger

### chameleon_v2 ###
Min: 3.391806 -> 3.300793: 1.03x faster
Avg: 3.447192 -> 3.340437: 1.03x faster
Significant (t=28.26)
Stddev: 0.03141 -> 0.02098: 1.4972x smaller

### django_v3 ###
Min: 0.339693 -> 0.328680: 1.03x faster
Avg: 0.347655 -> 0.335704: 1.04x faster
Significant (t=16.97)
Stddev: 0.00477 -> 0.00518: 1.0871x larger

### nbody ###
Min: 0.159703 -> 0.148231: 1.08x faster
Avg: 0.164307 -> 0.152380: 1.08x faster
Significant (t=34.06)
Stddev: 0.00260 -> 0.00234: 1.1123x smaller

The following not significant results are hidden, use -v to show them:
fastpickle, fastunpickle, json_dump_v2, json_load, regex_v8, tornado_http.

--

___
Python tracker 

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



[issue26673] Tkinter error when opening IDLE configuration menu

2016-03-30 Thread wysaard

New submission from wysaard:

I'm using Python 3.5.1 on Arch Linux. I've restalled the python package which 
provides IDLE, and the tkinter package which is used by IDLE, but to no effect.

My problem is this: When in the menu at the top in IDLE, I click on Options -> 
Configure IDLE, the menu will stop responding, and nothing happens after that.

Doing this when I run IDLE in a terminal provides the following error on 
clicking `Configure IDLE`:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1549, in __call__
return self.func(*args)
  File "/usr/lib/python3.5/idlelib/EditorWindow.py", line 516, in config_dialog
configDialog.ConfigDialog(self.top,'Settings')
  File "/usr/lib/python3.5/idlelib/configDialog.py", line 74, in __init__
self.LoadConfigs()
  File "/usr/lib/python3.5/idlelib/configDialog.py", line 1086, in LoadConfigs
self.LoadFontCfg()
  File "/usr/lib/python3.5/idlelib/configDialog.py", line 988, in LoadFontCfg
self.SetFontSample()
  File "/usr/lib/python3.5/idlelib/configDialog.py", line 866, in SetFontSample
self.labelFontSample.config(font=newFont)
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1330, in configure
return self._configure('configure', cnf, kw)
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1321, in _configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: expected integer but got ""

I have no idea what to do here.

--
components: IDLE
messages: 262670
nosy: wysaard
priority: normal
severity: normal
status: open
title: Tkinter error when opening IDLE configuration menu
type: crash
versions: Python 3.5

___
Python tracker 

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



[issue26624] Windows hangs in call to CRT setlocale()

2016-03-30 Thread Steve Dower

Steve Dower added the comment:

So you've still got the old ucrtbased.dll on the buildbot, which is why we're 
still seeing the issue. Because it's a different OS I'm not surprised to see a 
difference between ucrtbase.dll instances.

There should be an installer for the debug runtime somewhere inside your VS 
install directory (under vc/redist). If you take the one from your dev machine 
and run it on the buildbot we should be good.

--

___
Python tracker 

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



[issue26655] pathlib glob case sensitivity issue on Windows

2016-03-30 Thread Udo Eberhardt

Udo Eberhardt added the comment:

Meanwhile I realized this problem as well. There is no easy solution to 
determine exact spelling of the entire path. So it seems there is no simple 
solution to my problem. The concept of treating file system paths 
case-insensitive (as Windows does) seems to be a bad idea.

--

___
Python tracker 

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



[issue26658] test_os fails when run on Windows ramdisk

2016-03-30 Thread Jeremy Kloth

Jeremy Kloth added the comment:

To reproduce:

P:\python-default>PCBuild\amd64\python_d.exe
Python 3.6.0a0 (default:708beeb65026, Mar 30 2016, 08:50:27) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, _winapi
>>> _winapi.CreateJunction('PCbuild', 'junctest')
>>> assert os.listdir('PCbuild') == os.listdir('junctest')
>>> os.path.exists('junctest')
False
>>> os.path.lexists('junctest')
True
>>> os.stat('junctest')
Traceback (most recent call last):
  File "", line 1, in 
OSError: [WinError 1] Incorrect function: 'junctest'
>>> os.lstat('junctest')
os.stat_result(st_mode=16895, st_ino=1688849860290629, st_dev=719101600, 
st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1459349589, 
st_mtime=1459349589, st_ctime=1459349589)

--

___
Python tracker 

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



[issue26488] hashlib command line interface

2016-03-30 Thread Christian Heimes

Christian Heimes added the comment:

I see a potential performance issue here. The block size is a small value, 
usually a couple of kb. With such a small value, the runtime will be dominated 
by Python call overhead and syscalls.

--

___
Python tracker 

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



[issue26624] Windows hangs in call to CRT setlocale()

2016-03-30 Thread Jeremy Kloth

Jeremy Kloth added the comment:

I would have responded sooner, but add me to the list of those not receiving 
tracker notifications...

My buildbot is running Windows 7 with all updates (last checked 3/29) and 
VS2015 Update 1.

ucrtbase:  10.0.10586.9 (11/19/2015)
ucrtbased: 10.0.10240.16384 (07/09/2015)
vcruntime140d: 14.00.23506.0(11/05/2015)

Interestingly enough, my Win10 development machine has:
ucrtbase:  10.0.14295.1000  (03/19/2016)
ucrtbased: 10.0.10586.15(11/20/2015)
vcruntime140d: 14.0.23506.0 (11/05/2015)

--

___
Python tracker 

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



[issue26655] pathlib glob case sensitivity issue on Windows

2016-03-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For now glob(r'c:\very\long\case\insensitive\path\*.txt') have to iterate names 
only in one directory. For restoring actual path case it have to iterate all 
parent directories: r'c:\very\long\case\insensitive\path', 
r'c:\very\long\case\insensitive', r'c:\very\long\case', r'c:\very\long', 
r'c:\very', and 'c:\\'.

--

___
Python tracker 

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



[issue26488] hashlib command line interface

2016-03-30 Thread Aviv Palivoda

Aviv Palivoda added the comment:

Sorry on the late response for some reason i don't receive email notification 
from the tracker for the past few days.

1) Thanks for the review SilentGhost the patch attached include your CR 
suggestions.

2) Raymond I have fixed the problem with ctrl+D. I tried writing a test to 
simulate this problem but i don't seem to be able to simulated the terminal 
behavior on ctrl+D.

3) Removed the block_size option as suggested by Raymond and Victor and using 
os.stat().st_blksize as suggested by Victor.

4) I changed the CLI to support all available algorithms in hashlib. I am not 
sure if this is too many choices to show in the --help message.

5) About removing the use of argparse.FileType i would prefer resolving issue 
14156 but if you think this is problematic i will do the change.

6) What do you think about changing the API to be more like md5sum?
a) Allowing * in the file name to calcualte on multiple files.
b) Adding the check option.
c) printing file name in output.

--
Added file: http://bugs.python.org/file42329/hashlib-script-mod-2.patch

___
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-03-30 Thread Demur Rumed

Demur Rumed added the comment:

While it's good to know benchmarking in core Python goes beyond the 
microbenchmarks included in the distribution, I'm having some trouble with 
hg.python.org/benchmarks due to my system only having 256MB of ram

I've attached results for 2 benchmarks: 2to3 & regex

--
Added file: http://bugs.python.org/file42328/2to3re.txt

___
Python tracker 

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



[issue26672] regrtest missing in the module name

2016-03-30 Thread Axel Luttgens

New submission from Axel Luttgens:

Relevant page:

https://docs.python.org/2/library/test.html

One may read (section 25.5.2):

Specifying all as the value for the -u option enables all
possible resources: python -m test -uall.

I guess this should be:

Specifying all as the value for the -u option enables all
possible resources: python -m test.regrtest -uall.

HTH,
Axel

--
assignee: docs@python
components: Documentation
messages: 262661
nosy: Axel, docs@python
priority: normal
severity: normal
status: open
title: regrtest missing in the module name
type: enhancement
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



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

2016-03-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, I'm seeing about a 7% improvement to pystone.

--

___
Python tracker 

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



[issue26670] Add a developer mode: -X dev command line option

2016-03-30 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Why does this patch execv() the interpreter to set options? I'd expect it to be 
possible to get the same result by updating the argument parsing code in 
Py_Main.

--
nosy: +ronaldoussoren

___
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-03-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Demur, I think you're on the right track here.  It will nice to be rid of the 
HAVE_ARGUMENT tests and to not have to decode the arguments one-byte at a time. 
 Overall, the patch looks good (although it includes several small unrelated 
changes).  Besides the speed benefit, the code looks cleaner than before.

I was surprised to see that the peephole optimizer grew larger, but the 
handling of extended arguments is likely worth it even though it adds several 
new wordy chunks of code.

When it comes to benchmarks, expect a certain amount of noise (especially from 
those that use I/O or that exercise the C-API more than the pure python 
bytecode).

--
nosy: +rhettinger

___
Python tracker 

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



[issue26027] Support Path objects in the posix module

2016-03-30 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Clean up path_converter in posixmodule.c

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-03-30 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

path_converter in Modules/posixmodule.c sequentially tries to convert an 
argument to str, bytes, and int. If previous conversion is failed, it clears 
the error and tries with type. This can hide some errors (such as MemoryError) 
and even cause using unexpected conversion.

Proposed patch cleans up path_converter. In addition it avoids copying the 
content of instances of string subclass.

--
assignee: serhiy.storchaka
components: Extension Modules
files: path_converter_cleanup.patch
keywords: patch
messages: 262657
nosy: larry, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Clean up path_converter in posixmodule.c
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42327/path_converter_cleanup.patch

___
Python tracker 

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



[issue18844] allow weights in random.choice

2016-03-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I disagree.

My patch adds two functions because they serve two different purposes. 
weighted_choice() returns one random value as other functions in the random 
module. weighted_choice_generator() provides more efficient way to generate 
random values, since startup cost is more significant than for other random 
value generators. Generators are widely used in Python, especially in Python 3. 
If they considered confusing, we should deprecate builtins map(), filter(), 
zip() and the itertools module at first place.

Your function, Steven, returns a list containing one random value by default. 
It does not match the interface of other functions in the random module. It 
matches the interface of NumPy random module. In Python you need two separate 
functions, one that returns single value,  and other that returns a list of 
values. But returning iterator and generating values by demand is more 
preferable in Python 3. Generatorsa are more flexible. With 
weighted_choice_generator() it is easy to get the result of your function: 
list(islice(weighted_choice_generator(data), amount)). But generating dynamic 
amount of values with your interface is impossible.

Raymond, if you have now free time, could you please make a review of 
weighted_choice_generator_2.patch?

--
keywords: +needs review
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue26670] Add a developer mode: -X dev command line option

2016-03-30 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch implements the idea proposed on the python-ideas mailing list:
https://mail.python.org/pipermail/python-ideas/2016-March/039314.html

The patch is a proof-of-concept. The code still contains FIXME.

--
files: dev_mode.patch
keywords: patch
messages: 262655
nosy: haypo
priority: normal
severity: normal
status: open
title: Add a developer mode: -X dev command line option
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42326/dev_mode.patch

___
Python tracker 

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



[issue26509] spurious ConnectionAbortedError logged on Windows

2016-03-30 Thread Sebastien Bourdeauducq

Sebastien Bourdeauducq added the comment:

Can someone please commit the patch?

--

___
Python tracker 

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



[issue26653] bisect raises a TypeError when hi is None

2016-03-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue26669] time.localtime(float("NaN")) does not raise a ValueError on all platforms

2016-03-30 Thread Gregory P. Smith

New submission from Gregory P. Smith:

time.localtime(float("NaN")) raises a ValueError on x86_64 using the few 
compilers I have tested it with. (this makes sense)

>>> time.localtime(float("NaN"))
Traceback (most recent call last):
  File "", line 1, in 
ValueError: (75, 'Value too large for defined data type')

On an arm and arm64 system, it does not and treats NaN as 0. (nonsense!)

>>> time.localtime(float("NaN"))
time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, 
tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0)

The root of this problem appears to be the (potentially questionable? I'll ask 
a C compiler person...) code in Python/pytime.c's (3.x) Modules/timemodule.c's 
(2.7) double to time_t conversion function.

I'm not sure what it does is supposed to be well defined behavior with NaN...

The easy fix is to add:

#include 

and

add || isnan(x) || isinf(x) to the check that raises a ValueError in

https://hg.python.org/cpython/file/4c903ceeb4d1/Python/pytime.c#l149 (3.x)
https://hg.python.org/cpython/file/2.7/Modules/timemodule.c#l102 (2.7)

Along with a relevant assertRaises(ValueError) unittest for NaN, inf and -inf 
in test_time.py.

--
components: Extension Modules, Interpreter Core
messages: 262653
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: time.localtime(float("NaN")) does not raise a ValueError on all platforms
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue18844] allow weights in random.choice

2016-03-30 Thread Steven Basart

Steven Basart added the comment:

Hello rhettinger.  I filled out the form thanks for letting me know about it.  
Is there anything else I have to do?

Hey serhiy.storchaka

There were several things "wrong" with the previous implementation in my 
opinion. 

1st they tried to add too much.  Which would if allowed would clutter up the 
random library if every function had both it's implementation as well as an 
accompanied generator.  The other problem being that both were attempted to be 
made as callable to the public API.  I would prefer the generator if present to 
be hidden and would also have to be more sophisticated to be able to check if 
it was being called with new input.

2nd by adding in the generator to the pulbic API of the random library it makes 
it far more confusing and obfuscates the true purpose of this function anyways 
which is to get a weighted choice.  

So basically there is nothing wrong with generators but they don't necessarily 
belong here so I removed it to try to get back to the core principles of what 
the function should be doing, by making it simpler.

--

___
Python tracker 

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



[issue26295] Random failures when running test suite in parallel (-m test -j0) caused by test_regrtest

2016-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e47e00723e5d by Victor Stinner in branch 'default':
Issue #26295: Enhanc test_regrtest.test_tools_script_run_tests()
https://hg.python.org/cpython/rev/e47e00723e5d

--

___
Python tracker 

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



[issue26295] Random failures when running test suite in parallel (-m test -j0) caused by test_regrtest

2016-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e29f12ed by Victor Stinner in branch 'default':
Issue #26295: Fix test_regrtest.test_tools_buildbot_test()
https://hg.python.org/cpython/rev/e29f12ed

--

___
Python tracker 

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