[issue10042] functools.total_ordering fails to handle NotImplemented correctly

2013-09-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

One other thought:  The OrderedEnum example should not use the total ordering 
decorator.  

To the extent that the docs are trying to teach how to use Enum, they should 
focus on that task and not make a side-trip into the world of class decorators. 
  And to the extent that the docs are trying to show an example of production 
code, it would be better for speed and ease of tracing through a debugger to 
just define all four ordering comparisons.

--

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



[issue19072] classmethod doesn't honour descriptor protocol of wrapped callable

2013-09-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I'll take a look at this in more detail in the next week or so.

--

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



[issue19078] Allow reversed(memoryview), like memoryview

2013-09-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Claudiu's patch looks correct.

--
nosy: +rhettinger

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



[issue18885] handle EINTR in the stdlib

2013-09-30 Thread Charles-François Natali

Charles-François Natali added the comment:

(replying to Guido's post in another thread)

 Charles-Francois, sorry to add you back to the bug, but (a) I thought you had 
 agreed to a compromise patch that restarts signals in most cases but not for 
 select(), poll() etc.; (b) I may have found a flaw in the idea.
 The flaw (if it is one) is related to Py_AddPendingCall(). This schedules a 
 pending callback, mostly for signals, but doesn't AFAICT interrupt the 
 mainthread in any way. (TBH, I only understand the code for Python 2.7, and 
 in that version I'm sure it doesn't.)

 So is this a flaw? I'm nor sure. Can you think about it?

I don't think that's a problem: the way I was planning to tackle signals is to 
call PyErr_CheckSignals() before retrying upon EINTR: this runs signal 
handlers, and returns a non 0 value if an exception occured (e.g. 
KeyboardInterrupt): if that's the case, then we simply break out of the loop, 
and let the exception bubble up.
See e.g. http://hg.python.org/cpython/file/default/Modules/socketmodule.c#l3397

--
nosy: +neologix

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



[issue19072] classmethod doesn't honour descriptor protocol of wrapped callable

2013-09-30 Thread Graham Dumpleton

Graham Dumpleton added the comment:

If you have the time, would be great if you can have a quick look at my wrapt 
package. That will give you an idea of where I am coming from in suggesting 
this change.

http://wrapt.readthedocs.org/en/latest/
http://wrapt.readthedocs.org/en/latest/issues.html
http://wrapt.readthedocs.org/en/latest/decorators.html
http://wrapt.readthedocs.org/en/latest/examples.html

In short, aiming to be able to write decorators which are properly transparent 
and aware of the context they are used in, so we don't have this silly 
situation at the moment where it is necessary to write distinct decorators for 
regular functions and instance methods. A classmethod around another decorator 
was the one place things will not work as would like to see them work.

I even did a talk about writing better decorators at PyCon NZ. Slides with 
notes at:

http://lanyrd.com/2013/kiwipycon/scpkbk/

Thanks.

--

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



[issue18594] C accelerator for collections.Counter is slow

2013-09-30 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
stage: needs patch - patch review
Added file: http://bugs.python.org/file31917/fix_counter.diff

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



[issue18594] C accelerator for collections.Counter is slow

2013-09-30 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


Removed file: http://bugs.python.org/file31917/fix_counter.diff

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



[issue18594] C accelerator for collections.Counter is slow

2013-09-30 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


Added file: http://bugs.python.org/file31918/fix_counter.diff

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



[issue18594] C accelerator for collections.Counter is slow

2013-09-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Repaired version

$ py -m timeit -s 'from random import seed, randrange; seed(8675309); 
data=[randrange(1000) for i in range(10)]; from collections import Counter' 
 'Counter(data)'
100 loops, best of 3: 14.3 msec per loop
$ py -m timeit -s 'from random import seed, randrange; seed(8675309); 
data=[randrange(50) for i in range(10)]; from collections import 
Counter'  'Counter(data)'
10 loops, best of 3: 40.8 msec per loop

Current with accelerator

$ py -m timeit -s 'from random import seed, randrange; seed(8675309); 
data=[randrange(1000) for i in range(10)]; from collections import Counter' 
 'Counter(data)'
10 loops, best of 3: 61.7 msec per loop
$ py -m timeit -s 'from random import seed, randrange; seed(8675309); 
data=[randrange(50) for i in range(10)]; from collections import 
Counter'  'Counter(data)'
10 loops, best of 3: 118 msec per loop

Current without accelerator
---
$ py -m timeit -s 'from random import seed, randrange; seed(8675309); 
data=[randrange(1000) for i in range(10)]; from collections import Counter' 
 'Counter(data)'
10 loops, best of 3: 54.9 msec per loop
$ py -m timeit -s 'from random import seed, randrange; seed(8675309); 
data=[randrange(50) for i in range(10)]; from collections import 
Counter'  'Counter(data)'
10 loops, best of 3: 80.8 msec per loop

--

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



[issue19106] Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots

2013-09-30 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I see two solutions, both involving to track the newest timestamp that needs to 
pass.
a) touch the file to have a time stamp in the future. make might complain, 
though.
b) sleep until a second has passed, then touch (actually, sleep of 100ms 
multiple times until the time stamp is new enough)

The key issue is that hg touch should use the same comparison as make. So if 
make thinks that something need to be done, hg touch should touch the files.

--

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



[issue18594] C accelerator for collections.Counter is slow

2013-09-30 Thread Stefan Behnel

Stefan Behnel added the comment:

Patch LGTM and seems to work well, according to your numbers.

Only minor nitpick would be that the method references could be decref-ed 
earlier, but that would complicate the code a bit.

