[issue25406] OrderedDict.move_to_end may cause crash in python 3.5

2015-10-14 Thread Eric Snow

Changes by Eric Snow :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue25406] OrderedDict.move_to_end may cause crash in python 3.5

2015-10-14 Thread Eric Snow

Eric Snow added the comment:

@Serhiy, patch LGTM.  Thanks for taking care of it.

--
stage: patch review -> commit review

___
Python tracker 

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



[issue25406] OrderedDict.move_to_end may cause crash in python 3.5

2015-10-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +eric.snow

___
Python tracker 

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



[issue25406] OrderedDict.move_to_end may cause crash in python 3.5

2015-10-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch that fixes the issue.

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



[issue25406] OrderedDict.move_to_end may cause crash in python 3.5

2015-10-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +patch
Added file: http://bugs.python.org/file40783/move_to_end_issue25406.patch

___
Python tracker 

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



[issue23857] Make default HTTPS certificate verification setting configurable

2015-10-14 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Oct 14, 2015, at 03:20 PM, Nick Coghlan wrote:

>The rationale behind "platform_default" relates to what we put in the default
>config file in the RPM. If enable/disable are the only options, then as soon
>as the first version ships with "disable" as the default, affected systems
>will *never* switch to being enabled by default unless the system
>administrator changes it.
>
>By contrast, if we put "platform_default" in the default configuration, then
>inattentive sysadmins could theoretically eventually have their defaults
>switched to "enable" at some point.
>
>We don't know yet if we'd ever upgrade the "platform_default" setting, but I
>think it's worthwhile to retain the option.

We've consulted with the Ubuntu security team and have decided not to enable
it for Ubuntu 14.04 LTS.  For upgrades from there to newer releases, we won't
include the patch and will just enable it by default.  So for us,
platform_default doesn't make sense.

--

___
Python tracker 

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



[issue25407] Update PEP 4 to keep modules in Python 3

2015-10-14 Thread Brett Cannon

New submission from Brett Cannon:

In https://mail.python.org/pipermail/python-dev/2015-September/141499.html I 
asked if people thought it was okay to deprecate modules in Python 3 but to 
keep them around until Python 4. People agreed and so now I need to actually 
execute on that plan by updating PEP 4 and the various deprecation messages in 
the stdlib.

--
assignee: brett.cannon
components: Documentation
messages: 253001
nosy: brett.cannon
priority: normal
severity: normal
status: open
title: Update PEP 4 to keep modules in Python 3

___
Python tracker 

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



[issue25406] OrderedDict.move_to_end may cause crash in python 3.5

2015-10-14 Thread Snivy Pang

Changes by Snivy Pang :


--
nosy: +Snivy Pang

___
Python tracker 

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



[issue23857] Make default HTTPS certificate verification setting configurable

2015-10-14 Thread Nick Coghlan

Nick Coghlan added the comment:

The rationale behind "platform_default" relates to what we put in the default 
config file in the RPM. If enable/disable are the only options, then as soon as 
the first version ships with "disable" as the default, affected systems will 
*never* switch to being enabled by default unless the system administrator 
changes it.

By contrast, if we put "platform_default" in the default configuration, then 
inattentive sysadmins could theoretically eventually have their defaults 
switched to "enable" at some point.

We don't know yet if we'd ever upgrade the "platform_default" setting, but I 
think it's worthwhile to retain the option.

--

___
Python tracker 

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



[issue25405] User install of 3.5 removes py.exe from C:\Windows

2015-10-14 Thread Steve Dower

Steve Dower added the comment:

Part of this will be the upgrade from RC, which will behave differently from 
the next upgrade to 3.5.1. But I have just made some fixes in how upgrading the 
launcher is handled, so there's a chance this is already fixed. But I'll test 
this scenario too.

