[issue16237] bdist_rpm SPEC files created with distutils may be distro specific

2014-07-16 Thread Bohuslav "Slavek" Kabrda

Bohuslav "Slavek" Kabrda added the comment:

Hi, so I'm not sure I understand this correctly. AFAICS there are two patches 
in issue 14443 that are, to certain degree, independent. As for the patch that 
overrides __os_install_post [1], that is no longer needed in RHEL 7, since the 
line

/usr/lib/rpm/brp-python-bytecompile \

in RHEL 6 RPM has been replaced by

/usr/lib/rpm/brp-python-bytecompile %{__python} 
%{?_python_bytecompile_errors_terminate_build} \

in RHEL 7 RPM. The other patch referenced from that issue that defines macro 
__python to self.python (meaning either sys.executable or "python3") [2] is 
still needed, I believe.

I hope that this answers the question.

[1] http://hg.python.org/cpython/rev/a9a12ad553f0
[2] http://hg.python.org/cpython/rev/3d61e27cc570

--

___
Python tracker 

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



[issue21955] ceval.c: implement fast path for integers with a single digit

2014-07-16 Thread STINNER Victor

Changes by STINNER Victor :


--
Removed message: http://bugs.python.org/msg223179

___
Python tracker 

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



[issue21955] ceval.c: implement fast path for integers with a single digit

2014-07-16 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file35965/inline.patch

___
Python tracker 

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



[issue21955] ceval.c: implement fast path for integers with a single digit

2014-07-16 Thread STINNER Victor

STINNER Victor added the comment:

bench_long.py: micro-benchmark for x+y. I confirm a slow down with 21955.patch. 
IMO you should at least inline PyLong_AsLong() which can be simplified if the 
number has 0 or 1 digit. Here is my patch "inline.patch" which is  21955.patch  
with PyLong_AsLong() inlined.

Benchmark result (patch=21955.patch, inline=inline.patch):

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

Platform of campaign orig:
Date: 2014-07-16 10:04:27
Python version: 3.5.0a0 (default:08b3ee523577, Jul 16 2014, 10:04:23) [GCC 
4.8.2 20131212 (Red Hat 4.8.2-7)]
SCM: hg revision=08b3ee523577 tag=tip branch=default date="2014-07-15 13:23 
+0300"

Platform of campaign patch:
Date: 2014-07-16 10:04:01
Python version: 3.5.0a0 (default:08b3ee523577+, Jul 16 2014, 10:02:12) [GCC 
4.8.2 20131212 (Red Hat 4.8.2-7)]
SCM: hg revision=08b3ee523577+ tag=tip branch=default date="2014-07-15 13:23 
+0300"

+-+--
Tests   |    orig | patch
+-+--
1+2 |   23 ns (*) | 24 ns
"1+2" ran 100 times | 1.61 us (*) | 1.74 us (+7%)
+-+--
Total   | 1.64 us (*) | 1.76 us (+7%)
+-+--

--
Added file: http://bugs.python.org/file35964/bench_long.py

___
Python tracker 

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



[issue21955] ceval.c: implement fast path for integers with a single digit

2014-07-16 Thread STINNER Victor

STINNER Victor added the comment:

bench_long.py: micro-benchmark for x+y. I confirm a slow down with 21955.patch. 
IMO you should at least inline PyLong_AsLong() which can be simplified if the 
number has 0 or 1 digit. Here is my patch "inline.patch" which is  21955.patch  
with PyLong_AsLong() inlined.

Benchmark result (patch=21955.patch, inline=inline.patch):

Common platform:
Platform: Linux-3.14.8-200.fc20.x86_64-x86_64-with-fedora-20-Heisenbug
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 -Werror=declaration-after-statement -DNDEBUG -g 
-fwrapv -O3 -Wall -Wstrict-prototypes
Timer info: namespace(adjustable=False, 
implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, 
resolution=1e-09)
Python unicode implementation: PEP 393
Timer: time.perf_counter

Platform of campaign orig:
Date: 2014-07-16 10:04:27
Python version: 3.5.0a0 (default:08b3ee523577, Jul 16 2014, 10:04:23) [GCC 
4.8.2 20131212 (Red Hat 4.8.2-7)]
SCM: hg revision=08b3ee523577 tag=tip branch=default date="2014-07-15 13:23 
+0300"
Timer precision: 40 ns

Platform of campaign patch:
Timer precision: 40 ns
Date: 2014-07-16 10:04:01
Python version: 3.5.0a0 (default:08b3ee523577+, Jul 16 2014, 10:02:12) [GCC 
4.8.2 20131212 (Red Hat 4.8.2-7)]
SCM: hg revision=08b3ee523577+ tag=tip branch=default date="2014-07-15 13:23 
+0300"

Platform of campaign inline:
Timer precision: 31 ns
Date: 2014-07-16 10:11:21
Python version: 3.5.0a0 (default:08b3ee523577+, Jul 16 2014, 10:10:48) [GCC 
4.8.2 20131212 (Red Hat 4.8.2-7)]
SCM: hg revision=08b3ee523577+ tag=tip branch=default date="2014-07-15 13:23 
+0300"