--

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



[issue19133] Transient test failure: test_with_statement (test_ftplib)

2013-09-30 Thread koobs

New submission from koobs:

Test failure observed on koobs-freebsd9 on default branch with changeset: 
220b34cbd711c28938ea5d980636202c51ab1fbb

Subsequent forced rebuild succeeded with no failure.
 
==
FAIL: test_with_statement (test.test_ftplib.TestTLS_FTPClassMixin)
--
Traceback (most recent call last):
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/test_ftplib.py, 
line 723, in test_with_statement
self.assertEqual(self.server.handler_instance.last_received_cmd, 'quit')
AssertionError: 'noop' != 'quit'
- noop
+ quit

--
components: Tests
messages: 198686
nosy: koobs
priority: normal
severity: normal
status: open
title: Transient test failure: test_with_statement (test_ftplib)

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



[issue19086] Make fsum usable incrementally.

2013-09-30 Thread Oscar Benjamin

Oscar Benjamin added the comment:

I should be clearer about my intentions. I'm hoping to create an
efficient and accurate sum() function for the new stdlib statistics
module:
http://bugs.python.org/issue18606
http://www.python.org/dev/peps/pep-0450/

The sum() function currently proposed can be seen in this patch:
http://bugs.python.org/file31680/statistics_combined.patch

It uses Fractions to compute an exact sum and separately tries to keep
track of type coercion to convert the end result. It is accurate and
returns a result of the appropriate type for any mix of ints,
Fractions, Decimals and floats with the caveat that mixing Fractions
and Decimals is disallowed. I believe the most common use-cases will
be for ints/floats and for these cases it is 100x slower than
sum/fsum.

The discussion here:
http://bugs.python.org/issue18606#msg195630
resulted in the sum function that you can see in the above patch.
Following that I've had off-list discussions with the author of the
module about improving the speed of the sum function (which is a
bottleneck for half of the functions exposed by the module). He is
very much interested in speed optimisations but doesn't want to
compromise on accuracy.

My own interest is that I would like an efficient and accurate (for
all types) sum function *somewhere* in the stdlib. The addition of the
statistics module with its new sum() function is a good opportunity to
achieve this. If this were purely for myself I wouldn't bother this
much with speed optimisation since I've probably already spent more of
my own time thinking about this function than I ever would running it!
(If I did want to specifically speed this up in my own work I would,
as you say, use cython).

If fsum() were modified in the way that I describe that it would be
usable as a primitive for the statistics.sum() function and also for
parallel etc. computation. I agree that the carry argument is
unnecessary and that the main is just the exactness of the return
value: it seems a shame that fsum could so easily give me an exact
result but doesn't.

As for exposing the internals of fsum, is it not the case that a
*non-overlapping* set of floats having a given exact sum is a uniquely
defined set? For msum I believe it is only necessary to strip out
zeros in order to normalise the output so that it is uniquely defined
by the true value of the sum in question (the list is already in
ascending order once the zeros are removed).

Uniqueness: If a many-digit float is given by something like
(+-)abcdefghijkl * 2 ** x and we want to break it into non-overlapping
2-digit floats of the form ab*2**x. Since the first digit of each
2-digit float must be non-zero (consider denormals as a separate case)
the largest magnitude float is uniquely determined. Subtract that from
the many-digit total and then the next largest float is uniquely
determined and so on. There can be at most 1 denormal number in the
result and this is also uniquely determined once the larger numbers
are extracted. So the only way that the partials list can be
non-unique is by the inclusion of zeros (unless I've missed something
:).

--

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



[issue13674] crash in datetime.strftime

2013-09-30 Thread gladman

gladman added the comment:

On IDLE this:

Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit 
(AMD64)] on win32
Type copyright, credits or license() for more information.
 from datetime import datetime
 datetime(1878, 12, 31).strftime('%d %b %y')

causes a crash on Windows.  I am surprised that this bug still exists as it is 
not far off two years old now.

--
nosy: +gladman

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



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-30 Thread Mateusz Loskot

Mateusz Loskot added the comment:

I have just tested Windows GUI application built against Python 3.2.1 with 
is_valid_fd patch according to http://hg.python.org/cpython/rev/f15943505db0/

All built using VS2012.

Again, I can confirm that is_valid_fd does NOT solve the problem.
Here is extract of execution flow in initstdio function:

1. fd = 0, despite it is GUI app, see 
https://connect.microsoft.com/VisualStudio/feedback/details/785119/

fd = fileno(stdin);

2. is_valid_fd will return __true__, so it moves to calling create_stdio()

if (!is_valid_fd(fd)) {
   ...
}
else {
   std = create_stdio(iomod, fd, 0, stdin, encoding, errors);
   if (std == NULL)
   goto error;
}

3. The create_stdio() call fails though, causing error followed by abort


Still, the only solution that solves this problem in Windows GUI applications 
buitl using VS2012 is to use check_fd() function to check fd, instead of 
is_valid_fd(). The check_fd() is more reliable as it will return -1 due to 
errno == EBADF.

My previous attempt to analyse _PyVerify_fd() is not relevant for the problem, 
let's forget it.

--

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



[issue12641] Remove -mno-cygwin from distutils

2013-09-30 Thread Oscar Benjamin

Oscar Benjamin added the comment:

Thanks for looking at this Antoine.

I've attached an updated patch for Python 2.7 called
check_mno_cywin_py27_2.patch. This explicitly closes the popen object
in the same way as the get_versions() function immediately above.

I've just signed an electronic contributor's agreement.

