[issue14889] PyBytes_FromObject(bytes_object) fails

2012-05-24 Thread Stefan Krah

Stefan Krah  added the comment:

I also wonder how the buffer interface section can fail.
PyBuffer_ToContiguous() should translate to a simple memcpy()
for a bytes object. What is going on?

--
nosy: +skrah

___
Python tracker 

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



[issue14744] Use _PyUnicodeWriter API in str.format() internals

2012-05-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> For Python 3.3, _PyUnicodeWriter API is faster than the Py_UCS4 buffer API 
> and PyAccu API in quite all cases, with a speedup between 30% and 100%. But 
> there are some cases where the _PyUnicodeWriter API is slower:

Perhaps most of these problems can be solved if instead of the boolean
flag (overallocate/no overallocate) to use the Py_ssize_t parameter that
indicates by how much should you overallocate (it is the length of the
suffix in the format).

--

___
Python tracker 

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



[issue14889] PyBytes_FromObject(bytes_object) fails

2012-05-24 Thread Larry Hastings

Larry Hastings  added the comment:

I can't reproduce this, and it was pretty late in my day when I saw it, so 
let's assume I was mistaken and PyBytes_CheckBuffer() works fine.  Nevertheless 
I think the patch is a good idea--why create a new object when you don't have 
to?  Unless I hear otherwise I'll check it in in the next day or so.

As for what I saw, I suspect it was a deliberate TypeError from the regression 
test suite, passing in an integer 0 as a filename to os.rename().  Naturally 
PyBytes_FromObject() fails to convert that to a bytes object.

--

___
Python tracker 

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



[issue14890] typo in difflib

2012-05-24 Thread ninsen

ninsen  added the comment:

My bad, closing...

--
status: open -> closed

___
Python tracker 

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



[issue14897] struct.pack raises unexpected error message

2012-05-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

Hmm.  Yes, that's not very clear.  The same message is used both for 
struct.pack and for Struct.pack (which struct.pack is really just a convenient 
alias for);  it makes a bit more sense for the latter:

>>> struct.Struct('1s1s').pack('33')
Traceback (most recent call last):
  File "", line 1, in 
struct.error: pack requires exactly 2 arguments

--
nosy: +mark.dickinson
versions: +Python 3.3

___
Python tracker 

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



[issue14897] struct.pack raises unexpected error message

2012-05-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Funny. struct.pack(fmt, args...) is just an alias to 
struct.Struct(fmt).pack(args...). The error message should be changed to 
explicitly state that we are talking about the data for packing, and not about 
the arguments of function. Or should remove mention of the number of arguments 
at all (leave only "too much" or "too little").

--
nosy: +storchaka

___
Python tracker 

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



[issue14897] struct.pack raises unexpected error message

2012-05-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

It might help if the error message also stated how many arguments were actually 
received, like the TypeError message already does for bad function / method 
calls.  E.g., 

"struct.error: pack expected 2 items for packing (got 1)"

--

___
Python tracker 

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



[issue14894] distutils.LooseVersion fails to compare number and a word

2012-05-24 Thread Natalia

Natalia  added the comment:

Hello, as a GSoC student, I'm working on PyPI to Debian repository converter. I 
wanted to compare  versions of packages available in PyPI and it broke while 
comparing appwsgi, wsgi-design ('default') and gar ('prototype.1') versions.

--

___
Python tracker 

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



[issue5767] xmlrpclib expat

2012-05-24 Thread Phil Daintree

Changes by Phil Daintree :


--
title: xmlrpclib loads invalid documents -> xmlrpclib expat
versions: +Python 2.7 -Python 2.5, Python 2.6

___
Python tracker 

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



[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)

2012-05-24 Thread Phil Daintree

Phil Daintree  added the comment:

The field in question contains the utf-8 text: PEÇAS

--

___
Python tracker 

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



[issue14855] IPv6 support for logging.handlers

2012-05-24 Thread Vinay Sajip

Vinay Sajip  added the comment:

> Or should it go to the separate ticket?

Yes, please.

--

___
Python tracker 

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



[issue14897] struct.pack raises unexpected error message

2012-05-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> It might help if the error message also stated how many arguments were 
> actually received, like the TypeError message already does for bad function / 
> method calls.  E.g., 
> 
> "struct.error: pack expected 2 items for packing (got 1)"

Yes, this would be useful. But seldom implemented.

Traceback (most recent call last):
  File "", line 1, in 
TypeError: not enough arguments for format string
>>> '%s %s'%(123,456,789)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: not all arguments converted during string formatting

struct.pack also inconsistent in other error messages.

Traceback (most recent call last):
  File "", line 1, in 
struct.error: argument for 's' must be a bytes object
>>> struct.pack('i', '123')
Traceback (most recent call last):
  File "", line 1, in 
struct.error: required argument is not an integer

For "s" is mentioned format, and for "i" no. It would be helpful to
mention also the number of the item.

--

___
Python tracker 

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



[issue14744] Use _PyUnicodeWriter API in str.format() internals

2012-05-24 Thread STINNER Victor

STINNER Victor  added the comment:

>> For Python 3.3, _PyUnicodeWriter API is faster than the Py_UCS4 buffer API 
>> and PyAccu API in quite all cases, with a speedup between 30% and 100%. But 
>> there are some cases where the _PyUnicodeWriter API is slower:
>
> Perhaps most of these problems can be solved if instead of the boolean
> flag (overallocate/no overallocate) to use the Py_ssize_t parameter that
> indicates by how much should you overallocate (it is the length of the
> suffix in the format).

There is not only a flag (flags.overallocate): there is also the
min_length, which is used and helps for str%args and str.format(args).

My patch contains a lot of "tricks" to limit overallocation, e.g.
don't overallocate if we are writing the last part of the output.

Computing exactly the size of the buffer gives the best performance
because it avoids a resize in _PyUnicodeWriter_Finish(). I tried for
example to modify PyUnicode_Format() to parse the format string twice:
first to compute the size of the output buffer, second to write
characters. In my experience, parsing the format string twice is more
expensive than reallocating the buffer (PyUnicode_READ is expensive),
especially on short and simple format strings.