+-+---+---
Tests   |    orig | patch | inline
+-+---+---
1+2 |   23 ns (*) | 24 ns |   21 ns (-12%)
"1+2" ran 100 times | 1.61 us (*) | 1.74 us (+7%) | 1.39 us (-14%)
+-+---+---
Total   | 1.64 us (*) | 1.76 us (+7%) | 1.41 us (-14%)
+-+---+---

(I removed my message because I posted the wrong benchmark output, inline 
column was missing.)

--

___
Python tracker 

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



[issue21901] test_selectors.PollSelectorTestCase.test_above_fd_setsize reported killed by shell

2014-07-16 Thread STINNER Victor

STINNER Victor added the comment:

> rdmurray@pydev:~/python/p34>python -c 'import resource; 
> print(resource.getrlimit(resource.RLIMIT_NOFILE))'
> (1024L, 1048576L)

Oh, 1 million files is much bigger than 4 thousand files (4096).

The test should only test FD_SETSIZE + 10 files, the problem is to get 
FD_SETSITE:

# A scalable implementation should have no problem with more than
# FD_SETSIZE file descriptors. Since we don't know the value, we just
# try to set the soft RLIMIT_NOFILE to the hard RLIMIT_NOFILE ceiling.

For example, on my Linux FD_SETSIZE is 1024, whereas the hard limit of 
RLIMIT_NOFILE is 4096.

/usr/include/linux/posix_types.h:#define __FD_SETSIZE   1024

Maybe we can simply expose the FD_SETSIZE constant in the select module? The 
constant is useful when you use select.select(), which is still heavily used on 
Windows.

--

___
Python tracker 

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



[issue21985] test_asyncio prints some junk

2014-07-16 Thread STINNER Victor

STINNER Victor added the comment:

"Task was destroyed but it is pending!" messages come from the issue #21163, I 
know that I have to make these messages quiet and I don't know yet how to fix 
this.

"Read pipe 9 connected: ... " output was specific to the issue 
#21645. I created a dedicated repository to investigate this issue. It looks 
like a severe race condition in signal handling when there are more than 1 
thread on FreeBSD.

--

___
Python tracker 

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



[issue21645] Race condition in signal handling on FreeBSD

2014-07-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1ff9ce2204ee by Victor Stinner in branch 'default':
Issue #21645, #21985: Remove debug code
http://hg.python.org/cpython/rev/1ff9ce2204ee

--

___
Python tracker 

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



[issue21985] test_asyncio prints some junk

2014-07-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1ff9ce2204ee by Victor Stinner in branch 'default':
Issue #21645, #21985: Remove debug code
http://hg.python.org/cpython/rev/1ff9ce2204ee

--
nosy: +python-dev

___
Python tracker 

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



[issue21985] test_asyncio prints some junk

2014-07-16 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +asyncio

___
Python tracker 

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



[issue21645] asyncio: Race condition in signal handling on FreeBSD

2014-07-16 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Race condition in signal handling on FreeBSD -> asyncio: Race condition 
in signal handling on FreeBSD

___
Python tracker 

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



[issue21988] Decrease iterating overhead it timeit

2014-07-16 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Currently timeit has significant iterating overhead when tests fast statements. 
Such overhead makes hard to measure effects of microoptimizations. To decrease 
overhead and get more precise results we should repeat tested statement many 
times:

$ ./python -m timeit -s "x=10"  "x+x"
100 loops, best of 3: 0.2 usec per loop
$ ./python -m timeit -s "x=10"  "x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; 
x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; 
x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; 
x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; 
x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; 
x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; 
x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x; x+x"
10 loops, best of 3: 14.6 usec per loop

Proposed patch makes it automatically for user. It unrolls and vectorize the 
loop, and decreases iterating overhead 1000 times:

$ ./python -m timeit -s "x=10"  "x+x"
1000 loops, best of 3: 0.141 usec per loop

An user gets precision value without explicit cumbersome repeating.

--
components: Library (Lib)
files: timeit_unroll_loops.patch
keywords: patch
messages: 223185
nosy: georg.brandl, haypo, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Decrease iterating overhead it timeit
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file35966/timeit_unroll_loops.patch

___
Python tracker 

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



[issue21955] ceval.c: implement fast path for integers with a single digit

2014-07-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Confirmed speed up about 20%. Surprisingly it affects even integers outside of 
the of preallocated small integers (-5...255).

Before:

$ ./python -m timeit -s "x=10"  "x+x"
1000 loops, best of 3: 0.143 usec per loop
$ ./python -m timeit -s "x=1000"  "x+x"
100 loops, best of 3: 0.247 usec per loop

After:

$ ./python -m timeit -s "x=10"  "x+x"
1000 loops, best of 3: 0.117 usec per loop
$ ./python -m timeit -s "x=1000"  "x+x"
100 loops, best of 3: 0.209 usec per loop

All measures are made with modified timeit (issue21988).

--

___
Python tracker 

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



[issue21988] Decrease iterating overhead in timeit

2014-07-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
title: Decrease iterating overhead it timeit -> Decrease iterating overhead in 
timeit

___
Python tracker 

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



[issue21988] Decrease iterating overhead in timeit