--
Added file: http://bugs.python.org/file31919/check_mno_cywin_py27_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12641
___diff -r a7db9f505e88 Lib/distutils/cygwinccompiler.py
--- a/Lib/distutils/cygwinccompiler.py  Sun Jun 23 16:12:32 2013 -0400
+++ b/Lib/distutils/cygwinccompiler.py  Mon Sep 30 12:01:34 2013 +0100
@@ -319,13 +319,18 @@
 else:
 entry_point = ''
 
-self.set_executables(compiler='gcc -mno-cygwin -O -Wall',
- compiler_so='gcc -mno-cygwin -mdll -O -Wall',
- compiler_cxx='g++ -mno-cygwin -O -Wall',
- linker_exe='gcc -mno-cygwin',
- linker_so='%s -mno-cygwin %s %s'
-% (self.linker_dll, shared_option,
-   entry_point))
+if self.gcc_version  '4' or is_cygwingcc():
+no_cygwin = ' -mno-cygwin'
+else:
+no_cygwin = ''
+
+self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin,
+ compiler_so='gcc%s -mdll -O -Wall' % no_cygwin,
+ compiler_cxx='g++%s -O -Wall' % no_cygwin,
+ linker_exe='gcc%s' % no_cygwin,
+ linker_so='%s%s %s %s'
+% (self.linker_dll, no_cygwin,
+   shared_option, entry_point))
 # Maybe we should also append -mthreads, but then the finished
 # dlls need another dll (mingwm10.dll see Mingw32 docs)
 # (-mthreads: Support thread-safe exception handling on `Mingw32')
@@ -447,3 +452,12 @@
 else:
 dllwrap_version = None
 return (gcc_version, ld_version, dllwrap_version)
+
+def is_cygwingcc():
+'''Try to determine if the gcc that would be used is from cygwin.'''
+out = os.popen('gcc -dumpmachine', 'r')
+out_string = out.read()
+out.close()
+# out_string is the target triplet cpu-vendor-os
+# Cygwin's gcc sets the os to 'cygwin'
+return out_string.strip().endswith('cygwin')
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12641] Remove -mno-cygwin from distutils

2013-09-30 Thread Oscar Benjamin

Oscar Benjamin added the comment:

On 30 September 2013 12:08, Oscar Benjamin rep...@bugs.python.org wrote:
 I've attached an updated patch for Python 2.7 called
 check_mno_cywin_py27_2.patch.

To be clear: I retested this patch (using the setup described above)
and the results are unchanged.

--

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



[issue13674] crash in datetime.strftime

2013-09-30 Thread STINNER Victor

STINNER Victor added the comment:

 I am surprised that this bug still exists as it is not far off two years old 
 now.

You should report the bug to Microsoft who distributes a buggy C runtime 
library.

--

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



[issue19119] duplicate test name in Lib/test/test_heapq.py

2013-09-30 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
versions: +Python 3.3

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



[issue13674] crash in datetime.strftime

2013-09-30 Thread gladman

gladman added the comment:

On 30/09/2013 12:39, STINNER Victor wrote:
 
 STINNER Victor added the comment:
 
 I am surprised that this bug still exists as it is not far off two years old 
 now.
 
 You should report the bug to Microsoft who distributes a buggy C runtime 
 library.
 
 --
 
 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue13674
 ___
 

Thank you for your suggestion.

But, given that this bug has been present for some two years, I would
hope that Python developers would have already done what you suggest and
this leads me to doubt that any approach that I made to Microsoft would
achieve any practical benefit.

In practice it is pretty well always necessary in building applications
on top of widely used compilers and libraries to have to workaround the
many bugs that they contain.

Since there is evidently no workaround for this issue in the Python
3.3.2 code, I have to assume that one is not considered to be
necessary, presumably because Microsoft has fixed (or intends to fix)
this issue.

--

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



[issue13674] crash in datetime.strftime

2013-09-30 Thread Tim Golden

Tim Golden added the comment:

In reality (as I'm sure you can guess) it's just that no-one's got to
the point of fixing it. I did start off, but it's not a trivial fix and
clearly it got sidelined (with no-one shouting). Sometimes that's just
the way it is.

I'll see if I can dig out whatever code I had managed to change. I'm
certainly happy to review and apply a patch if someone wants to supply one.

--

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



[issue19106] Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots

2013-09-30 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Here is a patch that backdates outputs 1s after their youngest input (and 
sleeps if necessary to avoid producing files in the future).

With that, I get

lap-le:3k loewis$ touch Parser/asdl_c.py ;date;make touch;date
Mo 30 Sep 2013 15:29:21 CEST
hg --config extensions.touch=Tools/hg/hgtouch.py touch -v
Touching Include/Python-ast.h
Touching Python/Python-ast.c
Mo 30 Sep 2013 15:29:23 CEST
lap-le:3k loewis$ ls -lT Parser/asdl_c.py Include/Python-ast.h 
Python/Python-ast.c
-rw-r--r--  1 loewis  admin   19489 30 Sep 15:29:22 2013 Include/Python-ast.h
-rwxr-xr-x  1 loewis  admin   43732 30 Sep 15:29:21 2013 Parser/asdl_c.py
-rw-r--r--  1 loewis  admin  228785 30 Sep 15:29:23 2013 Python/Python-ast.c

BTW, I think the Python-ast.c issue could be solved by just having Python-ast.c 
depend on the same inputs as Python-ast.h; the C file isn't actually depending 
on the H file.

--
keywords: +patch
Added file: http://bugs.python.org/file31920/touch.diff

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



[issue19106] Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots

2013-09-30 Thread Eli Bendersky

Eli Bendersky added the comment:

LGTM

--

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



[issue19106] Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots

2013-09-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 477246839224 by Martin v. Löwis in branch '3.3':
Issue #19106: Touch generated files to be 1s newer than their youngest source.
http://hg.python.org/cpython/rev/477246839224

--
nosy: +python-dev

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



[issue19134] test_inspect.py failed if module _multiprocessing not available

2013-09-30 Thread Remi Pointel

New submission from Remi Pointel:

When I run the regress tests on OpenBSD 5.4-current, the test test_inspect.py 
failed because the module _multiprocessing is not available, instead of 
skipping the test:

FAILED (errors=1)
Traceback (most recent call last):
  File ./Lib/test/test_inspect.py, line 2453, in module
test_main()
  File ./Lib/test/test_inspect.py, line 2449, in test_main
TestBoundArguments, TestGetClosureVars, TestUnwrap, TestMain
  File /tmp/Python-3.4.0a3/Lib/test/support/__init__.py, line 1696, in 
run_unittest
_run_suite(suite)
  File /tmp/Python-3.4.0a3/Lib/test/support/__init__.py, line 1671, in 
_run_suite
raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File ./Lib/test/test_inspect.py, line 2411, in test_qualname_source
module = importlib.import_module('concurrent.futures')
  File /tmp/Python-3.4.0a3/Lib/importlib/__init__.py, line 95, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File frozen importlib._bootstrap, line 1613, in _gcd_import
  File frozen importlib._bootstrap, line 1594, in _find_and_load
  File frozen importlib._bootstrap, line 1561, in _find_and_load_unlocked
  File frozen importlib._bootstrap, line 607, in _check_name_wrapper
  File frozen importlib._bootstrap, line 1056, in load_module
  File frozen importlib._bootstrap, line 926, in load_module
  File frozen importlib._bootstrap, line 274, in _call_with_frames_removed
  File /tmp/Python-3.4.0a3/Lib/concurrent/futures/__init__.py, line 17, in 
module
from concurrent.futures.process import ProcessPoolExecutor
  File /tmp/Python-3.4.0a3/Lib/concurrent/futures/process.py, line 53, in 
module
from multiprocessing.queues import SimpleQueue, Full
  File /tmp/Python-3.4.0a3/Lib/multiprocessing/queues.py, line 22, in module
import _multiprocessing
ImportError: No module named '_multiprocessing'


Diff to skip test_qualname_source if _multiprocessing is not available is 
attached. Is it ok?

Remi.

--
components: Tests
files: Lib_test_test_inspect_py.diff
keywords: patch
messages: 198698
nosy: rpointel
priority: normal
severity: normal
status: open
title: test_inspect.py failed if module _multiprocessing not available
versions: Python 3.4
Added file: http://bugs.python.org/file31921/Lib_test_test_inspect_py.diff

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



[issue19106] Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots

2013-09-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 86eff5c4e698 by Martin v. Löwis in branch '3.3':
Issue #19106: Add buildbottouch target.
http://hg.python.org/cpython/rev/86eff5c4e698

--

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



[issue13674] crash in datetime.strftime

2013-09-30 Thread gladman

gladman added the comment:

On 30/09/2013 13:14, Tim Golden wrote:
 
 Tim Golden added the comment:
 
 In reality (as I'm sure you can guess) it's just that no-one's got to
 the point of fixing it. I did start off, but it's not a trivial fix and
 clearly it got sidelined (with no-one shouting). Sometimes that's just
 the way it is.
 
 I'll see if I can dig out whatever code I had managed to change. I'm
 certainly happy to review and apply a patch if someone wants to supply one.

Thank you for your comment Tim.

To be honest, Python is just so reliable that I was genuinely very
surprised to find something that actually crashes it :-)

It's hardly a priority but I thought it might be worth a comment in case
it was a bug that had simply been forgotten about.

--

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



[issue18857] urlencode of a None value uses the string 'None'

2013-09-30 Thread R. David Murray

R. David Murray added the comment:

No, Senthil is correct.

My original liking for this idea came from my mistaken impression that a value 
without an '=' was different from a value with an '='.  But clearly the 
practice in the industry (the de facto standard) is that they are the same, and 
indicate that the value of the parameter is the empty string.

So, urls do *not* have any way of representing a null value (as differentiated 
from an empty string).  All url values are strings.  This means that the 
correct value to use for a python value is always its string representation, 
which in the case of None is None, just as the correct representation of a 
Python boolean value is True or False (since http also does not have any 
specifically boolean type, only string values).

--
status: open - closed

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



[issue19132] Add compact mode to pprint

2013-09-30 Thread R. David Murray

R. David Murray added the comment:

I like it.  If it isn't too difficult, I'd suggest that compact mode also 
indent the string continuation lines:

['one string', 'other string',
 'very very long string which is continued on '
  'several lines',
 'and again', 'and again', 'and again',
 'and again']

--
nosy: +r.david.murray

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



[issue19106] Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots

2013-09-30 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I have now updated the master.cfg to make buildbottouch a separate build step.

--

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



[issue19134] test_inspect.py failed if module _multiprocessing not available

2013-09-30 Thread Brett Cannon

Brett Cannon added the comment:

test.support.import_module is typically meant for global imports as 
function-level imports are discouraged in general. I would instead use the 
unittest.skipIf decorator::

  @unittest.skipIf(not test.support.multiprocessing, multiprocessing 
required) 
  def test_qualname_source(self):
...

--
nosy: +brett.cannon

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



[issue18857] urlencode of a None value uses the string 'None'

2013-09-30 Thread Joshua Johnston

Joshua Johnston added the comment:

I agree with True == 'True' and False == 'False' but None should be empty since 
it represents the absence of a value akin to null, Nil, etc in other languages. 
Ultimately it is not my decision make so I can only agree to disagree.

Thanks for having this discussion with me. So far the python community has been 
a pleasant change from what I am used to!

--

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



[issue18857] urlencode of a None value uses the string 'None'

2013-09-30 Thread R. David Murray

R. David Murray added the comment:

If we were making this decision de novo, we might decide it that way.  However, 
the current behavior has been in place for a long time, so backward 
compatibility concerns raise the bar high enough that the costs of the change 
outweigh any benefits, even if we got general agreement that there was a 
benefit :)

