[issue3982] support .format for bytes

2013-10-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue19201] lzma and 'x' mode open

2013-10-11 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

Is there any reason why the order of characters matters here?
builtins.open() supports them in any order ("br"=="rb", "bw"=="wb", "ba"=="ab", 
"bx"=="xb").

--
nosy: +Arfrever

___
Python tracker 

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



[issue19222] gzip and 'x' mode open

2013-10-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue19223] bz2 and 'x' mode open

2013-10-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue19201] lzma and 'x' mode open

2013-10-11 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

Also tarfile.open() could support "x" mode.

--

___
Python tracker 

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



[issue18233] SSLSocket.getpeercertchain()

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Sorry for the incorrect answer. I just noticed there was a test in the patch!
Further looking at it, I notice the new function is returning a tuple. Wouldn't 
it be better to return a list here?

--

___
Python tracker 

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



[issue18233] SSLSocket.getpeercertchain()

2013-10-11 Thread Dustin Oprea

Dustin Oprea added the comment:

My two-cents is to leave it a tuple (why not?).



Dustin

--

___
Python tracker 

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



[issue19224] Make hash(None) consistent among processes

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Is this something we actually want to support officially? Many other types have 
non-repeatable hashes, e.g.:

$ PYTHONHASHSEED=1 python3 -c "print(hash((lambda: 0)))"
8771754605115
$ PYTHONHASHSEED=1 python3 -c "print(hash((lambda: 0)))"
8791504743739
$ PYTHONHASHSEED=1 python3 -c "print(hash((lambda: 0)))"
8788491320379
$ PYTHONHASHSEED=1 python3 -c "print(hash((lambda: 0)))"
8792628055611

--
nosy: +pitrou, tim.peters

___
Python tracker 

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



[issue19218] Use of MutableMapping in os module slows down interpreter startup

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

-1 on such hacks. I much prefer the _abcoll approach.

--
nosy: +pitrou

___
Python tracker 

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



[issue19218] Use of MutableMapping in os module slows down interpreter startup

2013-10-11 Thread STINNER Victor

STINNER Victor added the comment:

The collections module is loaded by the io module. You removed "from 
collections.abc import MutableMapping" from os.py. To be useful, you have also 
to rewrite the whole io module to remove all references to the collections.abc 
module, right?

--
nosy: +haypo

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Why adding ASCII strings, whereas you can add Latin1 (UCS1, U+-U+00FF)
> strings?

Reasons:
- most strings in pyc files are pure ASCII (it's like 99% in the stdlib)
- unmarshalling ASCII strings is faster: you can pass 127 to PyUnicode_New 
without scanning for non-ASCII chars

The aim here is to optimize the common cases. There is no reason to further 
complicate the code for rare cases.

--

___
Python tracker 

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



[issue19224] Make hash(None) consistent among processes

2013-10-11 Thread STINNER Victor

STINNER Victor added the comment:

In the same Python version, hash(None) always give me the same value. I cannot 
reproduced your issue on Linux, I tested Python 2.7, 3.3 and 3.4.

$ python2.7 -c "print(hash(None))"
17171842026
$ python2.7 -c "print(hash(None))"
17171842026
$ python2.7 -c "print(hash(None))"
17171842026

$ python3.3 -c "print(hash(None))"
17171873465
$ python3.3 -c "print(hash(None))"
17171873465
$ python3.3 -c "print(hash(None))"
17171873465

$ python3.4 -c "print(hash(None))"
588812
$ python3.4 -c "print(hash(None))"
588812
$ python3.4 -c "print(hash(None))"
588812

--
nosy: +haypo

___
Python tracker 

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



[issue19224] Make hash(None) consistent among processes

2013-10-11 Thread STINNER Victor

STINNER Victor added the comment:

"It's wired and make difficulty for distributed systems partitioning data 
according hash of keys if the system wants the keys support None."

How you handle the randomization of hash(str)? (python2.7 -R, enabled by 
default in Python 3.3).

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread STINNER Victor

STINNER Victor added the comment:

> unmarshalling ASCII strings is faster: you can pass 127 to PyUnicode_New 
> without scanning for non-ASCII chars

Oh, I forgot this pain of the PEP 393. Don't tell me more, it's enough :-)

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

I imagine that the test for ASCII is cheaper.  It corresponds to the new 
compact internal unicode representation (one byte characters).

This looks fine.  Can you quantify where the speedup comes from? Reading the 
code, I see we now maintain a small internal buffer in the file object, rather 
than using stack allocation at the call sites.  It is unclear to me how this 
saves memory, since the amount of memory copying should be the same.  Could it 
be that the speedup is all due to the native 8 bit support for unicode?

Have you looked at providing a special opcode for a few other magic numbers?(We 
have that in our own custom marshal format)
Some very common values are:
empty tuple
0
1

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> This looks fine.  Can you quantify where the speedup comes from?

>From all changes, but mainly the ASCII special-casing and the new
buffering.

> Reading the code, I see we now maintain a small internal buffer in
> the file object, rather than using stack allocation at the call
> sites.  It is unclear to me how this saves memory, since the amount
> of memory copying should be the same.