2014-07-16 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Looks good, but I think it is better to have an "unroll" option rather than do 
it automatically. I'm okay with the default being to unroll, but sometimes I 
want to compare the speed between different versions of Python, and having 
unroll=False to ensure the same behaviour between versions would be good.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue16237] bdist_rpm SPEC files created with distutils may be distro specific

2014-07-16 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks Slavek. That means this bug doesn't affect RHEL 7 or CentOS 7, and if it 
affects the Python 3 software collections on RHEL/CentOS 6, we can potentially 
deal with it on the collection side of things.

Accordingly, closing this as a problem for downstream to deal with.

Thanks for the prompt, Mark.

--
resolution:  -> wont fix
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue21965] Add support for Memory BIO to _ssl

2014-07-16 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue21927] BOM appears in stdin when using Powershell

2014-07-16 Thread Jason R. Coombs

Jason R. Coombs added the comment:

Here I use the british pound symbol to attempt to answer that question. I've 
disabled the environment variable PYTHONIOENCODING and not set any code page or 
loaded any other Powershell profile settings.

PS C:\Users\jaraco> echo £
£
PS C:\Users\jaraco> chcp
Active code page: 437
PS C:\Users\jaraco> echo £ | py -3 -c "import sys; 
print(repr(sys.stdin.read()))"
'?\n'
PS C:\Users\jaraco> chcp 65001
Active code page: 65001
PS C:\Users\jaraco> echo £ | py -3 -c "import sys; 
print(repr(sys.stdin.read()))"
'?\n'
PS C:\Users\jaraco> echo £ | py -3 -c "import sys; 
print(repr(sys.stdin.buffer.read()))"
b'?\r\n'

Curiously, it appears as if powershell is actually receiving a question mark 
from the pipe.

--

___
Python tracker 

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



[issue21965] Add support for Memory BIO to _ssl

2014-07-16 Thread Ezio Melotti

Changes by Ezio Melotti :


--
components: +Extension Modules
nosy: +ezio.melotti
stage:  -> patch review

___
Python tracker 

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



[issue21988] Decrease iterating overhead in timeit

2014-07-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Indeed, what's good for CPython may be quite annoying for e.g. a JIT-enabled 
Python implementation. I wonder what the PyPy developers think about this.

--
nosy: +alex, pitrou

___
Python tracker 

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



[issue21765] Idle: make 3.x HyperParser work with non-ascii identifiers.

2014-07-16 Thread Martin v . Löwis

Martin v. Löwis added the comment:

LGTM

--

___
Python tracker 

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



[issue21927] BOM appears in stdin when using Powershell

2014-07-16 Thread STINNER Victor

STINNER Victor added the comment:

Please use ascii() instead of repr() in your test to identify who
replaces characters with question marks.

--

___
Python tracker 

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



[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I agree with Claudiu. IDLE should pickle with a private dispatch_table.

--
nosy: +loewis

___
Python tracker 

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



[issue21927] BOM appears in stdin when using Powershell

2014-07-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Bytes repr doesn't contains non-ascii characters, therefore Python is actually 
receiving a question mark from the pipe.

What are results of following commands?

py -3 -c "import sys; sys.stdout.buffer.write(bytes(range(128, 256)))"

py -3 -c "import sys; sys.stdout.buffer.write(bytes(range(128, 256)))" | py -3 
-c "import sys; b = sys.stdin.buffer.read(); print(len(b), b)"

--

___
Python tracker 

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



[issue21989] Missing (optional) argument `start` and `end` in documentation for list.index

2014-07-16 Thread SylvainDe

New submission from SylvainDe:

>From :

https://docs.python.org/2/tutorial/datastructures.html and
https://docs.python.org/3.4/tutorial/datastructures.html (and all other 
versions) :


list.index(x)

Return the index in the list of the first item whose value is x. It is 
an error if there is no such item.


>From `help(list)` :


 |  index(...)
 |  L.index(value, [start, [stop]]) -> integer -- return first index of 
value.
 |  Raises ValueError if the value is not present.


Thus, second and third parameter are undocumented.

--
assignee: docs@python
components: Documentation
files: list_index_start_end.patch
keywords: patch
messages: 223195
nosy: SylvainDe, docs@python
priority: normal
severity: normal
status: open
title: Missing (optional) argument `start` and `end` in documentation for 
list.index
type: enhancement
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file35967/list_index_start_end.patch

___
Python tracker 

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



[issue13023] argparse should allow displaying argument default values in addition to setting a formatter class

2014-07-16 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy: +paul.j3
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue9390] Error in sys.excepthook on windows when redirecting output of the script

2014-07-16 Thread Zachary Ware

Zachary Ware added the comment:

This appears to me to be a well-documented Windows bug with a clear, documented 
fix, and I am not able to reproduce it so I'm not sure if it's even still 
relevant.  Closing the issue.

--
resolution:  -> third party
stage:  -> resolved
status: open -> closed
versions:  -Python 2.6

___
Python tracker 

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



[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread ppperry

Changes by ppperry :


--
components: +Windows

___
Python tracker 

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



[issue12284] argparse.ArgumentParser: usage example option

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

@Jonas do you wish to follow up on this?

--
nosy: +BreamoreBoy, paul.j3

___
Python tracker 

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



[issue9399] Provide a 'print' action for argparse

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

@Paul what is your take on this, other opinions seem positive?

--
nosy: +BreamoreBoy, paul.j3
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue21765] Idle: make 3.x HyperParser work with non-ascii identifiers.