--

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



[issue19106] Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots

2013-09-30 Thread Eli Bendersky

Eli Bendersky added the comment:

With your fix, `make touch` now behaves as expected. Also, I can see the step 
added to the bots (e.g. 
http://buildbot.python.org/all/builders/AMD64%20Ubuntu%20LTS%203.x/builds/2597/steps/shell/logs/stdio)

Thanks, I think the issue is resolved then. We should now be able to have 
modern Python code in scripts that generate code such as asdl[_c].py because 
bots and people will only old versions of Python don't ever need to run them.

Should we add a note about this to the dev guide?

--

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



[issue19099] struct.pack fails first time with unicode fmt

2013-09-30 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here's the preliminary patch. I am assuming that we should accept unicode 
argument not reject it straight away.

Python3 does that.
 import struct
 struct.pack('b', 3)
b'\x03'
 struct.pack(b'b', 3)
b'\x03'
 struct.pack(b'\xff', 3)
Traceback (most recent call last):
  File stdin, line 1, in module
struct.error: bad char in struct format

--
keywords: +patch
nosy: +vajrasky
Added file: 
http://bugs.python.org/file31922/handle_ascii_range_unicode_in_struct_pack.patch

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



[issue19106] Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots

2013-09-30 Thread Martin v . Löwis

Martin v. Löwis added the comment:

make touch (or hg touch) certainly should be mentioned. Details of the 
buildbot configuration need not.

Publishing the buildbot configuration file might be useful, except that it also 
contains all the builder passwords, which should not be published. If that is 
done, it should be the life configuration file (rather than a static copy 
created now). It might be easiest to publish it through a symlink on 
buildbot.python.org.

--

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



[issue19024] Document asterisk (*), splat or star operator

2013-09-30 Thread Xavier Combelle

Changes by Xavier Combelle xavier.combe...@gmail.com:


--
nosy: +xcombelle

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



[issue16041] poplib: unlimited readline() from connection

2013-09-30 Thread Jyrki Pulliainen

Jyrki Pulliainen added the comment:

Added a test for SSL, if SSL is available

--
Added file: http://bugs.python.org/file31923/issue16041_py26_with_ssl.patch

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



[issue19132] Add compact mode to pprint

2013-09-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch. Please review and correct the documentation.

--
keywords: +patch
stage: needs patch - patch review
Added file: http://bugs.python.org/file31924/pprint_compact.patch

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



[issue18594] C accelerator for collections.Counter is slow

2013-09-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Benchmarking results look great.

But isn't _PyObject_LookupSpecial() more appropriate function for special 
methods lookup than PyObject_GetAttrString()?

--

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



[issue19132] Add compact mode to pprint

2013-09-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 I'd suggest that compact mode also indent the string continuation lines:

Please open new issue for this.

--

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



[issue19099] struct.pack fails first time with unicode fmt

2013-09-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Struct constructor accepts only str and not unicode. But struct.pack() uses 
caching and it found Struct('B') in the cache (because u'B' and 'B' are equal 
and have same hash).

I doubt we should fix this. Adding support of Unicode argument is new feature.

--
nosy: +mark.dickinson, meador.inge, pitrou, serhiy.storchaka

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



[issue19133] Transient test failure: test_with_statement (test_ftplib)

2013-09-30 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +giampaolo.rodola
stage:  - needs patch
type:  - behavior
versions: +Python 3.4

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



[issue19086] Make fsum usable incrementally.

2013-09-30 Thread Tim Peters

Tim Peters added the comment:

The possible use cases are so varied  fuzzy it seems better to use an object 
for this, rather than funk-ify `fsum`.  Say, class Summer.  Then methods could 
be invented as needed, with whatever state is required belonging to Summer 
objects rather than passed around in funky calling-sequence/return conventions. 
 Like,

s = Summer() # new object
s.add(3.1)   # add one number to running sum
s.sum()  # returns sum so far as float: 3.1
s.update(iterable_returning_numbers)  # add a bunch of numbers to sum
s.combine(another_Summer_object)  # add Summer's
s.sum_as_decimal(precision=None) # sum so far as Decimal
s.sum_as_fraction()  # exact sum so far as Fraction

Blah blah blah ;-)

--
nosy: +tim.peters

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



[issue19099] struct.pack fails first time with unicode fmt

2013-09-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Either way, the runtime inconsistency is a bug. Since we shouldn't break 
existing code, I would vote for always allowing unicode format strings, rather 
than always disallowing them.

Another argument is that str and unicode are generally substituible in 2.x when 
they are pure ASCII (which they are here).

--

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



[issue19132] Add compact mode to pprint

2013-09-30 Thread R. David Murray

R. David Murray added the comment:

As noted in the review, I'm not as keen on having dictionaries displayed in 
compact form.