Do you remember whether the launcher was originally installed for all users? At 
some point I made that the default to better deal with people who have 2.7/3.4 
installed (that version of the launcher won't detect 3.5-32).

--

___
Python tracker 

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



[issue25406] OrderedDict.move_to_end may cause crash in python 3.5

2015-10-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +rhettinger, serhiy.storchaka
priority: normal -> critical
stage:  -> needs patch
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



[issue25395] SIGSEGV using json.tool

2015-10-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Likely this issue is related to C implementation of OrderedDict. json.tool 
doesn't crash with --sort-keys and doesn't crash with Python implementation of 
OrderedDict.

The patch for similar issue25406 doesn't fix this issue.

--
nosy: +eric.snow, rhettinger
priority: high -> critical

___
Python tracker 

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



[issue25099] test_compileall fails when run by unprivileged user on installed Python

2015-10-14 Thread Brett Cannon

Changes by Brett Cannon :


--
status: open -> closed

___
Python tracker 

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



[issue21165] Optimize str.translate() for replacement with substrings and non-ASCII strings

2015-10-14 Thread STINNER Victor

STINNER Victor added the comment:

This issue was more a reminder for myself, and I'm not more interested to 
implement this optimization. The method is already fast enough.

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

___
Python tracker 

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



[issue25406] OrderedDict.move_to_end may cause crash in python 3.5

2015-10-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 88e6641c3dd3 by Serhiy Storchaka in branch '3.5':
Issue #25406: Fixed a bug in C implementation of OrderedDict.move_to_end()
https://hg.python.org/cpython/rev/88e6641c3dd3

New changeset 33d53a41daeb by Serhiy Storchaka in branch 'default':
Issue #25406: Fixed a bug in C implementation of OrderedDict.move_to_end()
https://hg.python.org/cpython/rev/33d53a41daeb

--
nosy: +python-dev

___
Python tracker 

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



[issue25339] sys.stdout.errors is set to "surrogateescape"

2015-10-14 Thread STINNER Victor

STINNER Victor added the comment:

Sorry, I don't understand the issue. Do you consider that using surrogateescape 
is a bug?

Which behaviour do you expect?

Python 3.5 now uses surrogateescape by default for stdout and stderr when the 
locale is POSIX. I guess that you got the POSIX locale using "LANG=".

--

___
Python tracker 

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



[issue25164] Windows default installation path is inconsistent between per-user and system-wide installation

2015-10-14 Thread Steve Dower

Steve Dower added the comment:

I don't think it will be a significant breaking change at this stage to update 
the default all-user install directory, since everyone *should* be resolving it 
through the registry keys or overriding it on installation. Upgrading from 
3.5.0 will not change to the new directory, so it only affects new installs.

The change is that the directory is named "Python35" or "Python35-32" under 
either %ProgramFiles% or %LocalAppData%\Programs\Python. (This is not a change 
in the latter case.)

--

___
Python tracker 

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



[issue8952] Doc/c-api/arg.rst: fix documentation of number formats

2015-10-14 Thread STINNER Victor

STINNER Victor added the comment:

This issue is now 5 years old and it doesn't contain much information. It's 
more a TODO item, and I'm not more interested to work on it. So I close the 
issue. If you want to work on the doc, please write a patch ;-)

--
nosy: +haypo
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue25164] Windows default installation path is inconsistent between per-user and system-wide installation

2015-10-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset be92f6ce1e80 by Steve Dower in branch '3.5':
Issue #25164: Changes default all-users install directory to match per-user 
directory.
https://hg.python.org/cpython/rev/be92f6ce1e80

--
nosy: +python-dev

___
Python tracker 

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



[issue25400] robotparser doesn't return crawl delay for default entry

2015-10-14 Thread Peter Wirtz

Peter Wirtz added the comment:

On further inspection of the tests, it appears that the way in which the tests 
are written, a test case can only be tested for one useragent at a time. I will 
attempt to work on the tests so work correctly. Any advice would be much 
appreciated.

--

___
Python tracker 

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



[issue25339] sys.stdout.errors is set to "surrogateescape"

2015-10-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm not sure this is a bug, but it looks at least unexpected, that 
surrogateescape is used with non-ASCII encoding. For example my last test for 
issue19058 fails on POSIX locale in 3.5+, and it is not so easy to make it 
working.

May be change error handler to surrogateescape only if PYTHONIOENCODING is not 
specified?

--

___
Python tracker 

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



[issue23857] Make default HTTPS certificate verification setting configurable

2015-10-14 Thread Nick Coghlan

Nick Coghlan added the comment:

Yeah, it's the extra 5 years on RHEL 7 that makes me wary. For anything with a 
shorter life cycle, letting the legacy setting age out likely makes more sense.

--

___
Python tracker 

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



[issue25210] Special-case NoneType() in do_richcompare()

2015-10-14 Thread STINNER Victor

STINNER Victor added the comment:

> It looks like some of the example sessions in the documentation will become 
> out of date. Not sure if that is a problem.

Ah yes, I updated them. Thanks for the review.

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

___
Python tracker 

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



[issue25210] Special-case NoneType() in do_richcompare()

2015-10-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0238eafb68da by Victor Stinner in branch 'default':
Issue #25210: Change error message of do_richcompare()
https://hg.python.org/cpython/rev/0238eafb68da

--
nosy: +python-dev

___
Python tracker 

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



[issue25406] OrderedDict.move_to_end may cause crash in python 3.5

2015-10-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Eric.

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

___
Python tracker 

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



[issue25400] robotparser doesn't return crawl delay for default entry

2015-10-14 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch Peter(and welcome to Python and open source development). 
I have a WIP patch to rewrite test_robotparser in a less magic way. So we can 
ignore test failures for now. I'll take a closer look to your patch.

--
stage:  -> patch review

___
Python tracker 

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



[issue25372] load_module() does not link submodule to parent package

2015-10-14 Thread Martin Panter

Martin Panter added the comment:

My use case is for Readline auto-completion, to list submodules of a package 
given by the user, without importing anything unnecessary. The original code is 
compatible with Python 2, but I am also writing a patch for 3.6 that wouldn't 
need that. The original implementation is like this pseudocode:

def list_submodules(package):
# Ensure it is a package before loading or importing it
for name in parent_packages:
loader = pkgutil.find_loader(name)
assert loader.is_package()
# Could call importlib.import_module(), but this seemed easier because I 
already have the loader:
package = loader.load_module(name)
# The only reason I want to load the module:
search_path = package.__path__
return pkgutil.iter_modules(search_path)

Thanks for your feedback Brett. I have changed over to 
importlib.import_module(), and will accept that this is just a quirk of the low 
level import stuff.

--

___
Python tracker 

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



[issue24782] Merge 'configure extensions' into main IDLE config dialog

2015-10-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

There is one issue.  The window is wider now, I suspect because of the 
extension frame, which is wider than it need to be, at least for now.  I will 
try adjusting it.

--

___
Python tracker 

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



[issue25399] Optimize bytearray % args

2015-10-14 Thread STINNER Victor

STINNER Victor added the comment:

Microbenchmark result below.

Most operations are now between 2.5 and 5 times faster. %f is as-fast, probably 
because formatting a float is more expensive than copying bytes (raw 
estimation: 150 ns to format a single floating pointer number).

Common platform:
Timer: time.perf_counter
CPU model: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
Bits: int=32, long=64, long long=64, size_t=64, void*=64
CFLAGS: -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g 
-fwrapv -O3 -Wall -Wstrict-prototypes
Platform: Linux-4.1.6-200.fc22.x86_64-x86_64-with-fedora-22-Twenty_Two
Timer info: namespace(adjustable=False, 
implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, 
resolution=1e-09)
Python unicode implementation: PEP 393

Platform of campaign orig:
Python version: 3.6.0a0 (default:af34d0626fb4, Oct 14 2015, 09:51:04) [GCC 
5.1.1 20150618 (Red Hat 5.1.1-4)]
Timer precision: 64 ns
Date: 2015-10-14 09:51:20
SCM: hg revision=af34d0626fb4 branch=default date="2015-10-14 09:47 +0200"

Platform of campaign no_copy:
Timer precision: 59 ns
Python version: 3.6.0a0 (default:2e9d9873d2be, Oct 14 2015, 09:49:28) [GCC 
5.1.1 20150618 (Red Hat 5.1.1-4)]
Date: 2015-10-14 09:49:44
SCM: hg revision=2e9d9873d2be tag=tip branch=default date="2015-10-14 09:41 
+0200"