2014-07-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8b3f7aecdf85 by Tal Einat in branch '3.4':
Issue #21765: Add support for non-ascii identifiers to HyperParser
http://hg.python.org/cpython/rev/8b3f7aecdf85

New changeset 73a8c614af4d by Tal Einat in branch 'default':
Issue #21765: Add support for non-ascii identifiers to HyperParser
http://hg.python.org/cpython/rev/73a8c614af4d

--
nosy: +python-dev

___
Python tracker 

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



[issue16283] ctypes.util.find_library does not find all DLLs anymore

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

Works fine for me.

Python build: 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 
bit (Intel)]
Path 'C:\Windows\system32' exists in $PATH: True
File 'C:\Windows\system32\acledit.dll' exists: True
ctypes says for 'acledit.dll': C:\Windows\system32\acledit.dll
ctypes says for 'acledit': C:\Windows\system32\acledit.dll

--
components: +Windows
nosy: +BreamoreBoy

___
Python tracker 

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



[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread Claudiu Popa

Claudiu Popa added the comment:

Maybe something like the attached patch. It doesn't have tests, though, I 
didn't find any tests for the idlelib.rpc anyway.

--
keywords: +patch
Added file: http://bugs.python.org/file35968/idlelib.patch

___
Python tracker 

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



[issue21765] Idle: make 3.x HyperParser work with non-ascii identifiers.

2014-07-16 Thread Tal Einat

Tal Einat added the comment:

Fix committed to 3.4 and merged to default. (My first commit!)

Not back-porting this to 2.7 despite PEP 434, because support for non-ASCII 
identifiers only exists in 3.x.

Close this issue as fixed!

--

___
Python tracker 

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



[issue16892] Windows bug picking up stdin from a pipe

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

@Robert we're sorry about the delay in getting back to you.  Sorry Windows 
gurus this is over my head :(

--
nosy: +BreamoreBoy, 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



[issue21815] imaplib truncates some untagged responses

2014-07-16 Thread R. David Murray

R. David Murray added the comment:

Just to make sure I understand: the issue is that gmail may produce flags with 
[] in them, and imaplib currently fails to process such flags when it receives 
them from gmail?  

In principle I think we would not want to allow imaplib to be used to create 
such flags unless the user specifies some sort of "I want to violate the RFC" 
flag (which they might want to do, for example, to run tests against gmail :)  
But currently it looks like it can?  (I haven't looked at this in enough detail 
to be sure.)  If that's true we probably have to continue to allow it for 
backward compatibility reasons, but we should document the RFC violation and 
possible consequences (an IMAP server rejecting such flags).

--

___
Python tracker 

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



[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Instead of copying dispatch_table, use ChainMap.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue21931] Nonsense errors reported by msilib.FCICreate for bad argument

2014-07-16 Thread R. David Murray

R. David Murray added the comment:

mslib doesn't have many tests, but it looks like it would be easy enough to add 
one for this?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue21815] imaplib truncates some untagged responses

2014-07-16 Thread Rafał Stożek

Rafał Stożek added the comment:

Yeah, basically. The flags with [] characters are added to gmail (in my
case) by OtherInbox's Organizer app. I contacted them but haven't heard
back yet.

On Wed, Jul 16, 2014 at 4:07 PM, R. David Murray 
wrote:

>
> R. David Murray added the comment:
>
> Just to make sure I understand: the issue is that gmail may produce flags
> with [] in them, and imaplib currently fails to process such flags when it
> receives them from gmail?
>
> In principle I think we would not want to allow imaplib to be used to
> create such flags unless the user specifies some sort of "I want to violate
> the RFC" flag (which they might want to do, for example, to run tests
> against gmail :)  But currently it looks like it can?  (I haven't looked at
> this in enough detail to be sure.)  If that's true we probably have to
> continue to allow it for backward compatibility reasons, but we should
> document the RFC violation and possible consequences (an IMAP server
> rejecting such flags).
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread Claudiu Popa

Claudiu Popa added the comment:

Thanks, Serhiy.

--
Added file: http://bugs.python.org/file35969/issue21986.patch

___
Python tracker 

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



[issue21990] saxutils defines an inner class where a normal one would do

2014-07-16 Thread Alex Gaynor

New submission from Alex Gaynor:

This makes things slower than they need to be (yes, even on CPython :-)), and 
is slightly confusing since usually inner classes are only used when a closure 
is needed.

Attached patch simply moves the class definition.

--
components: Library (Lib)
files: sax.diff
keywords: patch
messages: 223209
nosy: alex
priority: normal
severity: normal
status: open
title: saxutils defines an inner class where a normal one would do
versions: Python 2.7
Added file: http://bugs.python.org/file35970/sax.diff

___
Python tracker 

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



[issue12806] argparse: Hybrid help text formatter

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

Apparently #13923 is related to this.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue21991] The new email API should use MappingProxyType instead of returning new dicts.

2014-07-16 Thread R. David Murray

New submission from R. David Murray:

There are a few places in the new email API where dicts are returned containing 
what is conceptually static information.  Currently this is done by returning a 
copy of the dict from the object, so that user code modifying the dict won't 
break the object invariants.  It would be better to change these to 
MappingProxyType objects instead, before the API moves out of provisional 
status.

This issue is mostly a note to myself, since I'm the most likely to be able to 
figure out which places in the code need changing, but if anyone else wants to 
look at it feel free, since it will probably be a while before I get to it.

--
components: email
keywords: easy
messages: 223211
nosy: barry, r.david.murray
priority: normal
severity: normal
stage: needs patch
status: open
title: The new email API should use MappingProxyType instead of returning new 
dicts.
type: behavior
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



[issue13923] new formatter for argparse

2014-07-16 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy: +paul.j3
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue21988] Decrease iterating overhead in timeit

2014-07-16 Thread Alex Gaynor

Alex Gaynor added the comment:

I think this is likely to make timeit less representative of how code actually 
performs in the real world on systems with a JIT. This is because of the cost 
of sequential operations is not strictly "additive" on PyPy.

If you have statements `a` and `b`, and you run `a; b` on PyPy, the performance 
of `a; b` is usually faster than the sum of `a`, `b`, assuming they are not 
100% independent.

This is because the JIT will be able to remove type checks that were already 
performed. Since this just repeats the same statement, the cost of the unrolled 
iterations beyond the first will be massively lower in many cases, producing 
confusing results.

--

___
Python tracker 

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



[issue21988] Decrease iterating overhead in timeit

2014-07-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks, then I guess I'm -1 on the patch.

--

___
Python tracker 

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



[issue21955] ceval.c: implement fast path for integers with a single digit

2014-07-16 Thread Zach Byrne

Zach Byrne added the comment:

Well, dont' I feel silly. I confirmed both my regression and the inline speedup 
using the benchmark Victor added. I wonder if I got my binaries backwards in my 
first test...

--

___
Python tracker 

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



[issue21988] Decrease iterating overhead in timeit

2014-07-16 Thread Armin Rigo

Armin Rigo added the comment:

The opposite argument might be relevant too: in some cases, a tracing JIT 
compiler seeing a long block of code might perform artificially worse.  If each 
repeated line creates a branching path with two outcomes of roughly equal 
likeliness, then if the line is repeated 20 times, the JIT will need to compile 
2**20 different paths before it has fully warmed up.  In practice, it will 
never fully warm up and will run with the constant huge overhead of finding and 
compiling more paths.

--
nosy: +arigo

___
Python tracker 

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



[issue21988] Decrease iterating overhead in timeit

2014-07-16 Thread Armin Rigo

Armin Rigo added the comment:

...but I don't think PyPy should be by itself a good enough reason to reject 
this patch.  It would be fine if timeit detects which interpreter it runs on, 
and only tries to unroll on CPython, for example.

--

___
Python tracker 

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



[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-16 Thread Andy Maier

Andy Maier added the comment:

Uploaded v9 of the patch for 3.4 and default.

It reflects Marc's comment, plus the result of the recent discussion on 
python-dev since v8 of th epatch, up to 2014-07-15 (subject: == on object tests 
identity in 3.x).

-> Please review the patch.

--
Added file: http://bugs.python.org/file35971/issue12067-expressions-py34_v9.diff

___
Python tracker 

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



[issue21899] Futures are not marked as completed

2014-07-16 Thread Sebastian Kreft

Sebastian Kreft added the comment:

After more testing I finally found that in fact the process is not being 
killed. That means that there is no problem with the futures. But instead it is 
probably related with subprocess deadlocking, as the problematic process does 
not consume any CPU.

Sorry for the false report.

--
nosy:  -bquinlan
status: open -> closed

___
Python tracker 

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



[issue20319] concurrent.futures.wait() can block forever even if Futures have completed

2014-07-16 Thread Sebastian Kreft

Sebastian Kreft added the comment:

Disregard the last messages, It seems to be a deadblocking due to subprocess.

--

___
Python tracker 

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



[issue11945] Adopt and document consistent semantics for handling NaN values in containers

2014-07-16 Thread Andy Maier

Changes by Andy Maier :


--
nosy: +andymaier

___
Python tracker 

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



[issue10991] trace fails when test imported a temporary file

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

Knowing the platform this occurred on would be useful, but given the age do we 
care?

--
nosy: +BreamoreBoy
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



[issue16961] No regression tests for -E and individual environment vars

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

Consider yourself reminded :)

--
nosy: +BreamoreBoy
versions: +Python 3.4, Python 3.5 -Python 3.3

___
Python tracker 

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



[issue13041] argparse: terminal width is not detected properly

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

@Paul the attached patch is extremely simple and follows the work on #13609.  
Is it okay with you if the patch was committed?

--
nosy: +BreamoreBoy, paul.j3

___
Python tracker 

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



[issue14149] argparse: Document how to use argument names that are not Python identifiers

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

#11076 was closed as a duplicate of #8982 which was closed as fixed so can this 
also be closed as a duplicate?

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue15994] memoryview to freed memory can cause segfault

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

Can someone follow this up noting it refers to #15903.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue15903] Make rawiobase_read() read directly to bytes object

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