--

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



[issue19087] bytearray front-slicing not optimized

2013-09-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 I'm not sure that it is what you expected: bytearray() is only initialized 
 once (setup of timeit). You probably want to reinitialize at each loop.

There is no setup of timeit here. And you forgot bytes(b) after accumulating 
loop. bench_bytearray.py shows me 10% slowdown for 10**3 and 10**5 bytes tests.

Of course it can be a measurement glitch. On other hand, there are no 
measurements which show positive effect of the patch for real code. Currently 
we consider only hypothetic code and can't compare it with alternatives.

 The problem is the suboptimal code is also the natural way to write such 
 code. If you know a simple and idiomatic way to write an optimal bytes FIFO, 
 then please share it with us.

Please share this written in the natural way real code with us. I can't 
compare with alternatives a code which I don't see.

--

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



[issue19134] test_inspect.py failed if module _multiprocessing not available

2013-09-30 Thread Remi Pointel

Remi Pointel added the comment:

Yes, but it needs an import to use test.support.multiprocessing.

--

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



[issue19134] test_inspect.py failed if module _multiprocessing not available

2013-09-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d7ba4ca59023 by Brett Cannon in branch 'default':
Issue #19134: Make a test in inspect conditional on multiprocessing
http://hg.python.org/cpython/rev/d7ba4ca59023

--
nosy: +python-dev

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



[issue19134] test_inspect.py failed if module _multiprocessing not available

2013-09-30 Thread Brett Cannon

Brett Cannon added the comment:

The import doesn't matter for test.support.multiprocessing as it is conditional 
thanks to the try/except. If that fails then the skipIf will be triggered and 
nothing will be executed. If the import succeeds in test.support then the 
importlib.import_module() call will succeed without issue. The point is that it 
is much more obvious why the test may get skipped from reading the code rather 
than looking at the function name.

--
assignee:  - brett.cannon
resolution:  - fixed
status: open - closed

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



[issue19087] bytearray front-slicing not optimized

2013-09-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

  The problem is the suboptimal code is also the natural way to
 write such code. If you know a simple and idiomatic way to write an
 optimal bytes FIFO, then please share it with us.
 
 Please share this written in the natural way real code with us. I
 can't compare with alternatives a code which I don't see.

I'm sorry, I don't want to spend more time on such a minor issue.  The
patch is simple and yields good benefits, and Victor seems to have
approved it, so I'm inclined to ignore your skepticism and commit.

I would have liked more constructive criticism (perhaps the patch is
inefficient or suboptimal, etc.), but it seems I'll have to do without
it.

--

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



[issue19134] test_inspect.py failed if module _multiprocessing not available

2013-09-30 Thread Remi Pointel

Remi Pointel added the comment:

Thanks :)

--

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



[issue19087] bytearray front-slicing not optimized

2013-09-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't understand why you avoid to show any examples which benefit. Shouldn't 
optimizing patches prove their efficient?

--

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



[issue19086] Make fsum usable incrementally.

2013-09-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Let's close this one.  As Uncle Timmy says, it would be a mistake to funkify 
the signature for math.fsum.

If something like a Summer() class is born, it should start it life outside the 
standard library, gain a following, and let both the API and implementation 
mature.

I'm sympathic about the loss of information in the final step of math.fsum() 
but don't think the standard library is the place for this to be born.

--
resolution:  - rejected
status: open - closed

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



[issue19132] Add compact mode to pprint

2013-09-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch addresses David's comments. Thank you David.

 As noted in the review, I'm not as keen on having dictionaries displayed in 
 compact form.

This makes sense. If no one will argue for compactifying mappings I'll remove 
this part of the patch.

--
Added file: http://bugs.python.org/file31925/pprint_compact_2.patch

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



[issue16041] poplib: unlimited readline() from connection

2013-09-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7214e3324a45 by Barry Warsaw in branch '2.6':
- Issue #16041: CVE-2013-1752: poplib: Limit maximum line lengths to 2048 to
http://hg.python.org/cpython/rev/7214e3324a45

--
nosy: +python-dev

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



[issue16041] poplib: unlimited readline() from connection

2013-09-30 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
versions:  -Python 2.6

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



[issue19087] bytearray front-slicing not optimized

2013-09-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 I don't understand why you avoid to show any examples which benefit.
 Shouldn't optimizing patches prove their efficient?

Many micro-optimizations get committed without proving themselves on a
high-level benchmark suite, as long as they produce a big enough
difference on micro-benchmarks. I think you have noticed that!