I tried different methods to allocate the buffer of _PyUnicodeWriter:
change the overallocation factor (0%, 25%, 50%, 100%), only
overallocate +100 characters, etc. But I failed to find something
better than the proposed patch.

At least I can say than always disabling overallocation slows done
many cases: when there is a suffix after an argument, or when there
are more than one argument.

Feel free to experiment other methods to estimate the size of the output buffer.

--

___
Python tracker 

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



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-05-24 Thread Hynek Schlawack

Hynek Schlawack  added the comment:

Here is a patch with some more pep8-wankery + some dead code removal. Feel free 
to add only what you like, no hard feelings. :)

--
Added file: http://bugs.python.org/file25694/ipaddress-pep8-and-dead-code.diff

___
Python tracker 

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



[issue14886] json C vs pure-python implementation difference

2012-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> class pseudo_list(object):
> __class__ = list # fake isinstance

Why not inherit from list directly?
Setting __class__ to something else isn't widely supported in the Python code 
base. It may work or may not work, depending on the API, but it's not something 
we design or test for.

--

___
Python tracker 

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



[issue14898] Dict collision on boolean and integer values

2012-05-24 Thread Sasha B

New submission from Sasha B :

Not sure if this is predicted behaviour, but if I make a dict like:

>>> x = {0: 'bar', True: 'foo'}

and modify True with 1, or 0 with False:
>>> x[False] = 'boo'
>>> x[1] = 'far'

the modifications happen:
>>> x
{0: 'boo', True: 'far'}

Is this expected behaviour? It seems that the hashes for 'False' and 0 are 
confused, as are the hashes for 'True' and 1.

--
messages: 161497
nosy: sbermeister
priority: normal
severity: normal
status: open
title: Dict collision on boolean and integer values

___
Python tracker 

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



[issue14898] Dict collision on boolean and integer values

2012-05-24 Thread Sasha B

Changes by Sasha B :


--
components: +Build
type:  -> behavior
versions: +Python 2.7

___
Python tracker 

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



[issue14898] Dict collision on boolean and integer values

2012-05-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks for the report.  Yes, this is expected.  Dictionary membership is based 
on equality of keys.  Since True and 1 are equal, only one of them can be 
present in a dictionary at a time (and a key lookup works with either).

>>> x = {0: 'bar'}
>>> x[0]
'bar'
>>> x[False]
'bar'
>>> x[0.0]
'bar'
>>> 0 == False
True

--
nosy: +mark.dickinson
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue14898] Dict collision on boolean and integer values

2012-05-24 Thread Sasha B

Sasha B  added the comment:

Ahh, I see. You are correct. Thanks.

--

___
Python tracker 

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



[issue14822] Build unusable when compiled for Win 64-bit release

2012-05-24 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

I tested against the latest tip and the issue no longer exists.

--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue14821] _ctypes and other modules not built with msbuild on vs2010 solution

2012-05-24 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

Excellent! The latest tip now builds nicely using msbuild.

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

___
Python tracker 

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



[issue14899] Naming conventions and guidelines for packages and namespace packages

2012-05-24 Thread Benoît Bryon

New submission from Benoît Bryon :

Scope:

* Python documentation lacks conventions, or at least guidelines,
  to choose a name for a package.

* Python has tools to create and distribute packages.
  Not covered by this issue.

* Python has tools to create namespace packages.
  Not covered by this issue.

* Python has conventions about "syntax" of module names in PEP 8.
  Not covered by this issue.

Goal: add guidelines+conventions about package names in Doc/packaging/

Discussion started at 
http://mail.python.org/pipermail/distutils-sig/2012-May/018551.html

Jim Fulton said in 
http://mail.python.org/pipermail/distutils-sig/2012-May/018553.html:

> +1 for an official document (or addition to an existinhg document)
 providing a rational for namespace packages and their naming

Here is a ticket where proposals can be referenced.

Contributions can be pushed on the "doc-package-naming-conventions" branch of 
https://bitbucket.org/benoitbryon/cpython

--
assignee: docs@python
components: Documentation
hgrepos: 128
messages: 161502
nosy: benoitbryon, docs@python
priority: normal
severity: normal
status: open
title: Naming conventions and guidelines for packages and namespace packages
type: enhancement

___
Python tracker 

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



[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)

2012-05-24 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Yes, but where does this data come from? how did you feed it to the parser? And 
this does not relate to xml 1.1.

BTW, I found this page about XML 1.1:
http://www.cafeconleche.org/books/effectivexml/chapters/03.html

"""
Everything you need to know about XML 1.1 can be summed up in two rules:
- Don't use it.
- (For experts only) If you speak Mongolian, Yi, Cambodian, Amharic, Dhivehi, 
Burmese or a very few other languages and you want to write your markup (not 
your text but your markup) in these languages, then you can set the version 
attribute of the XML declaration to 1.1. Otherwise, refer to rule 1.
"""

--

___
Python tracker 

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



[issue14899] Naming conventions and guidelines for packages and namespace packages

2012-05-24 Thread Benoît Bryon

Benoît Bryon  added the comment:

Use branch ""doc-package-names" (not only conventions) instead.

--

___
Python tracker 

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



[issue14899] Naming conventions and guidelines for packages and namespace packages

2012-05-24 Thread Benoît Bryon

Benoît Bryon  added the comment:

See Martin Aspeli's article at 
http://www.martinaspeli.net/articles/the-naming-of-things-package-names-and-namespaces

--

___
Python tracker 

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



[issue5767] xmlrpclib loads invalid documents

2012-05-24 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
title: xmlrpclib expat -> xmlrpclib loads invalid documents

___
Python tracker 

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



[issue14036] urlparse insufficient port property validation

2012-05-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 988903cf24c5 by Senthil Kumaran in branch '2.7':
Issue #14036: return None when port in urlparse cross 65535
http://hg.python.org/cpython/rev/988903cf24c5

New changeset d769e64aed79 by Senthil Kumaran in branch '3.2':
Issue #14036: return None when port in urlparse cross 65535
http://hg.python.org/cpython/rev/d769e64aed79