Please note this is also referred to from #15994.

--
nosy: +BreamoreBoy
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



[issue16965] 2to3 should rewrite execfile() to open in 'rb' mode

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

Can we have a response to this please.

--
nosy: +BreamoreBoy, benjamin.peterson
type:  -> behavior
versions: +Python 3.5 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue21645] asyncio: Race condition in signal handling on FreeBSD

2014-07-16 Thread STINNER Victor

STINNER Victor added the comment:

"A solution would be to schedule the callback in the event loop. Since Python 
3.3, the C signal handler writes the signal number, which should be enough to 
find and schedule the Python callback."

I wrote a patch implementing this idea to fix the issue:
https://code.google.com/p/tulip/issues/detail?id=192

--

___
Python tracker 

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



[issue4972] context management support in imaplib, smtplib, ftplib

2014-07-16 Thread Berker Peksag

Berker Peksag added the comment:

Updated Serhiy's patch to 3.5. I also added a whatsnew entry.

--
Added file: http://bugs.python.org/file35972/issue4972_imaplib.diff

___
Python tracker 

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



[issue4972] context management support in imaplib, smtplib, ftplib

2014-07-16 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue21989] Missing (optional) argument `start` and `end` in documentation for list.index

2014-07-16 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +ezio.melotti
versions:  -Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue9399] Provide a 'print' action for argparse

2014-07-16 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



[issue21992] New AST node Else() should be introduced

2014-07-16 Thread Igor Bronshteyn

New submission from Igor Bronshteyn:

Quoting Collin Winter:
"I'd like there to be an Else() node for If.orelse, While.orelse, etc. My 
motivation is that I need the lineno and col_offset values of the "else" 
statement for a code-coverage utility; as it is, I have to find the last lineno 
of the if/while/etc suite and the first lineno of the "else" suite and then 
search between those two for the "else" statement."

from: http://bugs.python.org/issue1659410
Lack of position for "else" token hampers implementing of even simple static 
analysis checker that calculates NCNB (non-comment non-blank) lines (e.g. in a 
function).

--
components: Interpreter Core
messages: 223229
nosy: Igor.Bronshteyn
priority: normal
severity: normal
status: open
title: New AST node Else() should be introduced
type: enhancement
versions: Python 2.7

___
Python tracker 

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



[issue21992] New AST node Else() should be introduced

2014-07-16 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo, nedbat

___
Python tracker 

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



[issue21163] asyncio doesn't warn if a task is destroyed during its execution

2014-07-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6d5a76214166 by Victor Stinner in branch '3.4':
Issue #21163, asyncio: Ignore "destroy pending task" warnings for private tasks
http://hg.python.org/cpython/rev/6d5a76214166

New changeset fbd3e9f635b6 by Victor Stinner in branch 'default':
(Merge 3.4) Issue #21163, asyncio: Ignore "destroy pending task" warnings for
http://hg.python.org/cpython/rev/fbd3e9f635b6

--

___
Python tracker 

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



[issue21988] Decrease iterating overhead in timeit

2014-07-16 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On Wed, Jul 16, 2014 at 02:49:31PM +, Armin Rigo wrote:
> ...but I don't think PyPy should be by itself a good enough reason to 
> reject this patch.  It would be fine if timeit detects which 
> interpreter it runs on, and only tries to unroll on CPython, for 
> example.

I would *much* rather a parameter to timeit which controls whether or 
not to unroll, rather than timeit trying to guess whether you want it to 
unroll or not. PyPy can default to off, CPython to on, and other 
implementations can choose whichever default makes sense for them.

--

___
Python tracker 

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



[issue21163] asyncio doesn't warn if a task is destroyed during its execution

2014-07-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e4fe6706b7b4 by Victor Stinner in branch '3.4':
Issue #21163: Fix "destroy pending task" warning in test_wait_errors()
http://hg.python.org/cpython/rev/e4fe6706b7b4

New changeset a627b23f57d4 by Victor Stinner in branch 'default':
(Merge 3.4) Issue #21163: Fix "destroy pending task" warning in 
test_wait_errors()
http://hg.python.org/cpython/rev/a627b23f57d4

--

___
Python tracker 

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



[issue21163] asyncio doesn't warn if a task is destroyed during its execution

2014-07-16 Thread STINNER Victor

STINNER Victor added the comment:

Ok, I fixed the last warnings emitted in unit tests ran in debug mode. I close 
the issue.

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



[issue21985] test_asyncio prints some junk

2014-07-16 Thread STINNER Victor

STINNER Victor added the comment:

I fixed last warnings in tests ran in debug mode. I close the issue.

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



[issue21247] test_asyncio: test_subprocess_send_signal hangs on Fedora builders

2014-07-16 Thread STINNER Victor

STINNER Victor added the comment:

Here is a patch implementing a basic synchronization between the parent and the 
child processing, to wait until the child is sleeping.

Can you please try this patch?

If it doesn't work, we might add a small sleep of 500 ms after the readline().

--
keywords: +patch
Added file: http://bugs.python.org/file35973/test_send_signal.patch

___
Python tracker 

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



[issue10048] urllib.request documentation confusing

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