A 4x improvement on a micro-benchmark is very likely to make a
difference in at least some real-world code (while a 10% improvement
wouldn't).

--

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



[issue12641] Remove -mno-cygwin from distutils

2013-09-30 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
assignee: eric.araujo - pitrou
stage:  - commit review
versions:  -Python 3.2

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



[issue19086] Make fsum usable incrementally.

2013-09-30 Thread Oscar Benjamin

Oscar Benjamin added the comment:

Fair enough.

Thanks again for taking the time to look at this.

--

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



[issue19087] bytearray front-slicing not optimized

2013-09-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

However, the patch had a bug in the resizing logic. Here is a new patch fixing 
that (+ an additional test).

--
Added file: http://bugs.python.org/file31926/bytea_slice2.patch

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



[issue19087] bytearray front-slicing not optimized

2013-09-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Other benchmarks for the new patch (exercising FIFO-like behaviour: some data 
is appended at one end, and popped at the other):

timeit -s b=bytearray(10);s=b'x'*100 b[:100] = b''; b.extend(s)
- before: 4.07 usec per loop
- after: 0.812 usec per loop

For comparison, popping from the end (LIFO-like):

timeit -s b=bytearray(10);s=b'x'*100 b[-100:] = b''; b.extend(s)
- before: 0.894 usec per loop
- after: 0.819 usec per loop

--

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



[issue12641] Remove -mno-cygwin from distutils

2013-09-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7d9a1aa8d95e by Antoine Pitrou in branch '2.7':
Issue #12641: Avoid passing -mno-cygwin to the mingw32 compiler, except when 
necessary.
http://hg.python.org/cpython/rev/7d9a1aa8d95e

--
nosy: +python-dev

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



[issue12641] Remove -mno-cygwin from distutils

2013-09-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6b89176f1be5 by Antoine Pitrou in branch '3.3':
Issue #12641: Avoid passing -mno-cygwin to the mingw32 compiler, except when 
necessary.
http://hg.python.org/cpython/rev/6b89176f1be5

New changeset 8e180b2067e4 by Antoine Pitrou in branch 'default':
Issue #12641: Avoid passing -mno-cygwin to the mingw32 compiler, except when 
necessary.
http://hg.python.org/cpython/rev/8e180b2067e4

--

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



[issue12641] Remove -mno-cygwin from distutils

2013-09-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thank you Oscar! This issue can endly be fixed.

--
resolution:  - fixed
stage: commit review - committed/rejected
status: open - closed

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



[issue16500] Add an 'atfork' module

2013-09-30 Thread Dwayne Litzenberger

Changes by Dwayne Litzenberger dl...@dlitz.net:


--
nosy: +DLitz

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



[issue18674] Store weak references in modules_by_index

2013-09-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, rejecting my own patch because of compatibility issues.

--
resolution:  - wont fix
stage: patch review - committed/rejected
status: open - closed

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



[issue16041] poplib: unlimited readline() from connection

2013-09-30 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Sep 30, 2013, at 08:41 PM, Arfrever Frehtes Taifersar Arahesis wrote:


Arfrever Frehtes Taifersar Arahesis added the comment:

 New changeset 7214e3324a45 by Barry Warsaw in branch '2.6':
 - Issue #16041: CVE-2013-1752: poplib: Limit maximum line lengths to 2048 to
 http://hg.python.org/cpython/rev/7214e3324a45
 ...
 --- a/Misc/NEWS
 +++ b/Misc/NEWS
 ...
 +- Issue #16041: CVE-2013-1752: poplib: Limit maximum line lengths to 2048 to
 +  prevent readline() calls from consuming too much member.

Maybe s/member/memory/ ?

Good catch, thanks.

--

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



[issue19087] bytearray front-slicing not optimized

2013-09-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 A 4x improvement on a micro-benchmark is very likely to make a
difference in at least some real-world code (while a 10% improvement
wouldn't).

If there is a code that uses the deleting from the beginning of a bytearray. I 
just pray to demonstrate this code. Perhaps you only intend to write a code 
that will use it. Wonderful. I want to look at it and make sure that the same 
problem can not be solved just as effective in another way.

--

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



[issue16040] nntplib: unlimited readline() from connection

2013-09-30 Thread Jyrki Pulliainen

Jyrki Pulliainen added the comment:

Regarding the implementation: all commands (even those returning multiple 
lines), use the same readline method.

I've attached a patch for 2.6, working on the 2.7+ too.

--
keywords: +patch
nosy: +nailor
Added file: http://bugs.python.org/file31927/issue16040_py26.patch

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



[issue16040] nntplib: unlimited readline() from connection

2013-09-30 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Looks great, thanks!  I'll apply this to 2.6.9 but let others forward port it 
to 2.7.

--

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



[issue16041] poplib: unlimited readline() from connection

2013-09-30 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

 New changeset 7214e3324a45 by Barry Warsaw in branch '2.6':
 - Issue #16041: CVE-2013-1752: poplib: Limit maximum line lengths to 2048 to
 http://hg.python.org/cpython/rev/7214e3324a45
 ...
 --- a/Misc/NEWS
 +++ b/Misc/NEWS
 ...
 +- Issue #16041: CVE-2013-1752: poplib: Limit maximum line lengths to 2048 to
 +  prevent readline() calls from consuming too much member.

Maybe s/member/memory/ ?

--

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



[issue16040] nntplib: unlimited readline() from connection

2013-09-30 Thread Jyrki Pulliainen

Jyrki Pulliainen added the comment:

The patch for 2.6 applies cleanly on 2.7 too and the tests pass there

--

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



[issue16040] nntplib: unlimited readline() from connection

2013-09-30 Thread Jyrki Pulliainen

Jyrki Pulliainen added the comment:

Did a slight change to the patch, making the too long line to look like a valid 
line so that it does not raise a NNTPProtocolError otherwise. Thanks to Barry 
for catching this :)

I also wonder if there should be data error risen instead? Current docstrings 
of the errors are not that well fit.

--
Added file: http://bugs.python.org/file31928/issue16040_py26_v2.patch

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



[issue19087] bytearray front-slicing not optimized

2013-09-30 Thread STINNER Victor

STINNER Victor added the comment:

I took me some time, but Antoine explained me the use case on IRC :-) The patch 
is useful is the bytearray is used as a FIFO: remove front, append tail. It can 
be seen as an implementation for BufferedReader. Consumer/producer is a common 
pattern, especially consuming one end (front) and produce at the other end 
(tail).

--

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



[issue19087] bytearray front-slicing not optimized

2013-09-30 Thread STINNER Victor