New changeset b4d257c64db7 by Senthil Kumaran in branch 'default':
Issue #14036: return None when port in urlparse cross 65535
http://hg.python.org/cpython/rev/b4d257c64db7

--
nosy: +python-dev

___
Python tracker 

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



[issue14036] urlparse insufficient port property validation

2012-05-24 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

This is taken care. I was not really convinced on the need as likely seemed a 
non issue from "urlparse" standpoint, But still there is no harm in returning 
valid port as semantically the attribute stands for a port.

Thanks!

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

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-05-24 Thread Arne Babenhauserheide

New submission from Arne Babenhauserheide :

cProfile reports the profiling result in a table with the headers

  ncalls  tottime  percall  cumtime  percall filename:lineno(function)

The respective arguments are 

  calls   time -cumulative - nfl

Since I had to lookup these different names everytime I used cProfile, I think 
that it should take the table headings as argument aliases.

Also there is inconsistent naming of pcalls between docs and code.

In the docs of Stats.sort_stats pcalls is named primitive call count.
In the code at Stats.sort_arg_dict_default it was just named call count.

I created 4 patches to fix that in Python 2.7 and Python 3.2. The first is 
attached here, the later will be attached to comments. 

They apply to 822d7a1f8885 for 2.7 and 89b699e68fa2 for 3.2.

I also created a patch for adding percall sorting, but that requires more 
invasive changes and I did not see a simple name to distinguish between the two 
bycall headings.

--
components: Library (Lib)
files: 2.7-0-pcalls.diff
keywords: patch
messages: 161508
nosy: ArneBab
priority: normal
severity: normal
status: open
title: cProfile does not take its result headers as sort arguments
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file25695/2.7-0-pcalls.diff

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-05-24 Thread Arne Babenhauserheide

Changes by Arne Babenhauserheide :


Added file: http://bugs.python.org/file25696/2.7-1-headings-sortable.diff

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-05-24 Thread Arne Babenhauserheide

Changes by Arne Babenhauserheide :


Added file: http://bugs.python.org/file25697/3.2-0-pcalls.diff

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-05-24 Thread Arne Babenhauserheide

Changes by Arne Babenhauserheide :


Added file: http://bugs.python.org/file25698/3.2-1-headings-sortable.diff

___
Python tracker 

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



[issue12515] email modifies the message structure when the parsed email is invalid without registering defects

2012-05-24 Thread R. David Murray

R. David Murray  added the comment:

Thanks for the patch.  I haven't forgotten about it, but it will probably still 
be a while yet before I get to it.  Hopefully before 3.3 is released, though.

--
assignee: r.david.murray -> 
components: +email -Library (Lib)
nosy: +barry
title: email modifies the message structure when the parsed email is invalid -> 
email modifies the message structure when the parsed email is invalid without 
registering defects

___
Python tracker 

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



[issue13060] allow other rounding modes in round()

2012-05-24 Thread Arne Babenhauserheide

Arne Babenhauserheide  added the comment:

I also think that rounding half away from zero would be the most obvious 
choice, as it does not introduce a bias for random numbers distributed around 0 
while being close to what I would expect from school mathematics.

The case of n*(random() - 0.5) which I assume as common, this should work well, 
which is not the case for rounding towards +infinity.

--

___
Python tracker 

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



[issue3244] multipart/form-data encoding

2012-05-24 Thread R. David Murray

R. David Murray  added the comment:

Forest, could you please submit a contributor agreement?

http://www.python.org/psf/contrib/

Life caught up with me and I haven't made enough progress to do anything with 
this yet, but I still want to.

--
assignee: r.david.murray -> 
components: +email -Library (Lib)
stage: test needed -> patch review

___
Python tracker 

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



[issue3244] multipart/form-data encoding

2012-05-24 Thread Forest Bond

Forest Bond  added the comment:

Sure thing. I'll send it via e-mail later today.

--

___
Python tracker 

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



[issue1467619] Header.decode_header eats up spaces

2012-05-24 Thread R. David Murray

Changes by R. David Murray :


--
assignee: r.david.murray -> 
components: +email -Library (Lib)

___
Python tracker 

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



[issue12553] Add support for using a default CTE of '8bit' to MIMEText

2012-05-24 Thread R. David Murray

Changes by R. David Murray :


--
components: +email -Library (Lib)
nosy: +barry

___
Python tracker 

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



[issue634412] RFC 2112 in email package

2012-05-24 Thread R. David Murray

Changes by R. David Murray :


--
assignee: r.david.murray -> 
components: +email -Library (Lib)
stage: test needed -> needs patch

___
Python tracker 

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



[issue12641] Remove -mno-cygwin from distutils

2012-05-24 Thread Phillip J. Eby

Phillip J. Eby  added the comment:

Just adding a data point: I use the "mingw32" compiler setting with the Cygwin 
GCC installation, to compile extensions for standard Windows Python (*not* 
Cygwin Python).  It would be good if any change doesn't break this scenario -- 
assuming it's not already broken in newer Python versions.

(For this scenario, AFAIK, the no-cygwin option is required, or at least I 
believe it was the last time I intentionally compiled something.)

--
nosy: +pje

___
Python tracker 

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



[issue12553] Add support for using a default CTE of '8bit' to MIMEText

2012-05-24 Thread R. David Murray

R. David Murray  added the comment:

I've changed my approach.  The policy option is now 'cte_type', but moreover 
the default policy is now a backwards compatibility policy to which this issue 
doesn't apply.  The new provisional policy should get this support, but that's 
a somewhat bigger project and probably won't make it in to 3.3.

--
assignee: r.david.murray -> 
dependencies: +Provisional new email API: new policy implementing custom header 
objects
title: email should default to 8bit CTE unless policy.must_be_7bit is set -> 
Add support for using a default CTE of '8bit' to MIMEText
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue7304] email.message.Message.set_payload and as_string given charset 'us-ascii' plus 8bit data produces invalid message

2012-05-24 Thread R. David Murray

Changes by R. David Murray :


--
assignee: r.david.murray -> 
components: +email -Library (Lib)

___
Python tracker 

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