-+-+--
use smaller buffer   |orig |   no_copy
-+-+--
fmt = bytearray(b"hello %s"); fmt % b"world" |  656 ns (*) |  93 ns (-86%)
fmt = bytearray(b"hello %-100s"); fmt % b"world" |  686 ns (*) | 105 ns (-85%)
fmt = bytearray(b"x=%d"); fmt % 123  |  689 ns (*) | 112 ns (-84%)
fmt = bytearray(b"x=%f"); fmt % 1.2  |  976 ns (*) | 216 ns (-78%)
fmt = bytearray(b"x=%100d"); fmt % 123   |  870 ns (*) | 172 ns (-80%)
-+-+--
Total| 3.88 us (*) | 698 ns (-82%)
-+-+--

+-+---
"hello %s" % long_string|orig | 
   no_copy
+-+---
fmt = bytearray(b"hello %s"); arg = b"x" * 10; fmt % arg|  661 ns (*) |   
93 ns (-86%)
fmt = bytearray(b"hello %s"); arg = b"x" * 100; fmt % arg   |  667 ns (*) |   
93 ns (-86%)
fmt = bytearray(b"hello %s"); arg = b"x" * 10**3; fmt % arg |  982 ns (*) |  
186 ns (-81%)
fmt = bytearray(b"hello %s"); arg = b"x" * 10**5; fmt % arg | 10.2 us (*) | 
4.42 us (-57%)
+-+---
Total   | 12.5 us (*) |  
4.8 us (-62%)
+-+---

--+-+---
b"xx %s" % b"y"   |orig |no_copy
--+-+---
fmt = bytearray(b"x" * 10 + b"%s"); fmt % b"y"|  653 ns (*) |   88 ns (-86%)
fmt = bytearray(b"x" * 100 + b"%s"); fmt % b"y"   |  674 ns (*) |   94 ns (-86%)
fmt = bytearray(b"x" * 10**3 + b"%s"); fmt % b"y" | 1.09 us (*) |  213 ns (-80%)
fmt = bytearray(b"x" * 10**5 + b"%s"); fmt % b"y" | 21.4 us (*) | 8.47 us (-60%)
--+-+---
Total | 23.8 us (*) | 8.87 us (-63%)
--+-+---

-+-+
%f   |
orig | no_copy
-+-+
n = 200; fmt = bytearray(b"%f" * n); arg = tuple([1.2]*n); fmt % arg | 32.2 us 
(*) | 32.3 us
-+-+

---+-+---
%i |
orig |no_copy
---+-+---
n = 1; fmt = bytearray(b"%d" * n); arg = tuple([12345]*n); fmt % arg   |  678 
ns (*) |  105 ns (-85%)
n = 5; fmt = bytearray(b"%d" * n); arg = tuple([12345]*n); fmt % arg   |  884 
ns (*) |  296 ns (-66%)
n = 10; fmt = bytearray(b"%d" * n); arg = tuple([12345]*n); fmt % arg  | 1.13 
us (*) |  531 ns (-53%)

[issue25400] robotparser doesn't return crawl delay for default entry

2015-10-14 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue25401] Optimize bytes.fromhex() and bytearray.fromhex()

2015-10-14 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch optimizes bytes.fromhex() and bytearray.fromhex():

* Fast-path working on a char* string for ASCII string
* Slow-path for non-ASCII string
* Replace slow hex_digit_to_int() function with a O(1) lookup in 
_PyLong_DigitValue precomputed table
* Use _PyBytesWriter API to handle the buffer
* Check the error position in error messages

--
files: fromhex.patch
keywords: patch
messages: 252979
nosy: haypo
priority: normal
severity: normal
status: open
title: Optimize bytes.fromhex() and bytearray.fromhex()
type: performance
versions: Python 3.6
Added file: http://bugs.python.org/file40779/fromhex.patch

___
Python tracker 

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



[issue25399] Optimize bytearray % args

2015-10-14 Thread STINNER Victor

Changes by STINNER Victor :


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

___
Python tracker 

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



[issue25401] Optimize bytes.fromhex() and bytearray.fromhex()

2015-10-14 Thread STINNER Victor

STINNER Victor added the comment:

It's between 2 and 3.5x faster.

It's 9% slower on short string (10 bytes for the output), but I consider that 
the speedup is more interesting than the slowdown on short strings.

RMicrobenchmark:

Common platform:
Platform: Linux-4.1.6-200.fc22.x86_64-x86_64-with-fedora-22-Twenty_Two
Timer: time.perf_counter
CFLAGS: -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g 
-fwrapv -O3 -Wall -Wstrict-prototypes
Python unicode implementation: PEP 393
Timer info: namespace(adjustable=False, 
implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, 
resolution=1e-09)
CPU model: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
Bits: int=32, long=64, long long=64, size_t=64, void*=64

Platform of campaign orig:
SCM: hg revision=90e41d965228 tag=tip branch=default date="2015-10-14 10:10 
+0200"
Python version: 3.6.0a0 (default:90e41d965228, Oct 14 2015, 10:46:50) [GCC 
5.1.1 20150618 (Red Hat 5.1.1-4)]
Date: 2015-10-14 10:47:05
Timer precision: 54 ns

Platform of campaign optim:
SCM: hg revision=90e41d965228+ tag=tip branch=default date="2015-10-14 10:10 
+0200"
Python version: 3.6.0a0 (default:90e41d965228+, Oct 14 2015, 11:07:24) [GCC 
5.1.1 20150618 (Red Hat 5.1.1-4)]
Date: 2015-10-14 11:09:53
Timer precision: 62 ns

-+-+---
without spaces   |orig |  optim
-+-+---
data = "AB" * 10; bytes.fromhex(data)|  167 ns (*) |   181 ns (+9%)
data = "AB" * 100; bytes.fromhex(data)   |  621 ns (*) |  295 ns (-52%)
data = "AB" * 10**3; bytes.fromhex(data) | 5.15 us (*) | 1.65 us (-68%)
data = "AB" * 10**5; bytes.fromhex(data) |  500 us (*) |  147 us (-71%)
-+-+---
Total|  506 us (*) |  149 us (-70%)
-+-+---