STINNER Victor added the comment:

I adapted my micro-benchmark to measure the speedup: bench_bytearray2.py. 
Result on  bytea_slice2.patch:

Common platform:
CFLAGS: -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -g 
-fwrapv -O3 -Wall -Wstrict-prototypes
CPU model: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
Timer info: namespace(adjustable=False, 
implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, 
resolution=1e-09)
Platform: Linux-3.9.4-200.fc18.x86_64-x86_64-with-fedora-18-Spherical_Cow
Python unicode implementation: PEP 393
Timer: time.perf_counter
Bits: int=32, long=64, long long=64, size_t=64, void*=64
Timer precision: 40 ns

Platform of campaign original:
Date: 2013-09-30 23:39:31
Python version: 3.4.0a2+ (default:687dd81cee3b, Sep 30 2013, 23:39:27) [GCC 
4.7.2 20121109 (Red Hat 4.7.2-8)]
SCM: hg revision=687dd81cee3b tag=tip branch=default date=2013-09-29 22:18 
+0200

Platform of campaign patched:
Date: 2013-09-30 23:38:55
Python version: 3.4.0a2+ (default:687dd81cee3b+, Sep 30 2013, 23:30:35) [GCC 
4.7.2 20121109 (Red Hat 4.7.2-8)]
SCM: hg revision=687dd81cee3b+ tag=tip branch=default date=2013-09-29 22:18 
+0200

+-+
non regression  |original | patched
+-+
concatenate 10**1 bytes |  1.1 us (*) | 1.14 us
concatenate 10**3 bytes | 46.9 us | 46.8 us (*)
concatenate 10**5 bytes | 4.66 ms (*) | 4.71 ms
concatenate 10**7 bytes |  478 ms (*) |  483 ms
+-+
Total   |  482 ms (*) |  488 ms
+-+

+---+-
deleting front, append tail |  original |  patched
+---+-
buffer 10**1 bytes  |639 ns (*) | 689 ns (+8%)
buffer 10**3 bytes  |682 ns (*) | 723 ns (+6%)
buffer 10**5 bytes  |   3.54 us (+428%) |   671 ns (*)
buffer 10**7 bytes  | 900 us (+107128%) |   840 ns (*)
+---+-
Total   |  905 us (+30877%) |  2.92 us (*)
+---+-

+--+
Summary | original | patched
+--+
non regression  |   482 ms (*) |  488 ms
deleting front, append tail | 905 us (+30877%) | 2.92 us (*)
+--+
Total   |   483 ms (*) |  488 ms
+--+

@Serhiy: I see zero difference in the append loop micro-benchmark. I added 
the final cast to bytes()

@Antoine: Your patch rocks, 30x faster! (I don't care of the 8% slowdown in the 
nanosecond timing).

--
Added file: http://bugs.python.org/file31929/bench_bytearray2.py

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



[issue16040] nntplib: unlimited readline() from connection

2013-09-30 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Sep 30, 2013, at 09:43 PM, Jyrki Pulliainen wrote:

I also wonder if there should be data error risen instead? Current docstrings
of the errors are not that well fit.

I guess a data error makes the least nonsense here, so I'll change it over to
that.  I'm happy to entertain other thoughts (except for introducing a new
exception of course) before 2.6.9 final.

--

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



[issue16040] nntplib: unlimited readline() from connection

2013-09-30 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
versions:  -Python 2.7

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



[issue16040] nntplib: unlimited readline() from connection

2013-09-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 731abf7834c4 by Barry Warsaw in branch '2.6':
- Issue #16040: CVE-2013-1752: nntplib: Limit maximum line lengths to 2048 to
http://hg.python.org/cpython/rev/731abf7834c4

New changeset 36680a7c0e22 by Barry Warsaw in branch '2.7':
- Issue #16040: CVE-2013-1752: nntplib: Limit maximum line lengths to 2048 to
http://hg.python.org/cpython/rev/36680a7c0e22

--
nosy: +python-dev

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



[issue16040] nntplib: unlimited readline() from connection

2013-09-30 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
versions:  -Python 2.6

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



[issue19099] struct.pack fails first time with unicode fmt

2013-09-30 Thread Musashi Tamura

Musashi Tamura added the comment:

Thanks for feedback.

I think it should be fixed with allowing unicode. 
from __future__ import unicode_literals may break existing code.

--

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



[issue19081] zipimport behaves badly when the zip file changes while the process is running

2013-09-30 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +brett.cannon, eric.snow

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



[issue19052] Python's CGIHTTPServer does not handle Expect: 100-continue gracefully which results in some Post requests being handled slowly.

2013-09-30 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue1491] BaseHTTPServer incorrectly implements response code 100

2013-09-30 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue19053] read1() from zipfile returns empty data

2013-09-30 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue11620] winsound.PlaySound() with SND_MEMORY should accept bytes instead of strings

2013-09-30 Thread Eric Snow

Eric Snow added the comment:

I ran into this today.  Can't we just change the Z to z# in the format 
string (or z*)?  Other than that, Tim's patch makes sense.

--
nosy: +eric.snow
versions: +Python 3.3, Python 3.4 -Python 3.1

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



[issue19099] struct.pack fails first time with unicode fmt

2013-09-30 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Refactor test to clear the cache before using unicode format.

--
Added file: 
http://bugs.python.org/file31930/handle_ascii_range_unicode_in_struct_pack_v2.patch

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



[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-30 Thread Senthil Kumaran

Senthil Kumaran added the comment:

I have provided my comments in the review tool. Please check them out.

--

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