[issue14645] Generator does not translate linesep characters in certain circumstances

2012-05-24 Thread R. David Murray

Changes by R. David Murray :


--
assignee: r.david.murray -> 
components: +email
nosy: +barry

___
Python tracker 

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



[issue14734] Use binascii.b2a_qp/a2b_qp in email package header handling?

2012-05-24 Thread R. David Murray

Changes by R. David Murray :


--
assignee: r.david.murray -> 
components: +email
nosy: +barry

___
Python tracker 

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



[issue14653] Improve mktime_tz to use calendar.timegm instead of time.mktime

2012-05-24 Thread R. David Murray

Changes by R. David Murray :


--
assignee: r.david.murray -> 
components: +email -Library (Lib)
nosy: +barry

___
Python tracker 

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



[issue14894] distutils.LooseVersion fails to compare number and a word

2012-05-24 Thread Éric Araujo

Éric Araujo  added the comment:

> Hello, as a GSoC student, I'm working on PyPI to Debian repository converter.
Great!  I hope you’re aware of previous efforts like stdeb (unfortunately 
requires setuptools) and py2rpm (for rpm systems but some parts can be 
inspiration, like the download code).  I follow debian-python so we may 
encounter each other there.

> I wanted to compare  versions of packages available in PyPI and it broke 
> while comparing appwsgi,
> wsgi-design ('default') and gar ('prototype.1') versions.
I wonder why you need to compare versions from different projects.  What is 
“it” in “it broke”?  If it’s a regular distutils command, please paste the full 
command and log; if you meant you used the LooseVersion class in your code, 
then I’m afraid I will say this won’t be fixed: this is not a public class.  
distutils2.version however does contain a public class that implements PEP 386; 
even if the project is still in alpha (and I want to make a few renamings and 
API changes), you can still use it (and when I break your code a quick look at 
the CHANGES file will help you update).

--

___
Python tracker 

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



[issue14894] distutils.LooseVersion fails to compare number and a word

2012-05-24 Thread Éric Araujo

Éric Araujo  added the comment:

About Barry’s reply:

> But if 'a' is invalid, then LooseVersion should refuse to accept it in its 
> constructor, right?
It’s complicated.  The doc does not say much, the docstring however clearly 
states that versions should start with a digit, but a ton of projects use 
invalid-but-not-rejected formats.  distutils2 makes a clean break with clear 
rules (PEP 386); I’m not sure it would be acceptable for distutils to suddenly 
reject these versions.  It sounds useful but even with that change people would 
not always comply with PEP 386, so better let them use broken versions with 
distutils and force a switch to a fully compliant format with d2.  Does that 
make sense?

--

___
Python tracker 

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



[issue14894] distutils.LooseVersion fails to compare number and a word

2012-05-24 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On May 24, 2012, at 03:03 PM, Éric Araujo wrote:

>> But if 'a' is invalid, then LooseVersion should refuse to accept it in its
>> constructor, right?

>It’s complicated.  The doc does not say much, the docstring however clearly
>states that versions should start with a digit, but a ton of projects use
>invalid-but-not-rejected formats.  distutils2 makes a clean break with clear
>rules (PEP 386); I’m not sure it would be acceptable for distutils to
>suddenly reject these versions.  It sounds useful but even with that change
>people would not always comply with PEP 386, so better let them use broken
>versions with distutils and force a switch to a fully compliant format with
>d2.  Does that make sense?

It does, but in that case, I think the comparison should continue to succeed,
with whatever results it produces in Python 2.7.

--

___
Python tracker 

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



[issue13208] Problems with urllib on windows

2012-05-24 Thread Steve Holden

Steve Holden  added the comment:

I have just tested this against the 2.7.1 release on Windows 7 and it runs 
fine. I suspect there may have been some transient error with the reporter's 
system or network, but if this still fails for him then reopening will be 
appropriate with more information about the exact nature of the fault.

--
nosy: +holdenweb
resolution:  -> works for me

___
Python tracker 

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



[issue14901] Python Windows FAQ is Very Outdated

2012-05-24 Thread Michael Driscoll

New submission from Michael Driscoll :

I was reading through http://docs.python.org/faq/windows.html and noticed that 
its examples are based on Python 2.2-2.3 and it only really covers up to 
Windows 2000 with just a couple mentions of XP. 

There are also sections in there that I'm not even sure are still issues, such 
as the "Why does Python sometimes take so long to start?" and "Where is Freeze 
for Windows?". The latter should probably be a different question like "How do 
I make my program into an EXE?" or similar and then list some of the binary 
building scripts, like cx_freeze, py2exe, bbfreeze, etc, especially since the 
"freeze" script isn't included in the newer distros as far as I can tell. At 
least, it's not in the location that the FAQ says it is.

Do we even want the questions about NT and Windows 98? I would be happy to try 
to update the FAQ if my fellow developers can give me some direction on what we 
need to cut, keep and/or add.

--
messages: 161519
nosy: michael.driscoll
priority: normal
severity: normal
status: open
title: Python Windows FAQ is Very Outdated

___
Python tracker 

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



[issue14901] Python Windows FAQ is Very Outdated

2012-05-24 Thread Michael Driscoll

Changes by Michael Driscoll :


--
components: +Windows
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4

___
Python tracker 

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



[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)

2012-05-24 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

This has nothing to do with XML 1.1 (so closing this report as "won't fix").

The UTF-8 text that you present works very well:

>>> p=xml.parsers.expat.ParserCreate(encoding="utf-8")
>>> p.Parse("\xc3\x87>> p=xml.parsers.expat.ParserCreate(encoding="utf-8")
>>> p.Parse("Ã\x87", 1)
Traceback (most recent call last):
  File "", line 1, in 
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 9

I.e. the input might contain the character &, #, 1, 9, 5, ;, and \x87. That is 
ill-formed UTF-8, and the parser is right to choke on it. Even if it was 
declared as XML 1.1, it will still be ill-formed, because it still would be 
invalid UTF-8.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)

2012-05-24 Thread Panos Christeas

Panos Christeas  added the comment:

I'm reopening the bug, as your last comment does not cover the initial report. 
We are not talking about invalid UTF8 here, but legal low-ASCII values.