---+-+---
with 0.5 space |orig |  
optim
---+-+---
data = "ABAB " * (10 // 2); bytes.fromhex(data)|  179 ns (*) | 186 
ns
data = "ABAB " * (100 // 2); bytes.fromhex(data)   |  659 ns (*) |  340 ns 
(-48%)
data = "ABAB " * (10**3 // 2); bytes.fromhex(data) | 5.48 us (*) | 2.19 us 
(-60%)
data = "ABAB " * (10**5 // 2); bytes.fromhex(data) |  529 us (*) |  194 us 
(-63%)
---+-+---
Total  |  536 us (*) |  196 us 
(-63%)
---+-+---

--+-+---
with 1 space  |orig |  optim
--+-+---
data = "AB " * 10; bytes.fromhex(data)|  180 ns (*) |   191 ns (+6%)
data = "AB " * 100; bytes.fromhex(data)   |  710 ns (*) |  330 ns (-54%)
data = "AB " * 10**3; bytes.fromhex(data) | 5.77 us (*) | 1.99 us (-66%)
data = "AB " * 10**5; bytes.fromhex(data) |  559 us (*) |  177 us (-68%)
--+-+---
Total |  565 us (*) |  179 us (-68%)
--+-+---

---+-+--
Summary|orig | optim
---+-+--
without spaces |  506 us (*) | 149 us (-70%)
with 0.5 space |  536 us (*) | 196 us (-63%)
with 1 space   |  565 us (*) | 179 us (-68%)
---+-+--
Total  | 1.61 ms (*) | 525 us (-67%)
---+-+--

--
Added file: http://bugs.python.org/file40780/bench_fromhex.py

___
Python tracker 

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



[issue25401] Optimize bytes.fromhex() and bytearray.fromhex()

2015-10-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 55d207a637ff by Victor Stinner in branch 'default':
Optimize bytes.fromhex() and bytearray.fromhex()
https://hg.python.org/cpython/rev/55d207a637ff

--
nosy: +python-dev

___
Python tracker 

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



[issue25399] Optimize bytearray % args

2015-10-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 03646293f1b3 by Victor Stinner in branch 'default':
Fix long_format_binary()
https://hg.python.org/cpython/rev/03646293f1b3

New changeset 6fe0050a2f52 by Victor Stinner in branch 'default':
Add use_bytearray attribute to _PyBytesWriter
https://hg.python.org/cpython/rev/6fe0050a2f52

New changeset f369b79c0153 by Victor Stinner in branch 'default':
Optimize bytearray % args
https://hg.python.org/cpython/rev/f369b79c0153

--
nosy: +python-dev

___
Python tracker 

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



[issue25401] Optimize bytes.fromhex() and bytearray.fromhex()

2015-10-14 Thread STINNER Victor

Changes by STINNER Victor :


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

___
Python tracker 

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



[issue25339] sys.stdout.errors is set to "surrogateescape"

2015-10-14 Thread STINNER Victor

STINNER Victor added the comment:

"it looks at least unexpected, that surrogateescape is used with non-ASCII 
encoding"

What do you mean by non-ASCII encoding? surrogateescape is used by all 
encodings for all OS operations on Python 3, like os.listdir(), even for UTF-8.

--

___
Python tracker 

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



[issue25408] Consider dropping html5lib and spambayes from the default benchmark set

2015-10-14 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 

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



[issue25408] Consider dropping html5lib and spambayes from the default benchmark set

2015-10-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This all sounds good to me.

--

___
Python tracker 

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



[issue25023] time.strftime('%a'), ValueError: embedded null byte, in ko locale

2015-10-14 Thread Steve Dower

Steve Dower added the comment:

I can confirm that this is fixed in an upcoming Windows update:

Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale, time
>>> locale.setlocale(locale.LC_ALL, 'ko')
'ko'
>>> time.strftime('%a')
'\uc218'
>>>

--
resolution:  -> third party
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



[issue25370] Add support of pickling very large bytes and str objects with protocol < 4

2015-10-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Changed tests and fixed bugs.

Could anyone please test the patch with bigmem pickle tests? Tests need at 
least 32GB of memory, I have no such much memory.

--
Added file: http://bugs.python.org/file40781/pickle_large_strings_2.patch

___
Python tracker 

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



[issue25370] Add support of pickling very large bytes and str objects with protocol < 4

2015-10-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file40774/pickle_large_strings.patch

___
Python tracker 

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



[issue25338] urllib bypasses all hosts if proxyoverride includes an empty element

2015-10-14 Thread Jung-chih Wei

Jung-chih Wei added the comment:

I believe IE ignores the empty element because I must access the internet 
through proxy.
And please refer to 
http://mxr.mozilla.org/mozilla-central/source/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp#177,
 Firefox also ignores the empty element.

--

___
Python tracker 

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



[issue25403] urllib.parse.urljoin is broken in python 3.5

2015-10-14 Thread Pavel Ivanov

New submission from Pavel Ivanov:

urllib.parse.urljoin does not conform the RFC 1808 in case of joining relative 
URL’s containing ‘..’ path components anymore.

Examples:

Python 3.4: 
>>> urllib.parse.urljoin('http://a.com', '..')
'http://a.com/..'
Python 3.5:
>>> urllib.parse.urljoin('http://a.com', '..')
'http://a.com/'

Python 3.4: 
>>> urllib.parse.urljoin('a/’, '..')
''
Python 3.5:
>>> urllib.parse.urljoin('a/', '..')
'/'

Python 3.4: 
>>> urllib.parse.urljoin('a/’, '../..')
'..'
Python 3.5:
>>> urllib.parse.urljoin('a/', '../..')
'/'

Python 3.4 conforms RFC 1808 in these scenarios, but Python 3.5 does not.

--
components: Interpreter Core, Library (Lib)
messages: 252986
nosy: Pavel Ivanov
priority: normal
severity: normal
status: open
title: urllib.parse.urljoin is broken in python 3.5
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



[issue25404] ssl.SSLcontext.load_dh_params() does not handle unicode filenames properly

2015-10-14 Thread STINNER Victor

STINNER Victor added the comment:

Right. The workaround is to encode manually the filename:

filename = filename.encode(sys.getfilesystemencoding())

--

___
Python tracker 

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



[issue25404] ssl.SSLcontext.load_dh_params() does not handle unicode filenames properly

2015-10-14 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +Unicode, Windows
nosy: +ezio.melotti, haypo, paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue25402] Accurater estimation of the number of digits in int to decimal string conversion

2015-10-14 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Int to decimal string conversion (function long_to_decimal_string_internal() at 
Objects/longobject.c:1583) has a limitation. On 32-bit platform you can't 
convert integers larger than 2**2**31 (10**646456993). Proposed patch removes 
this limitation [*].

It also decreases memory requirements for intermediate buffer on 10%. The size 
of intermediate buffer (in digits) depends on the size of the integer. 
Unpatched:

For 15-bit digits: size*15/4/3 = size*1.25
For 30-bit digits: size*30/9/3 = size*1.11

Patched:
For 15-bit digits: size*15/4/3.3 = size*1.14
For 30-bit digits: size*30/9/3.3 = size*1.01


[*] Converting such large integers to decimal string can be not finished for 
reasonable time, because it has quadratic complexity. On my netbook the 
estimated time of calculating str(2**2**31) is 5 years. But this is different 
issue.

--
components: Interpreter Core
files: long_to_decimal_string_number_of_digits.patch
keywords: patch
messages: 252985
nosy: mark.dickinson, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Accurater estimation of the number of digits in int to decimal string 
conversion
type: behavior
versions: Python 3.6
Added file: 
http://bugs.python.org/file40782/long_to_decimal_string_number_of_digits.patch

___
Python tracker 

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



[issue25404] ssl.SSLcontext.load_dh_params() does not handle unicode filenames properly

2015-10-14 Thread Michael Schlenker

New submission from Michael Schlenker:

The load_dh_params() method of SSLContext does not properly handle unicode 
filenames on Windows (like load_verify_location() does).

It should convert any passed unicode path to the filesystem encoding.

This is already fixed in the 3.x head revision, by loading the file via python 
instead of the OpenSSL BIO functions, but is broken in 2.7.10.

Currently it silently works for most files due to an implicit conversion to 
string, but with the wrong default encoding instead of filesystem encoding.

--
components: Extension Modules
messages: 252987
nosy: schlenk
priority: normal
severity: normal
status: open
title: ssl.SSLcontext.load_dh_params() does not handle unicode filenames 
properly
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue25404] ssl.SSLcontext.load_dh_params() does not handle unicode filenames properly

2015-10-14 Thread Michael Schlenker

Michael Schlenker added the comment:

Yes, the workaround works.

Would be nice if this could be fixed in a 2.7.11...

--

___
Python tracker 

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



[issue25384] Use _PyBytesWriter in the binascii module

2015-10-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 32b17c3b3cf3 by Victor Stinner in branch 'default':
Issue #25384: Fix binascii.rledecode_hqx()
https://hg.python.org/cpython/rev/32b17c3b3cf3

--

___
Python tracker 

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



[issue23857] Make default HTTPS certificate verification setting configurable

2015-10-14 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Re: platform_default - I'm not sure that's a good idea.  It hides what's 
actually happening in some hard to discover place (the code).  Probably EIBTI 
and just go with 'enable' and 'disable'.

--

___
Python tracker 

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



[issue25401] Optimize bytes.fromhex() and bytearray.fromhex()

2015-10-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 09e0533f3694 by Victor Stinner in branch 'default':
Issue #25401: Remove now unused hex_digit_to_int() function
https://hg.python.org/cpython/rev/09e0533f3694

--

___
Python tracker 

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



[issue19058] test_sys.test_ioencoding_nonascii() fails with ASCII locale encoding

2015-10-14 Thread STINNER Victor

STINNER Victor added the comment:

> What could you say about the recent patch Victor?

I'm not sure that it works in all cases. io.TextIOWrapper doesn't care to 
normalize the encoding name. You should use something like:

   encoding = codecs.lookup(encoding).name

Otherwise, the test can fail if you care one of the various aliases of each 
encoding. Example: "UTF-8" vs "utf8" vs "utf-8".

--

___
Python tracker 

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



[issue25408] Consider dropping html5lib and spambayes from the default benchmark set

2015-10-14 Thread Brett Cannon

New submission from Brett Cannon:

The spambayes and html5lib benchmarks are not compatible with Python 3, so I 
think we should remove them from the default set (they can obviously stay in 
the benchmark suite).

And while I'm thinking about it, maybe pull etree since we already have the 
JSON tests in the default for serialization measurements?

--
components: Benchmarks
messages: 253014
nosy: brett.cannon, pitrou
priority: normal
severity: normal
status: open
title: Consider dropping html5lib and spambayes from the default benchmark set

___
Python tracker 

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



[issue25400] robotparser doesn't return crawl delay for default entry

2015-10-14 Thread Peter Wirtz

Peter Wirtz added the comment:

Ok, for the mean time, I reworked the test so it appears to test correctly and 
tests passes. There does seem to be some magic, so I do hope I did not overlook 
anything. Here is the new patch.

--
Added file: http://bugs.python.org/file40784/robotparser_crawl_delay_v2.patch

___
Python tracker 

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



[issue25406] OrderedDict.move_to_end may cause crash in python 3.5

2015-10-14 Thread Cruise Liu

New submission from Cruise Liu:

Following code will crash python. Tested on linux and windows.

Python 3.5.0 (default, Sep 20 2015, 11:28:25) 
[GCC 5.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import collections
>>> x = collections.OrderedDict([ ('a', 1), ('b', 2), ('c', 3) ])
>>> x.move_to_end('c', last = False)
>>> x.move_to_end('a', last = False)
>>> x
Segmentation fault (core dumped)

--
components: Library (Lib)
messages: 252991
nosy: Cruise Liu
priority: normal
severity: normal
status: open
title: OrderedDict.move_to_end may cause crash in python 3.5
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



[issue25372] load_module() does not link submodule to parent package

2015-10-14 Thread R. David Murray

R. David Murray added the comment:

Well, once you've loaded the module and added it to the namespace of the parent 
package, you've imported it.  Since import_module is available in 2.7, it 
sounds like that satisfies your use case.

--

___
Python tracker 

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



[issue25405] User install of 3.5 removes py.exe from C:\Windows

2015-10-14 Thread Paul Moore

New submission from Paul Moore:

I have had a user install of Python 3.5rc3 for some time on one of my PCs. It 
also had plenty of other versions on there - 3.4, 3.3, 2.7 and 2.6. The 3.5rc3 
install was a user install.

I have my Python 3.4 install set up on PATH, and I've configured py.ini to run 
3.4 by default. The py launcher was installed in C:\Windows and had version 
3.5.123.1013. I can't honestly recall how it got there.

I just got round to upgrading to 3.5.0 final. I downloaded the installer and 
ran it, selecting the default "Upgrade my existing install" option. It ran 
fine, without elevation, but at the end it reported in the progress area 
"Previous Version" and requested elevation.

When it had finished, py.exe was gone, and I had no filetype associations for 
.py files.

This cannot be correct behaviour. Even for a user install I expect the launcher 
to work, and filetype associations to exist, by default.

Worse still, I then went into Add/Remove programs and selected "Modify" 
expecting to have to add these back. But the dialog showed them as already 
selected. When I ran the installer (which in theory should have done nothing, 
as I had made no changes) it requested elevation and ran, reinstating py.exe 
into C:\Windows (now at version 3.5.150.1013) and putting back the associations.

While I have a complex setup, and expect to do a certain amount of work to get 
the choices the way I want, the above is utterly confusing - there was no 
indication that the installer was going to do some of the things it did, and a 
"no modification" modify *certainly* shouldn't be making changes...

--
assignee: steve.dower
components: Installation, Windows
messages: 252990
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: User install of 3.5 removes py.exe from C:\Windows
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



[issue21475] Support the Sitemap extension in robotparser

2015-10-14 Thread Peter Wirtz

Peter Wirtz added the comment:

I would like to tackle this issue. Should I wait for issue25400 to be resolved 
first?

--
nosy: +pwirtz

___
Python tracker 

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



[issue16113] SHA-3 (Keccak) support may need to be removed before 3.4

2015-10-14 Thread STINNER Victor

STINNER Victor added the comment:

I agree with Larry. If this feature is super useful, we can consider adding
it to stable versions later.

--

___
Python tracker 

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



[issue16113] SHA-3 (Keccak) support may need to be removed before 3.4

2015-10-14 Thread Larry Hastings

Larry Hastings added the comment:

I should clarify, I don't speak for 2.7.  The rules there are a little 
different and it's up to Benjamin to decide.  But please don't add new features 
to 3.4 and 3.5.

--

___
Python tracker 

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