@Senthil do you still intend to run with this or could somebody else pick it up?

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue17026] pdb frames accessible after the termination occurs on uncaught exception

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

Nosy list set according to experts page.

--
nosy: +BreamoreBoy, georg.brandl
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue13540] Document the Action API in argparse

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

@Paul what is your opinion of this documentation patch?

--
nosy: +BreamoreBoy, paul.j3
versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue21990] saxutils defines an inner class where a normal one would do

2014-07-16 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue21990] saxutils defines an inner class where a normal one would do

2014-07-16 Thread Alex Gaynor

Changes by Alex Gaynor :


--
keywords: +needs review

___
Python tracker 

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



[issue21815] imaplib truncates some untagged responses

2014-07-16 Thread Lita Cho

Lita Cho added the comment:

>
> R. David Murray added the comment:
>
> Just to make sure I understand: the issue is that gmail may produce flags
> with [] in them, and imaplib currently fails to process such flags when it
> receives them from gmail?
>
> This is correct. Gmail allows you to create flags with [], and the
Response_code regex doesn't process them properly.

> In principle I think we would not want to allow imaplib to be used to
> create such flags unless the user specifies some sort of "I want to violate
> the RFC" flag (which they might want to do, for example, to run tests
> against gmail :)  But currently it looks like it can?  (I haven't looked at
> this in enough detail to be sure.)  If that's true we probably have to
> continue to allow it for backward compatibility reasons, but we should
> document the RFC violation and possible consequences (an IMAP server
> rejecting such flags).
>
> Yes, currently we can. I've posted the code in order to do this. This is
basically the result.

>>> first_id = msg_ids.split()[0]
>>> mail.store(first_id, "+FLAGS", "[test]")
('OK', [b'1 (FLAGS (\\Seen Answered [test] NotJunk $NotJunk [Brackets]
[testing2]))'])

However, I would think it would be the server's job to uphold this rule,
not the library. The server should return with a BAD response, but right
now, Gmail allows you to do this.

Should we throw a warning in the "store" method? Otherwise, I can update
the documenation in the "store" method stating that having '[]' is allowed
but violates the RFC protocol.

> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue21927] BOM appears in stdin when using Powershell

2014-07-16 Thread eryksun

eryksun added the comment:

> PS C:\Users\jaraco> echo £ | py -3 -c "import sys; 
> print(repr(sys.stdin.buffer.read()))"
> b'?\r\n'

> Curiously, it appears as if powershell is actually receiving 
> a question mark from the pipe.

PowerShell calls ReadConsoleW to read the console input buffer, i.e. it reads 
"£" as a wide character from the command line. The default encoding when 
writing to the pipe should be ASCII [*]. If that's the case it explains the 
question mark that Python reads from stdin. It's the default replacement 
character (WC_DEFAULTCHAR) used by WideCharToMultiByte. 

[*] 
http://blogs.msdn.com/b/powershell/archive/2006/12/11/outputencoding-to-the-rescue.aspx

You can change PowerShell's output encoding to match the console:

$OutputEncoding = [Console]::OutputEncoding

If the console codepage is 65001, the above is equivalent to setting 

$OutputEncoding = [System.Text.Encoding]::UTF8

http://msdn.microsoft.com/en-us/library/system.text.encoding.utf8

As Victor mentioned, this setting always writes a BOM, and under codepage 65001 
it actually writes 2 BOMs (at least in PowerShell 2). Victor also mentioned 
that you can avoid the BOM by passing $False to the constructor:

$OutputEncoding = New-Object System.Text.UTF8Encoding($False)

http://msdn.microsoft.com/en-us/library/system.text.utf8encoding

There's still a BOM under codepage 65001, but maybe that's fixed in PowerShell 
3. 

I avoid setting the console to codepage 65001 anyway. ReadFile/WriteFile 
incorrectly return the number of characters read/written instead of the number 
of bytes because the call is actually handled by ReadConsoleA/WriteConsoleA. 
Maybe that's finally fixed in Windows 8.

--
nosy: +eryksun

___
Python tracker 

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



[issue21988] Decrease iterating overhead in timeit

2014-07-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 16/07/2014 12:43, Steven D'Aprano a écrit :
>
> I would *much* rather a parameter to timeit which controls whether or
> not to unroll, rather than timeit trying to guess whether you want it to
> unroll or not. PyPy can default to off, CPython to on, and other
> implementations can choose whichever default makes sense for them.

I think it is overkill. Apart from rather silly microbenchmarks, there 
isn't much point in adding the loop unrolling facility. In real world, 
even cheap operations such as "x = x + 1" will be surrounded by less 
cheap operations, so if an improvement cannot yield tangible benefits 
inside a simple for loop, then it doesn't deserve to be committed.

--

___
Python tracker 

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



[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

There is no unittest module for rpc yet.

Should the pickle test include a test that pickling a code object fails, and 
with the proper exception?  Is ppperry correct about PicklingError?

Chainmap is new in 3.3 so 2.7 would need the copy version of the patch.

--
components: +IDLE -Library (Lib), Windows

___
Python tracker 

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



[issue17057] Data model documentation grammar

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

I'm not particularly interested in 2.7 documentation but is there anybody out 
there who could review this please.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

ppperry: Component Windows (or Macintosh) means Windows (or Mac) specific.  The 
rpc code is general to all systems.

--

___
Python tracker 

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



[issue21765] Idle: make 3.x HyperParser work with non-ascii identifiers.

2014-07-16 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> fixed
stage: test needed -> 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



[issue16509] sqlite3 docs do not explain check_same_thread

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

@Daniel could you provide a patch for this?

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue21935] Implement AUTH command in smtpd.