--
resolution: wont fix -> 
status: closed -> open

___
Python tracker 

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



[issue3244] multipart/form-data encoding

2012-05-24 Thread Forest Bond

Forest Bond  added the comment:

Okay, Contributor Agreement sent.

--

___
Python tracker 

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



[issue14902] test_logging failed

2012-05-24 Thread Yuriy Syrovetskiy

New submission from Yuriy Syrovetskiy :

rev 152c78b94e41

test test_logging failed -- Traceback (most recent call last):
  File "/home/cblp/my/cpython_default/Lib/test/test_logging.py", line 2903, in 
test_time
self.assertEqual(f.formatTime(r), '1993-04-21 08:03:00,123')
AssertionError: '1993-04-21 09:03:00,123' != '1993-04-21 08:03:00,123'
- 1993-04-21 09:03:00,123
? ^
+ 1993-04-21 08:03:00,123
? ^

--
components: Tests
messages: 161523
nosy: cblp
priority: normal
severity: normal
status: open
title: test_logging failed
type: compile error
versions: Python 3.3

___
Python tracker 

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



[issue14902] test_logging failed

2012-05-24 Thread Yuriy Syrovetskiy

Yuriy Syrovetskiy  added the comment:

My local timezone is Europe/Moscow, UTC+4, no daylight saving since 2011.

--

___
Python tracker 

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



[issue14863] Update docs of os.fdopen()

2012-05-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9ef2cb56926d by Petri Lehtinen in branch '3.2':
#14863: Update the documentation of os.fdopen()
http://hg.python.org/cpython/rev/9ef2cb56926d

New changeset f27e098a774a by Petri Lehtinen in branch 'default':
#14863: Update the documentation of os.fdopen()
http://hg.python.org/cpython/rev/f27e098a774a

--
nosy: +python-dev

___
Python tracker 

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



[issue14863] Update docs of os.fdopen()

2012-05-24 Thread Petri Lehtinen

Changes by Petri Lehtinen :


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

___
Python tracker 

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



[issue3244] multipart/form-data encoding

2012-05-24 Thread R. David Murray

R. David Murray  added the comment:

Thanks.

--

___
Python tracker 

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



[issue14903] dictobject infinite loop on 2.6.5 on 32-bit x86

2012-05-24 Thread Daniel Farina

New submission from Daniel Farina :

I seem to be encountering somewhat rare an infinite loop
in hash table probing while importing _socket, as triggered by
init_socket.c in Python 2.6, as seen/patched shipped with Ubuntu 10.04
LTS.  The problem only reproduces on 32 bit machines, on both -O2 and
-O0 builds (which is how I have managed to retrieve the detailed stack
traces below).  To cut to the chase, the bottom of the stack trace
invariably looks like this, in particular the "key" (and therefore
"hash") value is always the same:

#0  0x08088637 in lookdict_string (mp=0xa042714, key='SO_RCVTIMEO',
   hash=612808203) at ../Objects/dictobject.c:421
#1  0x080886cd in insertdict (mp=0xa042714, key='SO_RCVTIMEO', hash=612808203,
   value=20) at ../Objects/dictobject.c:450
#2  0x08088cac in PyDict_SetItem (op=, key=
   'SO_RCVTIMEO', value=20) at ../Objects/dictobject.c:701
#3  0x0808b8d4 in PyDict_SetItemString (v=
   {'AF_INET6': 10, 'SocketType': ,
'getaddrinfo': ,
'TIPC_MEDIUM_IMPORTANCE': 1, 'htonl': ,
'AF_UNSPEC': 0, 'TIPC_DEST_DROPPABLE': 129, 'TIPC_ADDR_ID': 3,
'PF_PACKET': 17, 'AF_WANPIPE': 25, 'PACKET_OTHERHOST': 3, 'AF_AX25':
3, 'PACKET_BROADCAST': 1, 'PACKET_FASTROUTE': 6, 'TIPC_NODE_SCOPE': 3,
'inet_pton': , 'AF_ATMPVC': 8,
'NETLINK_IP6_FW': 13, 'NETLINK_ROUTE': 0, 'TIPC_PUBLISHED': 1,
'TIPC_WITHDRAWN': 2, 'AF_ECONET': 19, 'AF_LLC': 26, '__name__':
'_socket', 'AF_NETROM': 6, 'SOCK_RDM': 4, 'AF_IRDA': 23, 'htons':
, 'SOCK_RAW': 3, 'inet_ntoa': , 'AF_NETBEUI': 13, 'AF_NETLINK': 16,
'TIPC_WAIT_FOREVER': -1, 'AF_UNIX': 1, 'TIPC_SUB_PORTS': 1,
'HCI_TIME_STAMP': 3, 'gethostbyname_ex': , 'SO_RCVBUF': 8, 'AF_APPLETALK': 5,
'SOCK_SEQPACKET': 5, 'AF_DECnet': 12, 'PACKET_OUTGOING': 4,
'SO_SNDLOWAT': 19, 'TIPC_SRC_DROPPABLE':...(truncated), key=0x81ac5fb
"SO_RCVTIMEO", item=20) at ../Objects/dictobject.c:2301
#4  0x080f6c98 in PyModule_AddObject (m=, name=
   0x81ac5fb "SO_RCVTIMEO", o=20) at ../Python/modsupport.c:615
#5  0x080f6d0b in PyModule_AddIntConstant (m=,
   name=0x81ac5fb "SO_RCVTIMEO", value=20) at ../Python/modsupport.c:627
#6  0x081321fd in init_socket () at ../Modules/socketmodule.c:4708

Here, we never escape from lookdict_string.  The key is not in the
dictionary, but at this stage Python is trying to figure out that is
the case, and cannot seem to exit because of the lack of a dummy
entry.  Furthermore, every single reproduced case has a dictionary
with a suspicious looking violation of an invariant that I believe is
communicated by the source of dictobject.c, with emphasis on the
values of ma_fill, ma_used, and ma_mask, which never deviate in any
reproduced case.  It seems like no hash table should ever get this
full, per the comments in the source:

$3 = {ob_refcnt = 1, ob_type = 0x81c3aa0, ma_fill = 128, ma_used = 128,
 ma_mask = 127, ma_table = 0xa06b4a8, ma_lookup =
   0x8088564 , ma_smalltable = {{me_hash = 0, me_key = 0x0,
 me_value = 0x0}, {me_hash = 1023053529, me_key = '__name__', me_value =
   '_socket'}, {me_hash = 1679430097, me_key = 'gethostbyname', me_value =
   }, {me_hash = 0, me_key = 0x0, me_value =
   0x0}, {me_hash = 779452068, me_key = 'gethostbyname_ex', me_value =
   }, {me_hash = -322108099, me_key =
   '__doc__', me_value = None}, {me_hash = -1649837379, me_key =
   'gethostbyaddr', me_value = }, {
 me_hash = 1811348911, me_key = '__package__', me_value = None}}}

The Python program that is running afoul this bug is using gevent, but
the stack traces suggest that all gevent is doing at the time this
crashes is importing "socket", and this is done at the very, very
beginning of program execution.

Finally, what's especially strange is that I had gone a very long time
running this exact version of Python, libraries, and application quite
frequently: it suddenly started cropping up a little while ago (maybe
a few weeks).  It could have been just coincidence, but if there are
code paths in init_socket.c that may somehow be sensitive to the
network somehow, this could have been related.  I also have a limited
suspicion that particularly unlucky OOM (these systems are configured
in a way where malloc and friends will return NULL, i.e. no overcommit
on Linux) could be related.

--
components: Interpreter Core
messages: 161527
nosy: Daniel.Farina
priority: normal
severity: normal
status: open
title: dictobject infinite loop on 2.6.5 on 32-bit x86
type: behavior
versions: 3rd party, Python 2.6

___
Python tracker 

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



[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable

2012-05-24 Thread Pekka Klärck

Pekka Klärck  added the comment:

I found about this enhancement via Python Insider blog post [1] that also asked 
adding comments to this issue. Here are mine:

1) Great to see that this is finally done!

2) Is only Python installation directory added into PATH? Why not also Scripts 
directory under it as originally requested in this issue? As a developer of a 
Python based test automation tool, just adding Python into PATH doesn't help us 
because our tool's launcher scripts still aren't found unless PATH is manually 
edited.

3) I would also prefer this to be on by default.

[1] http://blog.python.org/2012/05/recent-windows-changes-in-python-33.html

--
nosy: +pekka.klarck

___
Python tracker 

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



[issue14903] dictobject infinite loop on 2.6.5 on 32-bit x86

2012-05-24 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue14903] dictobject infinite loop on 2.6.5 on 32-bit x86

2012-05-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Can you reproduce on current 2.7.3 or 3.2.3 or even 3.3.0 (which has changed 
dict implementation)? Or can you upload a short program that exhibits the 
problem, so someone else can try? 2.6 gets security fixes only and I do not 
believe this qualifies. If not a current problem, this should be closed as out 
of date, even if disconcerting.

--
nosy: +terry.reedy
stage:  -> test needed

___
Python tracker 

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