No, memory copying is suppressed in many cases.

> Have you looked at providing a special opcode for a few other magic
> numbers?(We have that in our own custom marshal format)
> Some very common values are:
> empty tuple
> 0
> 1

It shouldn't be useful since marshal memoizes them anyway: only the
first appearance in a pyc file would benefit.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> > Reading the code, I see we now maintain a small internal buffer in
> > the file object, rather than using stack allocation at the call
> > sites.  It is unclear to me how this saves memory, since the amount
> > of memory copying should be the same.
> 
> No, memory copying is suppressed in many cases.

To clarify: the import logic uses marshal.loads(), not marshal.load().
So the aim is really to speed up unmarshalling from memory.

--

___
Python tracker 

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



[issue19225] lack of PyExc_BufferError doc

2013-10-11 Thread hiroaki itoh

New submission from hiroaki itoh:

http://docs.python.org/2.7/c-api/exceptions.html#standard-exceptions

Python2.7 (at least 2.7.5) has PyExc_BufferError, but the document does not 
tell it.

--
assignee: docs@python
components: Documentation
messages: 199458
nosy: docs@python, xwhhsprings
priority: normal
severity: normal
status: open
title: lack of PyExc_BufferError doc
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

Right, in this case, memory copying is avoided.

Regarding the memoing of 0, empty tuple, etc:
Special opcode may still benefit because it takes only one byte.  So, you save 
four bytes for each such case.  I think it might be worth investigating.

--

___
Python tracker 

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



[issue19225] lack of PyExc_BufferError doc

2013-10-11 Thread hiroaki itoh

hiroaki itoh added the comment:

also:

* GeneratorExit
* StopIteration
* VMSError (#ifdef __VMS)
* UnboundLocalError
* IndentationError
* TabError
* UnicodeError
* UnicodeDecodeError
* UnicodeEncodeError
* UnicodeTranslateError

* Warning;
* UserWarning;
* DeprecationWarning;
* PendingDeprecationWarning;
* SyntaxWarning;
* RuntimeWarning;
* FutureWarning;
* ImportWarning;
* UnicodeWarning;
* BytesWarning;

Or, erase `For completeness, here are all the variables' statement...?

--

___
Python tracker 

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



[issue19210] Unicode Objects in Tuples

2013-10-11 Thread Martin v . Löwis

Martin v. Löwis added the comment:

It's at https://mail.python.org/mailman/listinfo/python-list

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> - unmarshalling ASCII strings is faster: you can pass 127 to PyUnicode_New 
> without scanning for non-ASCII chars

You should ensure that loaded bytes are ASCII-only. Otherwise broken or 
malicious marshalled data will compromise you program. Decoding UTF-8 is so 
fast as decoding ASCII (with checks) and is almost so fast as memcpy.

As for output, we could use cached UTF-8 representation of string (always 
exists for ASCII only strings) before calling PyUnicode_AsUTF8String().

I'm good with buffering and codes for short strings and tuples (I have not 
examined a code closely yet), but special casing ASCII looks not so good to me.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread STINNER Victor

STINNER Victor added the comment:

"You should ensure that loaded bytes are ASCII-only. Otherwise broken or 
malicious marshalled data will compromise you program."

This is not new, see the red warning in marshal doc:

"""
Warning

The marshal module is not intended to be secure against erroneous or 
maliciously constructed data. Never unmarshal data received from an untrusted 
or unauthenticated source.
"""

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

We have to make two distinctions here:
1) Loading data and then running it. This is a bad idea if your data is not 
trusted.  This is what is meant by "marshal" being unsafe.
2) Loading data and then not running it.  This is perfectly fine, because 
marshal has _no side effects_ when loading.  Only actually _running_ untrusted 
data is what you should be careful about.  In fact, using 'marshal' as a cheap 
and fast pickler for builtin types is actually a good idea because it has no 
side effects like invoking code.  (and I think the comment you refer to should 
be revised to make this clear)

So, will simply load ASCII data that is, in fact, not ASCII data, destabilize 
your program in any way?  Or even crash it?  If that is true, then we have a 
problem.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread STINNER Victor

STINNER Victor added the comment:

"As for output, we could use cached UTF-8 representation of string (always 
exists for ASCII only strings) before calling PyUnicode_AsUTF8String()."

PyUnicode_AsEncodedString(v, "utf8", "surrogatepass") is expensive. I proposed 
an optimization for the pickle module, Antoine finished the work: see issue 
#15596. It's exactly what you suggest: reuse PyUnicode_AsUTF8String().

--

___
Python tracker 

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



[issue19217] Calling assertEquals for moderately long list takes too long

2013-10-11 Thread Michael Foord

Michael Foord added the comment:

Ouch. Looking.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> In fact, using 'marshal' as a cheap and fast pickler for builtin types
> is actually a good idea because it has no side effects like invoking
> code.

It's an unsupported use case. The marshal docs are quite clear:

"""Therefore, the Python maintainers reserve the right to modify
the marshal format in backward incompatible ways should the need
arise. If you’re serializing and de-serializing Python objects,
use the pickle module instead [...]"""

So, it's a "good idea" as long as you're willing to deal with the
consequences :-)

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread STINNER Victor

STINNER Victor added the comment:

marshal and pickle are unsafe, even without the patch attached to the issue. If 
you consider that it is an issue that should be fixed, please open a new issue. 
Antoine's patch doesn't make the module less secure, since it was already not 
secure :)

Loading untrusted data and executing untrusted code is not supported by Python. 
Many things should be fixed to support such use case, not only the marshal 
module. I'm interested by the topic (I wrote the pysandbox project, which is 
first try), but please discuss it elsewhere.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread STINNER Victor

STINNER Victor added the comment:

> please discuss it elsewhere.

Hum, I'm not sure that this word exist, I mean: somethere else :-)

--

___
Python tracker 

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



[issue19217] Calling assertEquals for moderately long list takes too long

2013-10-11 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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

"Therefore, the Python maintainers reserve the right to modify
the marshal format in backward incompatible ways"

sure, don't expect such things to survive version changes.  (Actually, they 
have been hitherto, and my version "3" I actually changed, to be so, the 
initial draft being unable to read version 2 data)
But for sending stuff over the wire, caching on disk, etc, its perfectly safe 
and super fast.  And what is more, the python developers (that's you and me) 
are super careful to never _crash_ the interpreter, no matter how broken any 
input data is.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

"Loading untrusted data ... is not supported by Python."
This is a pretty bold claim.  Is this, indeed, a fact?  (and yes, "elsewhere" 
is a word)

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

Anyway, whether or not Pyhon guarantees this and that wrt. "untrusted" is 
beside the point and offtopic, as Victor poitns out.

However:  We are, and have always been, careful to fail gracefully if we detect 
data corruption.  Never should the flipping of a bit on a file on the disk 
cause our program to crash.  It is fine when reading a corrupt file that an 
int(1) turns to int(2), or that we get an UnmarshalError when reading it, or 
that a "hello world" string turns to "hello $orld".  What is not good is if the 
reading of the corrupt string causes the interpreter to crash.

My knowledge of the new unicode internals is limited at best.  If you don't 
think, Antoine, that putting non-7-bit data into the supposedly 7 bit ascii 
unicode data can cause an actual crash, but at worst a corrupt string, then I'm 
quite happy, personally :)

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Ronald Oussoren

Changes by Ronald Oussoren :


--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> The marshal module is not intended to be secure against erroneous or 
> maliciously constructed data. Never unmarshal data received from an untrusted 
> or unauthenticated source.

Then we can simplify the marshal module by dropping all error handling: 
f.read() returned not bytes, read() returned too much data, EOF read where not 
expected, recursion limit exceeded, long/string/unicode/tuple/list/set size out 
of range, unnormalized long data, digit out of range in long, index list too 
large, invalid reference, unknown type code, NULL object in marshal data for 
set, UTF8 decoding errors, string to float converting errors, etc, etc. Sorry 
for sarcasm.

> It's exactly what you suggest: reuse PyUnicode_AsUTF8String().

Actually _PyUnicode_UTF8(). PyUnicode_AsUTF8String() creates UTF8 cache if it 
is not exists and this can be not desired. We could use this optimization in 
many other places, in particular in PyUnicode_AsUTF8String() itself.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Sorry for sarcasm.

Well, indeed, the sarcasm is undeserved here, if the interpreter cannot
crash because of the change.

> > It's exactly what you suggest: reuse PyUnicode_AsUTF8String().
> 
> Actually _PyUnicode_UTF8(). PyUnicode_AsUTF8String() creates UTF8
> cache if it is not exists and this can be not desired. We could use
> this optimization in many other places, in particular in
> PyUnicode_AsUTF8String() itself.

I don't understand how _PyUnicode_UTF8() can be used for *unmarshalling*.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

That said, I'll try out the patch with _PyUnicode_FromUCS1 instead of 
_PyUnicode_FromASCII, to see if it affects performance.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

Just for the record, I want to say that this is great stuff, Antoine!  It's 
great when this sort of stuff gets some attention.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> I don't understand how _PyUnicode_UTF8() can be used for *unmarshalling*.

I say about marshalling.

> That said, I'll try out the patch with _PyUnicode_FromUCS1 instead of 
> _PyUnicode_FromASCII, to see if it affects performance.

Could you try out the patch with PyUnicode_DecodeUTF8()? This will save you two 
opcodes and perhaps several lines of code.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

"This will save you two opcodes and perhaps several lines of code. "
Just bear in mind that without other changes, version 4 needs to be backwards 
compatible with version 3.
I ran into this when developing version 3.  The reason is that while the 
marshal format includes the version information in its header, it isn't 
actually verified on loading. IIRC.  You specify the expected format to the 
function, or something like that.  So, if you don't do this, you get errors 
when loading previously generated .pyc files.
Of course, we are free to fix that problem as well :)

--

___
Python tracker 

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



[issue3982] support .format for bytes

2013-10-11 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue13477] tarfile module should have a command line

2013-10-11 Thread Berker Peksag

Changes by Berker Peksag :


--
keywords: +needs review

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> > That said, I'll try out the patch with _PyUnicode_FromUCS1 instead
> > of _PyUnicode_FromASCII, to see if it affects performance.
> 
> Could you try out the patch with PyUnicode_DecodeUTF8()? This will
> save you two opcodes and perhaps several lines of code.

That would be a change in behaviour, since currently "surrogatepass"
is the error handler.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I ran into this when developing version 3.  The reason is that while
> the marshal format includes the version information in its header,
> it isn't actually verified on loading. IIRC.  You specify the
> expected format to the function, or something like that.  So, if you
> don't do this, you get errors when loading previously generated .pyc
> files.

Exactly (I also tried this :-)). The problem is the version number
is *outside* of the marshal format: e.g. it's in the pyc file header.
When freezing a module (see frozen.c), the version number isn't included.
So our freedom is quite limited here: we have to support legacy frozen
modules.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

How about adding a version opcode?  This is a backwards compatible change, and 
allows us to reject unsupported versions in the future, as long as they are not 
very old unsupported versions.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> "This will save you two opcodes and perhaps several lines of code. "
> Just bear in mind that without other changes, version 4 needs to be backwards 
> compatible with version 3.

I meant two of new proposed opcodes: TYPE_ASCII and TYPE_ASCII_INTERNED.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> That would be a change in behaviour, since currently "surrogatepass"
is the error handler.

I don't propose any change in behaviour.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I meant two of new proposed opcodes: TYPE_ASCII and
> TYPE_ASCII_INTERNED.

You cannot change the meaning of TYPE_UNICODE (it uses "surrogatepass").
Therefore, you have to use new opcodes with other semantics.

Besides, opcodes are cheap.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> You cannot change the meaning of TYPE_UNICODE (it uses "surrogatepass").
> Therefore, you have to use new opcodes with other semantics.

You don't need new semantic. Use old semantic. The set of ASCII encoded strings 
is a subset of valid UTF8 encoded strings, which is a subset of UTF8 encoded 
with "surrogatepass" strings.

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> > You cannot change the meaning of TYPE_UNICODE (it uses
> > "surrogatepass").
> > Therefore, you have to use new opcodes with other semantics.
> 
> You don't need new semantic. Use old semantic. The set of ASCII
> encoded strings is a subset of valid UTF8 encoded strings, which is
> a subset of UTF8 encoded with "surrogatepass" strings.

Sorry, I don't understand you.

--

___
Python tracker 

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



[issue19192] Move test_current_time from test_xmlrpc_net to test_xmlrpc

2013-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a4515186bf9c by R David Murray in branch 'default':
#19192: Give up on time.xmlrpc.com as an xmlrpc network test.
http://hg.python.org/cpython/rev/a4515186bf9c

--
nosy: +python-dev

___
Python tracker 

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



[issue19192] Move test_current_time from test_xmlrpc_net to test_xmlrpc

2013-10-11 Thread R. David Murray

R. David Murray added the comment:

Thanks, Vajrasky.  I simplified your test a bit further still.

It occurs to me that nowadays (unlike when the file was written), we can use 
resources to skip individual test classes or even individual tests.  So we 
could open a new issue to move the last test from test_xmlrpc_net into 
test_xmrlpc, if anyone was interested in doing that :)

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue19180] some RFC references could be updated

2013-10-11 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue19226] distutils/command/upload.py show response gives: TypeError: sequence item 1: expected str instance, bytes found

2013-10-11 Thread W. Trevor King

New submission from W. Trevor King:

Avoid:

Traceback (most recent call last):
  File "setup.py", line 61, in 
'html2text (>=3.0.1)',
  File "/.../python3.2/distutils/core.py", line 148, in setup
dist.run_commands()
  File "/.../python3.2/distutils/dist.py", line 917, in run_commands
self.run_command(cmd)
  File "/.../python3.2/distutils/dist.py", line 936, in run_command
cmd_obj.run()
  File "/.../python3.2/distutils/command/upload.py", line 66, in run
self.upload_file(command, pyversion, filename)
  File "/.../python3.2/distutils/command/upload.py", line 201, in 
upload_file
msg = '\n'.join(('-' * 75, r.read(), '-' * 75))
TypeError: sequence item 1: expected str instance, bytes found

by converting the bytes returned by HTTPResponse.read [1] to a string
before joinging it with other strings.  HTTPResponse.headers supports
the Message interface [2], so we can use get_param to extract the
charset [3], falling back on ISO-8859-1 [4].

[1]: 
http://docs.python.org/3/library/http.client.html#http.client.HTTPResponse.read
[2]: http://docs.python.org/3/library/http.client.html#httpmessage-objects
[3]: 
http://docs.python.org/3/library/email.message.html#email.message.Message.get_param
[4]: http://tools.ietf.org/html/rfc2616#section-3.7.1

--
assignee: eric.araujo
components: Distutils
files: show-response-string.patch
keywords: patch
messages: 199489
nosy: eric.araujo, labrat, tarek
priority: normal
severity: normal
status: open
title: distutils/command/upload.py show response gives: TypeError: sequence 
item 1: expected str instance, bytes found
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file32045/show-response-string.patch

___
Python tracker 

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



[issue19180] some RFC references could be updated

2013-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also http://comments.gmane.org/gmane.comp.python.devel/139953 .

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue15806] Add context manager for the "try: ... except: pass" pattern

2013-10-11 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue5388] Green-box doc glitch: winhelp version only

2013-10-11 Thread Georg Brandl

Georg Brandl added the comment:

Is this still an issue?

--

___
Python tracker 

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



[issue19226] distutils/command/upload.py show response gives: TypeError: sequence item 1: expected str instance, bytes found

2013-10-11 Thread Ned Deily

Ned Deily added the comment:

This problem has been reported previously as Issue17354, a duplicate of 
Issue12853 which is still open at the moment.

--
nosy: +ned.deily
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> global name 'r' is not defined in upload.py
versions:  -Python 3.2, Python 3.5

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue12853] global name 'r' is not defined in upload.py

2013-10-11 Thread Ned Deily

Changes by Ned Deily :


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



[issue19226] distutils/command/upload.py show response gives: TypeError: sequence item 1: expected str instance, bytes found

2013-10-11 Thread W. Trevor King

W. Trevor King added the comment:

On Fri, Oct 11, 2013 at 05:21:15PM +, Ned Deily wrote:
> This problem has been reported previously as Issue17354, a duplicate
> of Issue12853 which is still open at the moment.

Ah, I searched for a fwe possible subject lines, but didn't hit those
:p.  I thought that if it wasn't fixed in the master branch it must
not have an associated issue…

I like my patch better than Issue17354's, because PyPI servers may not
always use UTF-8.  I'll ping Issue12853 about the patches, because
either one would fix Issue12853, and it's currently "needs patch".

--

___
Python tracker 

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



[issue12853] global name 'r' is not defined in upload.py

2013-10-11 Thread W. Trevor King

W. Trevor King added the comment:

I just posted a patch fixing this in the current master branch [1].  Ned Deily 
pointed out that my Issue19226 duplicated an earlier Issue17354, which also has 
a patch fixing this problem.  Merging either one of these patches should close 
this issue.  I like my patch's generic charset handling better, but for PyPI 
uploads either one would work fine.

I've looked through the Mercurial logs, but it looks like this r *has* been 
around since 34794 (Implement the Distutils 'upload' subcommand (upload package 
to PyPI), 2005-03-21), so I don't know where the "global name 'r' is not 
defined" message came from.

--
nosy: +labrat

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Updated patch using PyUnicode_FromKindAndData for ASCII strings, to ensure that 
corrupt marshal bytecode doesn't provide corrupt unicode objects. Performance 
is within 2% of the previous patch.

(however, a quick test suggests that PyUnicode_DecodeUTF8 is quite slower)

--
Added file: http://bugs.python.org/file32046/marshal_opts5.patch

___
Python tracker 

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



[issue13477] tarfile module should have a command line

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

>From a quick glance, the patch looks ok. Serhiy, do you want to review it any 
>further?

--

___
Python tracker 

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



[issue19227] test_multiprocessing_xxx hangs under Gentoo buildbots

2013-10-11 Thread Antoine Pitrou

New submission from Antoine Pitrou:

test_multiprocessing has started to hang frequently on the Gentoo buildbots.

It seems it has started happening with the "OpenSSL re-seeding" commits:
http://hg.python.org/cpython/rev/8e1194c39beddb83337c0acb9e4c2922a02a36cf

David, could you try to investigate on the buildbot? If this security fix can 
crash some machines, we'd better find a workaround.

--
components: Interpreter Core, Library (Lib), Tests
keywords: buildbot
messages: 199497
nosy: christian.heimes, pitrou, r.david.murray, sbt
priority: critical
severity: normal
status: open
title: test_multiprocessing_xxx hangs under Gentoo buildbots
type: crash
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



[issue5388] Green-box doc glitch: winhelp version only

2013-10-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Yes. On win 7, html help control 6.1, the horizontal scroll bar is still put in 
or on top of the box, but it is thinner so it only cuts off half of the bottom 
line instead of hiding it completely. There is no longer a vertical scroll bar, 
which means one can only expose the rest of the bottom line by maximizing the 
window and shrinking the type size.

This is no an issue for me now because I recently got a 27' monitor with 
2560x1440 resolution, so with full screen and still readable type, I can see 
even the long lines discussed here without a scrollbar. But this will not be 
true for most.  On a small enough screen, I might need a magnifier.

I checked and Internet Explorer works like FireFox, adding the scrollbar 
beneath the box (or expanding the box to accommodate it).

I just confirmed that the start menu shortcut does the same as double clicking 
python34/Doc/python34a3.chm. Same behavior. The icon is question mark partly 
over page.

--

___
Python tracker 

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



[issue5388] Green-box doc glitch: winhelp version only

2013-10-11 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions: +Python 3.3, Python 3.4 -Python 3.1, Python 3.2

___
Python tracker 

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



[issue19221] Upgrade to Unicode 6.3.0

2013-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Doc/whatsnew/3.4.rst

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue12892] UTF-16 and UTF-32 codecs should reject (lone) surrogates

2013-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch addresses Victor's comments on Rietveld. Thank you Victor. The 
"surrogatepass" error handler now works with different spellings of encodings 
("utf_32le", "UTF-32-LE", etc).

> I tested utf_16_32_surrogates_4.patch: surrogateescape with as encoder does 
> not work as expected.

Yes, surrogateescape doesn't work with ASCII incompatible encodings and can't. 
First, it can't represent the result of decoding b'\x00\xd8' from utf-16-le or 
b'ABCD' from utf-32*. This problem is worth separated issue (or even PEP) and 
discussion on Python-Dev.

--
Added file: http://bugs.python.org/file32047/utf_16_32_surrogates_5.patch

___
Python tracker 

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



[issue13477] tarfile module should have a command line

2013-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, this is in my plans.

--

___
Python tracker 

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



[issue19205] Don't import re and sysconfig in site.py

2013-10-11 Thread Christian Heimes

Changes by Christian Heimes :


Removed file: http://bugs.python.org/file32023/sysconfig_delay_re.patch

___
Python tracker 

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



[issue19205] Don't import re and sysconfig in site.py

2013-10-11 Thread Christian Heimes

Changes by Christian Heimes :


Removed file: http://bugs.python.org/file32017/site_no_re.patch

___
Python tracker 

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



[issue19205] Don't import re and sysconfig in site.py

2013-10-11 Thread Christian Heimes

Christian Heimes added the comment:

Here is a new patch with unit test and patch for the locale module. The locale 
modules is loaded by the _io module when any standard stream is not connected 
to a terminal (or so).

--
Added file: http://bugs.python.org/file32048/startup_no_re.patch

___
Python tracker 

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



[issue19205] Don't import re and sysconfig in site.py

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Review posted on Rietveld.

--
nosy: +pitrou
stage: needs patch -> patch review

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Let a code say instead me.

--
Added file: http://bugs.python.org/file32049/marshal_opts5a.patch

___
Python tracker 

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



[issue19227] test_multiprocessing_xxx hangs under Gentoo buildbots

2013-10-11 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



[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Let a code say instead me.

I don't understand your patch. The macros you define aren't used
anywhere.
Also, your patch keeps the slow call to PyUnicode_DecodeUTF8.

--

___
Python tracker 

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



[issue19205] Don't import re and sysconfig in site.py

2013-10-11 Thread STINNER Victor

STINNER Victor added the comment:

I accept hacks to speedup Python is the site module, but it becomes more 
surprising in the locale module. The issue #9548 proposes to a more generic 
solution for the locale module at startup.


-CONFIG_LINE = re.compile(r'^(?P(\w|[-_])+)\s*=\s*(?P.*)\s*$')
+CONFIG_LINE = None

If you set the constant to None, it's better to remove it completly (or make it 
private). It's a public variable, someone may try to read it. I don't know why 
it is public.

--
nosy: +haypo

___
Python tracker 

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



[issue9548] locale can be imported at startup but relies on too many library modules

2013-10-11 Thread Christian Heimes

Christian Heimes added the comment:

The locale module uses only collections.abc.Mapping. The import of the entire 
collections module can be avoided if collections.abc is renamed to _abcoll 
again. functools.wrap() can be replaced with:

localeconv.__doc__ = _localeconv.__doc__

The other attributes are either equal (e.g. __name__) or do not exist on 
builtin functions (__dict__).

--

___
Python tracker 

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



[issue19219] speed up marshal.loads()

2013-10-11 Thread STINNER Victor

STINNER Victor added the comment:

> (however, a quick test suggests that PyUnicode_DecodeUTF8 is quite slower)

It's surprising that PyUnicode_DecodeUTF8() is quite slower than 
_PyUnicode_FromUCS1(). _PyUnicode_FromUCS1() calls ucs1lib_find_max_char() and 
then memcpy(). PyUnicode_DecodeUTF8() first tries ascii_decode() which is very 
similar than ucs1lib_find_max_char().

The difference is maybe that _PyUnicode_FromUCS1() copies all bytes at once 
(memcpy()), whereas ascii_decode() copies bytes while if the string is ASCII or 
not.

--

___
Python tracker 

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



[issue19227] test_multiprocessing_xxx hangs under Gentoo buildbots

2013-10-11 Thread R. David Murray

R. David Murray added the comment:

Running test_socket test_ssl test_multiprocessing_fork 
test_multiprocessing_forkserver test_multiprocessing_spaw under -F on the 
buildbot, I got the following failure during the second loop:

[ 10] test_multiprocessing_spawn
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/rdmurray/p34/Lib/multiprocessing/spawn.py", line 96, in spawn_main
exitcode = _main(fd)
  File "/home/rdmurray/p34/Lib/multiprocessing/spawn.py", line 105, in _main
prepare(preparation_data)
  File "/home/rdmurray/p34/Lib/multiprocessing/spawn.py", line 210, in prepare
import_main_path(data['main_path'])
  File "/home/rdmurray/p34/Lib/multiprocessing/spawn.py", line 256, in 
import_main_path
exec(code, main_module.__dict__)
  File "/home/rdmurray/p34/Lib/test/regrtest.py", line 136, in 
import shutil
  File "/home/rdmurray/p34/Lib/shutil.py", line 14, in 
import tarfile
  File "", line 1599, in _find_and_load
  File "", line 1566, in _find_and_load_unlocked
  File "", line 607, in _check_name_wrapper
  File "", line 1056, in load_module
  File "", line 922, in load_module
  File "", line 1025, in get_code
  File "", line 1065, in get_data
OSError: [Errno 23] Too many open files in system: 
'/home/rdmurray/p34/Lib/tarfile.py'
Process Process-1410:
Traceback (most recent call last):
  File "/home/rdmurray/p34/Lib/multiprocessing/process.py", line 255, in 
_bootstrap
self.run()
  File "/home/rdmurray/p34/Lib/multiprocessing/process.py", line 92, in run
self._target(*self._args, **self._kwargs)
Process Process-1411:
Traceback (most recent call last):
Process Process-1412:
Traceback (most recent call last):
  File "/home/rdmurray/p34/Lib/multiprocessing/process.py", line 255, in 
_bootstrap
self.run()
  File "/home/rdmurray/p34/Lib/multiprocessing/process.py", line 92, in run
self._target(*self._args, **self._kwargs)
  File "/home/rdmurray/p34/Lib/test/_test_multiprocessing.py", line 1135, in 
task
self.f(*self.args)
  File "/home/rdmurray/p34/Lib/test/_test_multiprocessing.py", line 1219, in 
_test_wait_return_f
res = barrier.wait()
  File "/home/rdmurray/p34/Lib/multiprocessing/process.py", line 255, in 
_bootstrap
self.run()
  File "/home/rdmurray/p34/Lib/multiprocessing/process.py", line 92, in run
self._target(*self._args, **self._kwargs)
  File "/home/rdmurray/p34/Lib/threading.py", line 395, in wait
self._wait(timeout)
  File "/home/rdmurray/p34/Lib/threading.py", line 435, in _wait
raise BrokenBarrierError
threading.BrokenBarrierError
  File "/home/rdmurray/p34/Lib/test/_test_multiprocessing.py", line 1135, in 
task
self.f(*self.args)
  File "/home/rdmurray/p34/Lib/test/_test_multiprocessing.py", line 1219, in 
_test_wait_return_f
res = barrier.wait()
  File "/home/rdmurray/p34/Lib/test/_test_multiprocessing.py", line 1135, in 
task
self.f(*self.args)
  File "/home/rdmurray/p34/Lib/test/_test_multiprocessing.py", line 1219, in 
_test_wait_return_f
res = barrier.wait()
  File "/home/rdmurray/p34/Lib/threading.py", line 395, in wait
self._wait(timeout)
  File "/home/rdmurray/p34/Lib/threading.py", line 395, in wait
self._wait(timeout)
  File "/home/rdmurray/p34/Lib/threading.py", line 435, in _wait
raise BrokenBarrierError
threading.BrokenBarrierError
  File "/home/rdmurray/p34/Lib/threading.py", line 435, in _wait
raise BrokenBarrierError
threading.BrokenBarrierError
test test_multiprocessing_spawn failed -- Traceback (most recent call last):
  File "/home/rdmurray/p34/Lib/test/_test_multiprocessing.py", line 1227, in 
test_wait_return
self.run_threads(self._test_wait_return_f, (self.barrier, queue))
  File "/home/rdmurray/p34/Lib/test/_test_multiprocessing.py", line 1184, in 
run_threads
f(*args)
  File "/home/rdmurray/p34/Lib/test/_test_multiprocessing.py", line 1219, in 
_test_wait_return_f
res = barrier.wait()
  File "/home/rdmurray/p34/Lib/threading.py", line 395, in wait
self._wait(timeout)
  File "/home/rdmurray/p34/Lib/threading.py", line 433, in _wait
raise BrokenBarrierError
threading.BrokenBarrierError

--

___
Python tracker 

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



[issue9548] locale can be imported at startup but relies on too many library modules

2013-10-11 Thread STINNER Victor

STINNER Victor added the comment:

> ...  the _bootlocale can be simplified to a few lines: ...

Here is the patch implementing my proposition: bootlocale3.patch.

--
Added file: http://bugs.python.org/file32050/bootlocale3.patch

___
Python tracker 

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



[issue9548] locale can be imported at startup but relies on too many library modules

2013-10-11 Thread STINNER Victor

STINNER Victor added the comment:

"Does anyone know if Python does still support systems where CODESET is not 
available? Which OS does not support CODESET?"

I checked my VMs with Python, nl_langinfo(CODESET) works on:

- Linux (Fedora 18, kernel 3.9)
- OpenBSD 5.2
- OpenIndiana 148 (SunOS 5.11)
- FreeBSD 9.1

I also tested my patch on Windows 7: _bootlocale.getpreferredencoding() works 
as expected (it returns "cp1252").

--

___
Python tracker 

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



[issue9548] locale can be imported at startup but relies on too many library modules

2013-10-11 Thread Christian Heimes

Christian Heimes added the comment:

You could raise an error and wait until somebody files a complain. :)

--

___
Python tracker 

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



[issue9548] locale can be imported at startup but relies on too many library modules

2013-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fbbf8b160e8d by Antoine Pitrou in branch 'default':
Issue #9548: Add a minimal "_bootlocale" module that is imported by the _io 
module instead of the full locale module.
http://hg.python.org/cpython/rev/fbbf8b160e8d

--
nosy: +python-dev

___
Python tracker 

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



[issue19205] Don't import re and sysconfig in site.py

2013-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 406529adf156 by Christian Heimes in branch 'default':
Issue #19205: Don't import the 're' module in site and sysconfig module to
http://hg.python.org/cpython/rev/406529adf156

--
nosy: +python-dev

___
Python tracker 

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



[issue19205] Don't import re and sysconfig in site.py

2013-10-11 Thread Christian Heimes

Christian Heimes added the comment:

Thanks for your input!

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

___
Python tracker 

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



[issue19205] Don't import re and sysconfig in site.py

2013-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2cd1b28d1666 by Christian Heimes in branch 'default':
Issue #19205 fix 406529adf156
http://hg.python.org/cpython/rev/2cd1b28d1666

--

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-11 Thread Christian Heimes

Christian Heimes added the comment:

os_stat_statvfs_pickle.patch with comments and tests.

--
Added file: http://bugs.python.org/file32051/os_stat_statvfs_pickle2.patch

___
Python tracker 

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




[issue19228] type.__qualname__ should not strip the module name

2013-10-11 Thread STINNER Victor

New submission from STINNER Victor:

type.__qualname__ getter type_qualname() calls type_name() which strips the 
module name from the type name (type->tp_name).

Attached patch fixes this.

--
files: type_qualname.patch
keywords: patch
messages: 199518
nosy: haypo
priority: normal
severity: normal
status: open
title: type.__qualname__ should not strip the module name
versions: Python 3.4
Added file: http://bugs.python.org/file32052/type_qualname.patch

___
Python tracker 

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



[issue19228] type.__qualname__ should not strip the module name

2013-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

__qualname__ strips the module name by design. If you want the module name, 
look up __name__ on the module.

--
nosy: +pitrou
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue19218] Use of MutableMapping in os module slows down interpreter startup

2013-10-11 Thread Christian Heimes

Christian Heimes added the comment:

The io module no longer imports collections.abc through the locale module.

Eric, I'm with Antoine. Your patch is too much of a clever hack and uses tricks 
that are dark magic. _abcoll is much simpler and easier to understand. Plus it 
can be used from other modules, too.

--

___
Python tracker 

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



[issue19218] Use of MutableMapping in os module slows down interpreter startup

2013-10-11 Thread Eric Snow

Eric Snow added the comment:

Not a problem.  It is most definitely a hack. :)  I put in up as an alternative 
to rearranging the collections module, but agree that doing so is preferable.  
I image that Raymond will make a decision on that one.

--

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 29c4a6a11e76 by Christian Heimes in branch 'default':
Issue #19209: Remove import of copyreg from the os module to speed up
http://hg.python.org/cpython/rev/29c4a6a11e76

--
nosy: +python-dev

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-11 Thread Christian Heimes

Christian Heimes added the comment:

Thanks for your help!

Python is down to 43 modules on Linux.

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

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 89e405e6a7a9 by Christian Heimes in branch 'default':
Issue #19209: fix structseq test
http://hg.python.org/cpython/rev/89e405e6a7a9

--

___
Python tracker 

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



[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-11 Thread STINNER Victor

New submission from STINNER Victor:

To speedup Python startup, it may be interesting to not create useless many 
functions and classes in operator.py: "from _operator import *" will remove 
them a few line later.

What do you think of moving the Python implementation of the operator module 
inside in the else block of "try/except ImportError" section?

See attached operator.py for an example.

It adds an ugly level of indentation, but it's for performances!

Another option is to add a _pyoperator module.

--
files: operator.py
messages: 199525
nosy: christian.heimes, haypo
priority: normal
severity: normal
status: open
title: operator.py: move the Python implementation in the else block of 
try/except ImportError
versions: Python 3.4
Added file: http://bugs.python.org/file32053/operator.py

___
Python tracker 

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



[issue19179] doc bug: confusing table of values

2013-10-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I agree that this could be improved. It took a few readings to convince myself 
that True == Vulnerable. (Assuming that this is correct ;-) the table needs a 
title like Vulernable or a lead in sentence: "The following table indicates 
which modules are susceptible to which attacks."  Since True and False are 
names of Python objects, I would also prefer Yes and No or X and  or '-'.

--
nosy: +eli.bendersky, terry.reedy

___
Python tracker 

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



[issue19191] os.path.splitext in windows , a little question

2013-10-11 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
status: open -> closed

___
Python tracker 

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



[issue19202] Additions to function docs: reduce and itertools.

2013-10-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I think the reduce equivalent given by Georg would be excellent.

I think the enumerate equivalent already given is fine because I think 
equivalents should use basic syntax (for loops), not something that might be 
more obscure.

--
nosy: +terry.reedy
title: Additions to docs -> Additions to function docs: reduce and itertools.
versions: +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   >