2014-07-16 Thread Milan Oberkirch

Milan Oberkirch added the comment:

Done. I added the keyarg 'enable_AUTH' and two abstract methods to the server:
process_auth(user, password) for authentication and accept_recipient(user, 
mailfrom, rcptto) for authorization.

--
Added file: http://bugs.python.org/file35974/smtpd_AUTH_full.patch

___
Python tracker 

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



[issue17101] __main__.py Multiprocessing on Windows

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

Is it possible to backport the fix from #10845 to 2.7?  Is it actually worth 
doing?

--
components: +Library (Lib)
nosy: +BreamoreBoy
versions:  -Python 2.6

___
Python tracker 

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



[issue10818] pydoc: Remove old server and tk panel

2014-07-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2e578b80c2f3 by Zachary Ware in branch '3.4':
Remove Tools/scripts/pydocgui.pyw.
http://hg.python.org/cpython/rev/2e578b80c2f3

--

___
Python tracker 

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



[issue21955] ceval.c: implement fast path for integers with a single digit

2014-07-16 Thread Case Van Horsen

Changes by Case Van Horsen :


--
nosy: +casevh

___
Python tracker 

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



[issue20394] Coverity complains on audioop

2014-07-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Christian, what about 2.7?

--
status: open -> pending
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



[issue13850] Summary tables for argparse add_argument options

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

At a quick glance the patch looks okay to me so as there's been a lot of 
positive comments can we have a formal patch review please.

--
nosy: +BreamoreBoy
versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue15119] ctypes mixed-types bitfield layout nonsensical; doesn't match compiler.

2014-07-16 Thread Olaf Hartmann

Olaf Hartmann added the comment:

I just run into this issue, so i'll bump it with another test case:

import ctypes

class Struct(ctypes.Structure):
_fields_ = [
("uint8_0", ctypes.c_uint8, 8),
("uint8_1", ctypes.c_uint8, 8),
("uint16_0", ctypes.c_uint16, 1),
("uint16_1", ctypes.c_uint16, 15),
]

for f in Struct._fields_:
print f[0], getattr(Struct, f[0])

> python bitfield.py 
uint8_0 
uint8_1 
uint16_0 
uint16_1 


Originally tested with Python 2.7.3, but also confirmed with later versions.

Is there any workaround by specifying ofs and bits manually?

--
nosy: +wbu
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



[issue17243] The changes made for issue 4074 should be documented

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

Presumably the responsibility for this lies with the person who made the 
changes for #4074 ?

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue17750] allow the testsuite to run in the installed location

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

How do we stand with eight outstanding issues here?

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue21815] imaplib truncates some untagged responses

2014-07-16 Thread R. David Murray

R. David Murray added the comment:

Postel's Law says: be conservative in what you do, be liberal in what you 
accept from others.  So the client should not violate the RFC when sending data 
to the server.  The server, on the other hand, by that law could accept "dirty" 
data if it can do something reasonable with it...except that in general the 
IMAP RFC in particular says "don't do that".  IMAP servers are supposed to be 
IMAP RFC sticklers, even when accepting input.  So gmail is broken for some 
definition of broken, and so is imaplib.

Since the code has been this way for a long time, and gmail does in fact accept 
it, I think a doc warning about []s violating the RFC should be sufficient; a 
warning would probably just be annoying to little real benefit.

--
versions: +Python 3.4, Python 3.5

___
Python tracker 

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



[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread Claudiu Popa

Claudiu Popa added the comment:

TypeError is raised only in Python 2, in Python 3 it's PicklingError.

--

___
Python tracker 

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



[issue18144] FD leak in urllib2

2014-07-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> test_urllib2net is triggering a ResourceWarning

___
Python tracker 

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



[issue15119] ctypes mixed-types bitfield layout nonsensical; doesn't match compiler.

2014-07-16 Thread Olaf Hartmann

Olaf Hartmann added the comment:

Answering my own question, here is a workaround, that also produces reasonable 
results for the original test case. Basically just inserting an empty struct:

import ctypes

class Empty(ctypes.Structure):
_fields_ = []

class Struct(ctypes.Structure):
_fields_ = [
("uint8_0", ctypes.c_uint8, 8),
("uint8_1", ctypes.c_uint8, 8),
("_ignore", Empty),
("uint16_0", ctypes.c_uint16, 1),
("uint16_1", ctypes.c_uint16, 15),
]

for f in Struct._fields_:
print f[0], getattr(Struct, f[0])

> python bitfield.py
uint8_0 
uint8_1 
_ignore 
uint16_0 
uint16_1 

--

___
Python tracker 

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



[issue19524] ResourceWarning when urlopen() forgets the HTTPConnection object

2014-07-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM. Do you want to write a test for the case when an invalid response is 
received?

--
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



  1   2   >