[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable

2012-05-24 Thread Brian Curtin

Brian Curtin  added the comment:

2. Yes, only the installation directory, because that's the only directory we 
create. Scripts is created by distutils/packaging, but perhaps we could add it 
since it is widely used. Anyone have an opinion?

3. Do you have a reason? Many tools that offer path manipulation do not do so 
by default because it changes how the system operates. If we put this on by 
default, it will change how a lot of scripts are executed without people 
expecting it. It's easy to click through an installer like Python's because 
it's not flashy and there aren't a lot of options as it is. If we just let 
people click through, things are going to break a lot more than if we make 
people ask for it.

I could see it becoming a default in a future release once it has been in the 
wild for a while, but I think we're going to run into a lot of problems if we 
just flip it right away.

--

___
Python tracker 

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



[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable

2012-05-24 Thread Pekka Klärck

Pekka Klärck  added the comment:

Being on by default would just be easier. If it's off, we still need to 
separately instruct users to turn it on. That's obviously a lot easier than 
instruction them to change environment variables, so I don't feel too strongly 
about it.

Not adding Scripts into PATH, on the other hand, would make this enhancement 
pretty useless for us. If it's considered confusing that the installer adds a 
directory it doesn't create into PATH, perhaps the installer could be changed 
to also create that directory.

--

___
Python tracker 

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



[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable

2012-05-24 Thread Nick Coghlan

Nick Coghlan  added the comment:

For 3, installing the PEP 397 launcher will be the long term "on-by-default" 
solution.

For 2, adding the Scripts subdirectory seems reasonable.

FWIW, Window used to have *very* severe restrictions on the maximum length of 
PATH, as well as gratuitously long names for standard executable file 
locations. This made conscientious developers understandably reluctant to mess 
with PATH, because adding to the start could break other elements of the user's 
system, while adding to the end wasn't reliable.

This is much less of an issue these days, as Windows is a lot more tolerant of 
ridiculously long PATH definitions.

--

___
Python tracker 

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



[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable

2012-05-24 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> 2. Yes, only the installation directory, because that's the only  
> directory we create. Scripts is created by distutils/packaging, but  
> perhaps we could add it since it is widely used. Anyone have an  
> opinion?

Fine with me. To create an empty directory, an entry into the CreateFolder
table needs to be made. This isn't yet supported in msilib.py, but should
be a method on Directory.

--

___
Python tracker 

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



[issue14901] Python Windows FAQ is Very Outdated

2012-05-24 Thread Daniel Swanson

Daniel Swanson  added the comment:

I agree that Such things are most outdated and I think that if any Python users 
are still using platforms that old, that they are an extreme minority and also 
wonder what on (or off) Earth a Freeze is.

--
nosy: +weirdink13

___
Python tracker 

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



[issue14901] Python Windows FAQ is Very Outdated

2012-05-24 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee:  -> docs@python
components: +Documentation
nosy: +brian.curtin, docs@python, ezio.melotti, tim.golden
stage:  -> needs patch
type:  -> enhancement
versions:  -Python 2.6, Python 3.1, Python 3.4

___
Python tracker 

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



[issue14904] test_unicode_repr_oflw (in test_bigmem) crashes

2012-05-24 Thread Antoine Pitrou

New submission from Antoine Pitrou :

Someone needs to debug this (someone with enough RAM).

http://www.python.org/dev/buildbot/all/builders/AMD64%20Ubuntu%20LTS%20bigmem%202.7/builds/6/steps/test/logs/stdio

My intuition is that the crash is on the eval(), since test_unicode_repr above 
passes.

--
components: Interpreter Core, Tests
messages: 161535
nosy: benjamin.peterson, lukasz.langa, pitrou, twouters
priority: normal
severity: normal
status: open
title: test_unicode_repr_oflw (in test_bigmem) crashes
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue14886] json C vs pure-python implementation difference

2012-05-24 Thread Марк Коренберг

Марк Коренберг  added the comment:

Well, __class_ = list is my problem, but python's problem is that it uses 
different approaches in C and python implementation.

P.S.
I don't want to subclass list, as I don't want things like this:
x = pseudo_list(iter(xrange(10))
x.append('test')
print len(x)

--

___
Python tracker 

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



[issue12014] str.format parses replacement field incorrectly

2012-05-24 Thread Ben Wolfson

Ben Wolfson  added the comment:

Here's a patch that works against the current unicode_format.h and implements 
what Petri suggested.

--
Added file: http://bugs.python.org/file25699/strformat-no-braces.diff

___
Python tracker 

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



[issue14886] json C vs pure-python implementation difference

2012-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Well, __class_ = list is my problem, but python's problem is that it
> uses different approaches in C and python implementation.

Well, by construction a C accelerator will use the fastest method
available within what the API's specification allows. The json API
doesn't specify whether isinstance() or a more concrete type check is
used when dispatching over argument types, so I'd classify this as an
implementation detail.

--

___
Python tracker 

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



[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable

2012-05-24 Thread Brian Curtin

Brian Curtin  added the comment:

I'm strongly opposed to enabling this by default at least for 3.3, but does 
anyone think something like this dialog http://i.imgur.com/18zPD.png be 
helpful? After choosing the directory to install to and before choosing the 
features, it's a simple dialog explaining that the Path feature is available 
and what it does.

Attached is the patch.

--
Added file: http://bugs.python.org/file25700/news_dialog.diff

___
Python tracker 

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



[issue14886] json C vs pure-python implementation difference

2012-05-24 Thread Марк Коренберг

Марк Коренберг  added the comment:

Inconsistency is bother me. If I specify indent in dumps(), I will have one 
semantics, else other ones.

Why not to fix pure-python implementation using "type(o) in (list, tuple)" ? 
This is faster too (as I think).

--

___
Python tracker 

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



[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable

2012-05-24 Thread Sridhar Ratnakumar

Changes by Sridhar Ratnakumar :


--
nosy:  -srid

___
Python tracker 

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



[issue14660] Implement PEP 420: Implicit Namespace Packages

2012-05-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 702009f3c0b1 by Eric V. Smith in branch 'default':
issue 14660: Implement PEP 420, namespace packages.
http://hg.python.org/cpython/rev/702009f3c0b1

--
nosy: +python-dev

___
Python tracker 

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



[issue14660] Implement PEP 420: Implicit Namespace Packages

2012-05-24 Thread Eric V. Smith

Eric V. Smith  added the comment:

I'm closing this issue. I'll open new issues as needed.

--
resolution:  -> fixed
stage: test needed -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2012-05-24 Thread Eric V. Smith

New submission from Eric V. Smith :

If a zip file contains "pkg/foo.py" but no "pkg/" entry, it will not be 
possible for "pkg" to be a namespace package portion.

--
components: Extension Modules
messages: 161543
nosy: eric.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: zipimport.c needs to support namespace packages when no 'directory' 
entry exists
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2012-05-24 Thread Eric V. Smith

Eric V. Smith  added the comment:

For a (very) brief discussion on the strategy to implement this, see: 
http://mail.python.org/pipermail/import-sig/2012-May/000528.html

--

___
Python tracker 

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



[issue952953] execve rejects empty argument list

2012-05-24 Thread Tim Newsham

Tim Newsham  added the comment:

This still crashes in newer builds such as:
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) 
[GCC 4.4.3] on linux2


>>> import os
>>> os.execve("/bin/ls", [], {})
Segmentation fault

0  __strrchr_sse42 () at ../sysdeps/x86_64/multiarch/strrchr.S:134
#1  0x0040a36e in ?? ()
#2  0x00407bce in ?? ()
#3  0x7744ac4d in __libc_start_main (main=, 
argc=, ubp_av=, 
init=, fini=, 
rtld_fini=, stack_end=0x7fffee88)
at libc-start.c:226
#4  0x00402709 in ?? ()
#5  0x7fffee88 in ?? ()
#6  0x001c in ?? ()
#7  0x in ?? ()

--
nosy: +Tim.Newsham
versions: +Python 2.6 -Python 2.3

___
Python tracker 

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



[issue14906] rotatingHandler WindowsError

2012-05-24 Thread Curu Wong

New submission from Curu Wong :

I setup and use rotatingHandler this way:
=
#create logger
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
#create rotate handler
rotatefh = logging.handlers.RotatingFileHandler(filename=logfile, 
maxBytes=2000, backupCount=100)
rotatefh.setLevel(logging.INFO)
#create formatter
formatter = logging.Formatter('%(asctime)s %(levelname)s: %(message)s')
rotatefh.setFormatter(formatter)
logger.addHandler(rotatefh)
...
logger.info("%s, create time: %s" % (pdb, time.strftime("%Y-%m-%d 
%H:%M:%S", time.localtime(create_time
logger.info("copying '%s' to '%s' ..." % (src, dst))
copy_cmd = 'xcopy /I /E /Y "%s" "%s"' % (src, dst)
process = subprocess.Popen(copy_cmd, stdout=subprocess.PIPE, 
stderr=subprocess.PIPE, shell=True)
for msg in process.stdout:
logger.info(msg.strip())
process.wait()
error_msg = process.stderr.read()
if error_msg:
logger.error(error_msg.strip())
else:
if build_num in release_version:
logger.info("leave release version '%s' un touched" % 
pdb)
continue
else:
logger.info("deleting '%s'" % src)
subprocess.call('rd /s /q "%s"' % src, shell=True)
logger.info("=" * 80)
==
All other part has nothing to do with log file.
when it comes to rotate, I always get this error:



Traceback (most recent call last):
  File "C:\Python27\lib\logging\handlers.py", line 78, in emit
self.doRollover()
  File "C:\Python27\lib\logging\handlers.py", line 141, in doRollover
os.rename(self.baseFilename, dfn)
WindowsError: [Error 32]
Logged from file backup_pdb.py, line 76
Traceback (most recent call last):
  File "C:\Python27\lib\logging\handlers.py", line 78, in emit
self.doRollover()
  File "C:\Python27\lib\logging\handlers.py", line 141, in doRollover
os.rename(self.baseFilename, dfn)
WindowsError: [Error 32]
Logged from file backup_pdb.py, line 76
Traceback (most recent call last):
  File "C:\Python27\lib\logging\handlers.py", line 78, in emit
self.doRollover()
  File "C:\Python27\lib\logging\handlers.py", line 141, in doRollover
os.rename(self.baseFilename, dfn)
WindowsError: [Error 32]
Logged from file backup_pdb.py, line 76

I don't have any anti-virus software on this machine,  the error is somewhat 
like http://bugs.python.org/issue14450 . However, I have only one handler 
referring to the log file, but still get the error.

--
components: Library (Lib), Windows
messages: 161546
nosy: jacuro
priority: normal
severity: normal
status: open
title: rotatingHandler WindowsError
versions: Python 2.7

___
Python tracker 

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



[issue13208] Problems with urllib on windows

2012-05-24 Thread Steve Holden

Steve Holden  added the comment:

Oops, sorry, meant to close this issue. Hope that's OK.

--
status: open -> closed

___
Python tracker 

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



[issue14810] Bug in tarfile

2012-05-24 Thread David Ibarra

David Ibarra  added the comment:

I too cannot reproduce this, tarfile seems to recognizes that it isn't a valid 
tar file (tested on OS X):

Davids-MacBook-Air:Workspace dibarra$ ls -l
total 8
-rw-r--r--  1 dibarra  staff 0 May 30  1956 testfile
Davids-MacBook-Air:Workspace dibarra$ tar -cvf testfile.tar testfile
a testfile

>>> t = tarfile.TarFile("testfile.tar")
Traceback (most recent call last):
...
tarfile.ReadError: missing or bad subsequent header

--
nosy: +dtibarra

___
Python tracker 

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



[issue14899] Naming conventions and guidelines for packages and namespace packages

2012-05-24 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the report.  You are confusing Python packages and the distributable 
things that are also called packages (not by most of the distutils docs though 
where they are named distributions).  PEP 8 covers conventions for naming 
modules (including packages); PEP 345 defines project names (in a very open way 
though).  I am not sure the docs need to do more; I will reply to the 
distutils-sig messages and read the link you provided.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue14899] Naming conventions and guidelines for packages and namespace packages

2012-05-24 Thread Éric Araujo

Changes by Éric Araujo :


--
keywords: +patch
Added file: http://bugs.python.org/file25701/4b311ce6624b.diff

___
Python tracker 

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



[issue14893] Tutorial: Add function annotation example to function tutorial

2012-05-24 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the patch.  I made some comments on the code review tool, which 
should have sent you a mail.

--

___
Python tracker 

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



[issue14889] PyBytes_FromObject(bytes_object) creates a new object

2012-05-24 Thread Larry Hastings

Larry Hastings  added the comment:

Changing the name of the report to accurately reflect reality.  If you passed 
in a bytes object, PyBytes_FromObject would create a new object, when all it 
really needed to do was incref and return.  My checkin in a minute will add 
that shortcut.

--
title: PyBytes_FromObject(bytes_object) fails -> 
PyBytes_FromObject(bytes_object) creates a new object

___
Python tracker 

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



[issue14889] PyBytes_FromObject(bytes_object) creates a new object

2012-05-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f8cd75e8a1d6 by Larry Hastings in branch 'default':
Issue #14889: PyBytes_FromObject(bytes) now just increfs and returns.
http://hg.python.org/cpython/rev/f8cd75e8a1d6

--
nosy: +python-dev

___
Python tracker 

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



[issue14889] PyBytes_FromObject(bytes_object) creates a new object

2012-05-24 Thread Larry Hastings

Changes by Larry Hastings :


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

___
Python tracker 

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



[issue14899] Naming conventions and guidelines for packages and namespace packages

2012-05-24 Thread Benoît Bryon

Benoît Bryon  added the comment:

I didn't provided the patch because the work is still at early stage. I planned 
to provide a patch when the development branch is quite mature.
I created the issue early so that other people can contribute.

But I maybe I'd better read PEP 1 again... because it looks like a PEP (which 
may lead back to this ticket when it's time for implementation).

I'm to post a proposal to python-list or python-ideas mailing lists.

--

___
Python tracker 

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



[issue14907] SSL module cannot handle unicode filenames

2012-05-24 Thread Marc Schlaich

New submission from Marc Schlaich :

Here is a short example to reproduce the error:

>>> import socket, ssl
>>> sock = socket.socket()
>>> sock = ssl.wrap_socket(sock, cert_reqs=ssl.CERT_REQUIRED, ca_certs=u'ä.crt')
>>> sock.connect((None, None))
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python27\lib\ssl.py", line 322, in connect
self._real_connect(addr, False)
  File "C:\Python27\lib\ssl.py", line 305, in _real_connect
self.ca_certs, self.ciphers)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 0:
ordinal not in range(128)

--
components: Library (Lib), Unicode
messages: 161554
nosy: ezio.melotti, ms4py
priority: normal
severity: normal
status: open
title: SSL module cannot handle unicode filenames
type: crash
versions: Python 2.6, Python 2.7

___
Python tracker 

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