[issue13243] _Py_identifier should be _Py_IDENTIFER

2011-10-22 Thread Eric Snow

New submission from Eric Snow ericsnowcurren...@gmail.com:

Looks like Parser/asdl_c.py did not get all the way updated when _Py_identifier 
switched over to _Py_IDENTIFER.  I've included a patch that fixes it (though 
it's relatively trivial).  With this fix I did not notice any further problems.

--
components: Interpreter Core
files: asdl.diff
keywords: patch
messages: 146159
nosy: eric.snow, loewis
priority: normal
severity: normal
status: open
title: _Py_identifier should be _Py_IDENTIFER
type: compile error
versions: Python 3.3
Added file: http://bugs.python.org/file23493/asdl.diff

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



[issue13235] logging.warn() is not documented

2011-10-22 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

Just to me it clear - why do you want warn() to be removed aside from code 
duplication?

My argument to leave it and document is that it is convenient and makes lines 
shorter (and won't break existing code). From logging module I also see that 
there are also logging.WARN aliases that you'll need to deprecate also.

--
resolution: fixed - 
status: closed - open

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



[issue13235] logging.warn() is not documented

2011-10-22 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Because there should be only one way to do things.

BTW, you could have used a DeprecationWarning instead of a 
PendingDeprecationWarning, especially if it was already deprecated.

--

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



[issue1548891] shlex (or perhaps cStringIO) and unicode strings

2011-10-22 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

If you think it's fine to change this behavior, then yes :)

--

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



[issue12659] Add tests for packaging.tests.support

2011-10-22 Thread Francisco Martín Brugué

Francisco Martín Brugué franci...@email.de added the comment:

Hi Éric,
Nice! and thanks for the info: I was just waiting to the check-in to 
compare and try further with the tests. Now I can just commit another 
patch by synching against the actual tip.

Cheers,

francis

--

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



[issue13235] logging.warn() is not documented

2011-10-22 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

 Just to me it clear - why do you want warn() to be removed aside from code 

 duplication?
 
 My argument to leave it and document is that it is convenient and makes lines 
 shorter (and won't break existing code). From logging module I also see that 
 there are also logging.WARN aliases that you'll need to deprecate also.

Sorry, I don't agree. I was happy to leave it as is until you raised this 
issue, but now I think the right thing to do is deprecate and remove warn(). 
I'm not too fussed about the WARN level, and I can't easily issue a deprecation 
warning for it as it's a module attribute, so I'll leave it in as an internal 
implementation detail, for which the usual caveats apply.

--

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



[issue13235] logging.warn() is not documented

2011-10-22 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

 BTW, you could have used a DeprecationWarning instead of a 

 PendingDeprecationWarning, especially if it was already deprecated.

It wasn't officially deprecated, just deprecation via obscurity;-) which is 
why I made it a PendingDeprecationWarning.

--

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



[issue13235] logging.warn() is not documented

2011-10-22 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

PendingDeprecations are not so useful now that warnings are silenced by 
default. Since it wasn't documented, you could deprecate it in 3.3 and remove 
it in 3.4 IMHO.

--

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



[issue13244] WebSocket schemes in urlparse

2011-10-22 Thread Tobias Oberstein

New submission from Tobias Oberstein tobias.oberst...@tavendo.de:

The urlparse module currently does not support the new ws and wss schemes 
used for the WebSocket protocol.

As a workaround, we currently use the following code (which is a hack of 
course):

import urlparse
wsschemes = [ws, wss]
urlparse.uses_relative.extend(wsschemes)
urlparse.uses_netloc.extend(wsschemes)
urlparse.uses_params.extend(wsschemes)
urlparse.uses_query.extend(wsschemes)
urlparse.uses_fragment.extend(wsschemes)

===

A WebSocket URL has scheme ws or wss, MUST have a network location and MAY 
have a resource part with path and query components, but MUST NOT have a 
fragment component.

--
components: Library (Lib)
messages: 146167
nosy: oberstet
priority: normal
severity: normal
status: open
title: WebSocket schemes in urlparse
type: feature request
versions: Python 2.7

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



[issue13235] logging.warn() is not documented

2011-10-22 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

 PendingDeprecations are not so useful now that warnings are silenced by 
 default. 

 Since it wasn't documented, you could deprecate it in 3.3 and remove it in 
 3.4 IMHO.

Hmmm, you're probably right. I'll change it to a DeprecationWarning.

--

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



[issue13244] WebSocket schemes in urlparse

2011-10-22 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
keywords: +easy
nosy: +ezio.melotti, orsenthil
stage:  - test needed
versions: +Python 3.3 -Python 2.7

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



[issue12930] reindent.py inserts spaces in multiline literals

2011-10-22 Thread Dima Tisnek

Dima Tisnek dim...@gmail.com added the comment:

good enough for me :)

--

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



[issue13235] logging.warn() is not documented

2011-10-22 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 4a90d1ed115d by Vinay Sajip in branch 'default':
Closes #13235: Changed PendingDeprecationWarning to DeprecationWarning.
http://hg.python.org/cpython/rev/4a90d1ed115d

--
resolution:  - fixed
status: open - closed

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



[issue12406] msi.py needs updating for Python 3.3

2011-10-22 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

Adding Antoine for the short-name conflicts caused by the *.passwd.pem files.

--
nosy: +pitrou

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



[issue13201] Implement comparison operators for range objects

2011-10-22 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

I've taken the liberty of updating the patch, with a few minor changes:

range_equality - range_equals (like range_contains)
move identity check into range_equals
move comments before the code they describe (PEP7)
add whatsnew entry
remove check that range.__hash__ matches object.__hash__ in test_hash
change assertEqual into assertIs where appropriate (as suggested by Ezio)
additional comments and tests in Lib/test/test_range (ditto)

Sven, Ezio:  okay to apply this?

--
Added file: http://bugs.python.org/file23494/range-compare-v4.patch

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



[issue13201] Implement comparison operators for range objects

2011-10-22 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Hmm.  Why does my patch not get a 'review' button?

--

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



[issue13201] Implement comparison operators for range objects

2011-10-22 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Ah, there it is. Never mind. :-)

--

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



[issue10131] deepcopying an xml.dom.minidom.Document generates an invalid XML document

2011-10-22 Thread Yevgen Yampolskiy

Yevgen Yampolskiy genij.m...@gmail.com added the comment:

You can create object copy using both copy and pickle modules. 
I assume that identical results should be produced.

pickle handles minidom.Document correctly, however copy does not. 
Even if patch to NodeList will be applied, copy or pickle modules need to be 
adjusted to produce identical results.

From this view point copy module needs to be adjusted.

Here is the test code:

import copy, pickle
from xml.dom.minidom import NodeList

obj = NodeList()
obj.append('a')

obj2 = copy.deepcopy(obj)
print(obj2)

obj2 = pickle.loads(pickle.dumps(obj))
print(obj2)

Output (python 2.7-3.2):
['a', 'a']
['a']

--
nosy: +genij.math

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



[issue12406] msi.py needs updating for Python 3.3

2011-10-22 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Can't you use the normal algorithm for short names? I.e. KEYCER~1.PEM etc. Or 
doesn't it exist anymore?

--

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



[issue10925] Document pure Python version of integer-to-float correctly-rounded conversion

2011-10-22 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Thanks for the comments.  Here's an updated patch, that actually makes use of 
the pure Python version to test the built-in int-to-float conversion.

--
versions:  -Python 2.7, Python 3.2
Added file: http://bugs.python.org/file23495/pure_python_long_to_float_v2.patch

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



[issue13243] _Py_identifier should be _Py_IDENTIFER

2011-10-22 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

Good catch.  I see what happened.  7109f31300fb updated
Python/Python-ast.c but not Parser/asdl_c.py.  I will apply your patch 
shortly.  Thanks.

--
assignee:  - meador.inge
nosy: +meador.inge
stage:  - patch review

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



[issue13243] _Py_identifier should be _Py_IDENTIFER

2011-10-22 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

Oh, and just to be clear I reproduced the build break by doing:

./Parser/asdl_c.py -c ./Python ./Parser/Python.asdl
make

in a built tree.  The reason that this wasn't caught is that the make
rules have the ASDL files as dependencies on the AST C files.  So, the
C files are *not* updated unless the ASDL files are.

Maybe we should change the build system to always regenerate the files
or add something to automation that regenerates the AST C file every
time.

--

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



[issue13245] sched.py kwargs addition and default time functions

2011-10-22 Thread Chris Clark

New submission from Chris Clark clac...@gmail.com:

I ended up implementing my own sched.py equivalent as I needed kwargs support. 
This is my attempt to improve the stdlib, so I can throw my module way ;-)

Added kwargs support, and made argument optional. argument is still named 
argument, I would like to rename this args but I'm unclear on the backwards 
compat rules for stdlib, in theory it should be fine unless someone has code 
that treats argument as a keyword arg).

The scheduler init no long requires timer functions to be provided, it defaults 
to time.time, time.sleep as a helper to reduce repeated code for callers. This 
still allows callers to provide custom timer routines.

I added a few (non exhaustive) tests for the new additions.

It looks like there are a few pep8 improvements could be made to sched.py but 
I've not done that to reduce diffs and make it easier to see what I changed. 
Similar doc strings could be made more clear.

I snuck in a hack to the test so that the full test suite isn't needed, I do 
not expect that to be accepted :-) I don't have enough network bandwidth to 
pull the whole hg repo so I ended up pulling the tip version for 2.7 of sched 
and its test (as of 2011-10-22 this is 5110d723fbb1)

--
components: Library (Lib)
files: kwargs_def_timer.patch
keywords: patch
messages: 146180
nosy: clach04
priority: normal
severity: normal
status: open
title: sched.py kwargs addition and default time functions
type: feature request
versions: Python 2.7
Added file: http://bugs.python.org/file23496/kwargs_def_timer.patch

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



[issue13245] sched.py kwargs addition and default time functions

2011-10-22 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Hi, thanks for the patch!
2.7 receives only bug fixes, so your patch can't be applied to 2.7.
If the feature is accepted it can go to 3.3 though.

--
nosy: +ezio.melotti
stage:  - patch review
versions: +Python 3.3 -Python 2.7

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



[issue13243] _Py_identifier should be _Py_IDENTIFER

2011-10-22 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 941d015053c6 by Meador Inge in branch 'default':
Issue 13243: Rename _Py_identifier to _Py_IDENTIFIER in asdl_c.py
http://hg.python.org/cpython/rev/941d015053c6

--
nosy: +python-dev

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



[issue13243] _Py_identifier should be _Py_IDENTIFER

2011-10-22 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

Committed.  Thanks!

--
nosy:  -python-dev
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue12675] tokenize module happily tokenizes code with syntax errors

2011-10-22 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
nosy: +meador.inge

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



[issue1548891] shlex (or perhaps cStringIO) and unicode strings

2011-10-22 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 If you think it's fine to change this behavior, then yes :)

Well, the documented behaviour makes no sense.
Either it should raise TypeError or convert. Since write() converts, it's 
logical for the constructor to do so as well.

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

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



[issue1548891] shlex (or perhaps cStringIO) and unicode strings

2011-10-22 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 27ae7d4e1983 by Antoine Pitrou in branch '2.7':
Issue #1548891: The cStringIO.StringIO() constructor now encodes unicode
http://hg.python.org/cpython/rev/27ae7d4e1983

--
nosy: +python-dev

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



[issue13218] test_ssl failures on Ubuntu 11.10

2011-10-22 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Barry, perhaps you could try to know what in Ubuntu's OpenSSL build can lead to 
such failures?

--
nosy: +barry

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



[issue12675] tokenize module happily tokenizes code with syntax errors

2011-10-22 Thread Florent Xicluna

Changes by Florent Xicluna florent.xicl...@gmail.com:


--
nosy: +flox

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



[issue13246] Py_UCS4_strlen and friends needn't be public

2011-10-22 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

It seems there's no reason to document these functions which operate on 
null-terminated unicode arrays.

--
assignee: docs@python
components: Documentation
messages: 146187
nosy: docs@python, ezio.melotti, georg.brandl, haypo, loewis, pitrou
priority: normal
severity: normal
status: open
title: Py_UCS4_strlen and friends needn't be public
versions: Python 3.3

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



[issue13244] WebSocket schemes in urlparse

2011-10-22 Thread Jyrki Pulliainen

Jyrki Pulliainen jy...@dywypi.org added the comment:

I added a patch that adds support for WebSocket URL protocol.

However, a few pointers (and questions):

- The patch is now implemented according to Draft 17[1] of WebSocket protocol

- Draft 17 does not support fragments, it states that the fragments should be 
treated as a part of the URL, so I didn't add the ws and wss support in 
uses_fragments. However, the Draft 17 states also, that those should always be 
encoded. Should there be a special case for ws/wss URLs that have non-encoded 
number-signs in them, for example should we raise some sort of an exception?

[1] http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17

--
keywords: +patch
nosy: +nailor
Added file: http://bugs.python.org/file23497/issue13244.patch

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



[issue13244] WebSocket schemes in urlparse

2011-10-22 Thread Tobias Oberstein

Tobias Oberstein tobias.oberst...@tavendo.de added the comment:

fragment identifiers:

the spec says:

Fragment identifiers are meaningless in the context of WebSocket
URIs, and MUST NOT be used on these URIs.  The character # in URIs
MUST be escaped as %23 if used as part of the query component.

[see last line of my initial comment]

I nevertheless added the ws/wss schemes to urlparse.uses_fragment so that I can 
detect them being used and throw.

Does urllib throw when an URL contains a fragment identifier, but the scheme of 
the URL is not in urlparse.uses_fragment?

If so, thats fine and of course better than putting the burden of checking on 
the user.

==

Further, when # is to be used in a WS URL, it MUST be encoded, and if so, 
it's interpreted as part of the query component.

So in summary, I think the best would be:

urllib throws upon non-encoded #, and interpret it as part of the query 
component when encoded.

--

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



[issue13244] WebSocket schemes in urlparse

2011-10-22 Thread Tobias Oberstein

Tobias Oberstein tobias.oberst...@tavendo.de added the comment:

Well, thinking about it, %23 can also appear in a percent encoded path 
component.

I don't get the conditional ..if used as part of the query component in the 
spec.

--

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



[issue13246] Py_UCS4_strlen and friends needn't be public

2011-10-22 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

If they aren't public, they should get an underscore.

All our API functions are either public or private; all public ones should be 
documented.

--

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



[issue13244] WebSocket schemes in urlparse

2011-10-22 Thread Jyrki Pulliainen

Jyrki Pulliainen jy...@dywypi.org added the comment:

Actually, if I get it right, it means that following url is valid:

  ws://example.com/something#somewhere/

and the # should be considered as being a part of the path. The spec does not 
say a thing should the # in path component be encoded, so I think it's safe to 
assume it should can be unencoded. However, following url

  ws://example.com/something?query=foo#bar

Is not considered to be valid, as the # is in the query part and is not 
escaped. So the valid would be:

  ws://example.com/something?query=foo%23bar

I think the motivation behind this is to reduce possible conflicts with 
browsers that might take the #-part as a fragment when it should be part of the 
query parameters. However, the confusion is still possible with # in path part.

My take on this would be to omit fragments and just parse the url as is without 
fragments. Encoding could be left to user, even in the case # is in query part.

--

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



[issue13244] WebSocket schemes in urlparse

2011-10-22 Thread Tobias Oberstein

Tobias Oberstein tobias.oberst...@tavendo.de added the comment:

I see how you interpret that sentence in the spec, but I would have read it 
differently:

invalid:

1. ws://example.com/something#somewhere
2. ws://example.com/something#somewhere/
3. ws://example.com/something#somewhere/foo
4. ws://example.com/something?query=foo#bar

valid:

5. ws://example.com/something%23somewhere
6. ws://example.com/something%23somewhere/
7. ws://example.com/something%23somewhere/foo
8. ws://example.com/something?query=foo%23bar

You would take 2. and 3. as valid, but 1. and 4. as invalid, right?
 
But you are right, the spec does not talk about # in path.

If above is a valid summary of the question, I'd better take that to the Hybi 
list to get feedback before rushing into anything with urllib ..

--

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



[issue13244] WebSocket schemes in urlparse

2011-10-22 Thread Jyrki Pulliainen

Jyrki Pulliainen jy...@dywypi.org added the comment:

I'd take only 4. as invalid, as the WebSocket (to my interpretation) do not 
have fragments, so it is assumed to be a part of the path in that case.

But yeah, a confirmation from HyBi would be great. Can you link to the 
discussion from here, if you ask them (in case it's possible)?

--

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



[issue13244] WebSocket schemes in urlparse

2011-10-22 Thread Tobias Oberstein

Tobias Oberstein tobias.oberst...@tavendo.de added the comment:

I'll ask (to be sure) and link.

However, after rereading the Hybi 17 section, it says


path = path-abempty, defined in [RFC3986], Section 3.3


And http://tools.ietf.org/html/rfc3986 says:


The path is terminated by the first question mark (?) or number sign (#) 
character, or by the end of the URI.


So my reading would be: non-escaped # can never be part of path for a WebSocket 
URL by reference of RFC3986.

--

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



[issue11183] Finer-grained exceptions for the ssl module

2011-10-22 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Here is a patch. It adds SSLZeroReturnError, SSLWantReadError, 
SSLWantWriteError, SSLSyscallError and SSLEOFError.

--
keywords: +patch
Added file: http://bugs.python.org/file23498/sslerrors.patch

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



[issue11183] Finer-grained exceptions for the ssl module

2011-10-22 Thread Antoine Pitrou

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


--
stage: needs patch - patch review

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



[issue13244] WebSocket schemes in urlparse

2011-10-22 Thread Tobias Oberstein

Tobias Oberstein tobias.oberst...@tavendo.de added the comment:

here the links to the question on the Hybi list:

http://www.ietf.org/mail-archive/web/hybi/current/msg09257.html

and

http://www.ietf.org/mail-archive/web/hybi/current/msg09258.html
http://www.ietf.org/mail-archive/web/hybi/current/msg09243.html

==

I'll track those and come back when there is a conclusion ..

--

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



[issue13201] Implement comparison operators for range objects

2011-10-22 Thread Sven Marnach

Sven Marnach s...@marnach.net added the comment:

Thanks for the updates, Mark.  I was just about to look into this again.  The 
changes are fine with me.

--

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



[issue13201] Implement comparison operators for range objects

2011-10-22 Thread Sven Marnach

Sven Marnach s...@marnach.net added the comment:

Victor Stinner wrote:
 If would be nice to have a PyLong_CompareLong() function.

In most cases, global variables Py_Zero and Py_One would be enough to simplify 
this kind of code.

--

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



[issue6988] shlex.split() converts unicode input to UCS-4 output

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

$ ./python 
Python 2.7.2+ (2.7:27ae7d4e1983+, Oct 23 2011, 00:09:06) 
[GCC 4.6.1] on linux2
Type help, copyright, credits or license for more information.
 import shlex
 shlex.split(u'Hello, World!')
['Hello,', 'World!']

This was fixed indirectly by a StringIO fix in 27ae7d4e1983, for #1548891.

--
nosy: +eric.araujo

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



[issue13140] ThreadingMixIn.daemon_threads is not honored when parent is daemon

2011-10-22 Thread Florent Xicluna

Florent Xicluna florent.xicl...@gmail.com added the comment:

I would prefer to preserve the inheritance by default, and to change the 
daemonic attribute only if it is explicitly set to True or False.
This way it will be backward compatible.

Patch attached.

--
versions:  -Python 2.6
Added file: http://bugs.python.org/file23499/issue13140.diff

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



[issue13244] WebSocket schemes in urlparse

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 Actually, if I get it right, it means that following url is valid:
  ws://example.com/something#somewhere/
I don’t think so.  The URI syntax RFC is generic, so a scheme spec cannot 
redefine the parsing to mean that in your above example, there is no fragment 
and the path is /something#somewhere/ .  I believe the spec means that a # in 
any component must be %-escaped.

 Does urllib throw when an URL contains a fragment identifier, but the scheme 
 of the URL is not
 in urlparse.uses_fragment?
Could you try it in a shell and tell us?  BTW, please don’t use “throw” in a 
code or doc patch: exceptions are raised, throw is related but different 
generator method.

--
nosy: +eric.araujo

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



[issue13244] WebSocket schemes in urlparse

2011-10-22 Thread Tobias Oberstein

Tobias Oberstein tobias.oberst...@tavendo.de added the comment:

sorry for throw .. somewhat bad habit (stemming from wandering between 
languages).

uses_fragment extended:

[autobahn@autobahnhub ~/Autobahn]$ python
Python 2.7.1 (r271:86832, Dec 13 2010, 15:52:15)
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd8
Type help, copyright, credits or license for more information.
 import urlparse
 wsschemes = [ws, wss]
 urlparse.uses_relative.extend(wsschemes)
 urlparse.uses_netloc.extend(wsschemes)
 urlparse.uses_params.extend(wsschemes)
 urlparse.uses_query.extend(wsschemes)
 urlparse.uses_fragment.extend(wsschemes)
 urlparse.urlparse(ws://example.com/something#somewhere/)
ParseResult(scheme='ws', netloc='example.com', path='/something', params='', 
query='', fragment='somewhere/')
 urlparse.urlparse(ws://example.com/something#somewhere)
ParseResult(scheme='ws', netloc='example.com', path='/something', params='', 
query='', fragment='somewhere')


= fragment extracted


uses_fragment not extended:

[autobahn@autobahnhub ~/Autobahn]$ python
Python 2.7.1 (r271:86832, Dec 13 2010, 15:52:15)
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd8
Type help, copyright, credits or license for more information.
 import urlparse
 wsschemes = [ws, wss]
 urlparse.uses_relative.extend(wsschemes)
 urlparse.uses_netloc.extend(wsschemes)
 urlparse.uses_params.extend(wsschemes)
 urlparse.uses_query.extend(wsschemes)
 urlparse.urlparse(ws://example.com/something#somewhere/)
ParseResult(scheme='ws', netloc='example.com', path='/something#somewhere/', 
params='', query='', fragment='')
 urlparse.urlparse(ws://example.com/something#somewhere)
ParseResult(scheme='ws', netloc='example.com', path='/something#somewhere', 
params='', query='', fragment='')


= no fragment extracted, but interpreted as part of path component
= no exception raised

The answer on Hybi outstanding, but I would interpret Hybi-17: # must always be 
escaped, both in path and query components. Fragment components are not 
allowed. Thus, unescaped # can never appear in WS URL. Further, it must not be 
ignored, but the WS handshake failed.

If this should indeed be the correct reading of the WS spec, then I think 
urlparse should raise an exception upon unescaped # within URLs from ws/wss 
schemes.

--

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



[issue13247] os.path.abspath returns unicode paths as question marks

2011-10-22 Thread Yuval Greenfield

New submission from Yuval Greenfield ubershme...@gmail.com:

For Python 2:

Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit 
(Intel)] on win32
 os.path.abspath('.')
'C:\\Users\\yuv\\Desktop\\YuvDesktop\\??'
 os.path.abspath(u'.')
u'C:\\Users\\yuv\\Desktop\\YuvDesktop\\\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5'

For Python 3:
Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] 
on win32
 os.path.abspath('.')
'C:\\Users\\yuv\\Desktop\\YuvDesktop\\\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5'
 os.path.abspath(b'.')
b'C:\\Users\\yuv\\Desktop\\YuvDesktop\\??'


The returned path with question marks is completely useless. It's better that 
python throw an error than return the question marks. Another option is to try 
and get the ascii version of the path, I believe windows has one.

--
components: Library (Lib)
messages: 146204
nosy: ubershmekel
priority: normal
severity: normal
status: open
title: os.path.abspath returns unicode paths as question marks
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

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



[issue13244] WebSocket schemes in urlparse

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 urlparse.urlparse(ws://example.com/something#somewhere)
ParseResult(scheme='ws', netloc='example.com', path='/something#somewhere', 
params='', query='', fragment='')

This makes me sad.  I thought we had fixed urllib months ago to follow the damn 
rules that have been in a bunch of RFCs for years.

--

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



[issue13247] os.path.abspath returns unicode paths as question marks

2011-10-22 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +haypo
versions:  -Python 3.4

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



[issue6210] Exception Chaining missing method for suppressing context

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

I like the class method idea, but not the no_context name.  Would 
without_context be too long?

I don’t dislike raise MyError from None, but a method will be more easy to 
search and will help people reading code and discovering this unknown idiom.  I 
think it’s also easier to implement than a syntax change.

--

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



[issue11751] Increase distutils.filelist / packaging.manifest test coverage

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 Still can't reproduce
It only shows in 2.4 and 2.5.

 (though I got one failure and three other errors)
If these are not covered in #13170, please add them to that report.

--

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



[issue11751] Increase distutils.filelist / packaging.manifest test coverage

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

I’ve found the reason: #6665.  fnmatch.translate (used by _glob_to_re was 
changed to support filenames with embedded newlines.  I don’t think it’s a 
concern for us: As the input we give to _glob_to_re comes one line at a time 
from a file, we just never have filenames with newlines.

We can do one of these things for d2:
- Special-case 2.4 and 2.5 in the tests.
- Tweak _glob_to_re so that it changes the generated regex to match what we get 
in newer versions.
- Tweak _glob_to_re to remove the inline flags, as we don’t need them.

I think the last idea would be best.

--

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



[issue12930] reindent.py inserts spaces in multiline literals

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

I want to look at this but lack time right now.  Could someone make one 
up-to-date patch with all changes, code and tests?  It will be much easier to 
review and test than an archive.

--

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



[issue13238] Add shell command helpers to shutil module

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 [snip rationale about why shutil and not subprocess]
I’m convinced (with one nit: sh in the shutil name does not ring a security 
alarm for me, as I understand it as “shell-like conveniences in nice, 
dont-do-nasty-things-with-stings Python” :) but the shell in check_shell_call 
does warn).

Automatic call of shlex.quote is an argument in favor of the new helpers.

--

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



[issue13238] Add shell command helpers to shutil module

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

s/stings/strings/

--

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



[issue12930] reindent.py inserts spaces in multiline literals

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Forget that, there are no automated tests for tools.  So, a text version of the 
files would be nice.

--

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



[issue12930] reindent.py inserts spaces in multiline literals

2011-10-22 Thread Caio Romão

Caio Romão caioro...@gmail.com added the comment:

Attaching files from tarball as requested. See 
http://bugs.python.org/issue12930#msg144314 for explanation

--
Added file: http://bugs.python.org/file23500/testfile-original.py

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



[issue12930] reindent.py inserts spaces in multiline literals

2011-10-22 Thread Caio Romão

Changes by Caio Romão caioro...@gmail.com:


Added file: http://bugs.python.org/file23501/testfile-expected.py

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



[issue12930] reindent.py inserts spaces in multiline literals

2011-10-22 Thread Caio Romão

Changes by Caio Romão caioro...@gmail.com:


Added file: http://bugs.python.org/file23502/testfile-issue.py

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



[issue13132] distutils sends non-RFC compliant HTTP request

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

The requests we send are multipart/form-data, so the RFC exception for text/* 
would not apply.  I’m closing this bug as a duplicate and will ask on the other 
one if we should reopen it.

--
resolution:  - duplicate
stage:  - committed/rejected
status: pending - closed
superseder:  - packaging upload/register should use CRLF in HTTP requests

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



[issue10510] packaging upload/register should use CRLF in HTTP requests

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Mitchell Hashimoto provided this link on a duplicate report:

 RFC2616 page 31 (http://tools.ietf.org/html/rfc2616#page-31) states that 
 headers must be separated
 by CRLF. Specifically, the above \n\n for the header separator is causing 
 issues with some
 minimal RFC-compliant web servers.

So I checked the RFC carefully again and found this:

 http://tools.ietf.org/html/rfc2616#section-3.7.1

 When in canonical form, media subtypes of the text type use CRLF as
 the text line break. HTTP relaxes this requirement and allows the
 transport of text media with plain CR or LF alone representing a line
 break when it is done consistently for an entire entity-body. HTTP
 applications MUST accept CRLF, bare CR, and bare LF as being
 representative of a line break in text media received via HTTP

The requests we send are multipart/form-data, so the RFC exception for text/* 
would not apply.  On one hand, I don’t think we can say that sending LF is not 
a bug, on the other hand, I believe nearly all HTTP servers just accept all 
newlines anyway.

--
nosy: +mitchellh

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



[issue10510] distutils upload/register should use CRLF in HTTP requests

2011-10-22 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
resolution: duplicate - 
stage: committed/rejected - 
superseder: Factor out common code for d2 commands register, upload and 
upload_docs - 
title: packaging upload/register should use CRLF in HTTP requests - distutils 
upload/register should use CRLF in HTTP requests

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



[issue13237] subprocess docs should emphasise convenience functions

2011-10-22 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo

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



[issue13224] Change str(class) to return only the class name

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Here’s the python-ideas thread: 
http://mail.python.org/pipermail/python-ideas/2011-October/thread.html#12459

--

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



[issue1548891] shlex (or perhaps cStringIO) and unicode strings

2011-10-22 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 0b39f2486314 by Éric Araujo in branch '2.7':
Note that the #1548891 fix indirectly fixes shlex (#6988, #1170)
http://hg.python.org/cpython/rev/0b39f2486314

--

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

FTR, distribute recently committed two fixes for the exe wrappers: 
https://bitbucket.org/tarek/distribute/issue/238 and 
https://bitbucket.org/tarek/distribute/issue/207

--

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



[issue1170] shlex have problems with parsing unicode

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

$ ./python 
Python 2.7.2+ (2.7:27ae7d4e1983+, Oct 23 2011, 00:09:06) 
[GCC 4.6.1] on linux2
Type help, copyright, credits or license for more information.
 import shlex
 shlex.split(u'Hello, World!')
['Hello,', 'World!']

This bug was fixed indirectly by a StringIO fix in 27ae7d4e1983, for #1548891.  
BTW, this report was a duplicate of #6988, closed a year ago.

Python 2.7.3 will finally support unicode in shlex, so the doc change requested 
in this report is outdated.  However, I still want to do something for this.  
I’ve noticed that shlex.split’s argument can be a file-like object, and I 
wonder if passing a StringIO.StringIO(my_unicode_string) wouldn’t work.  If 
such a short recipe works, I’m all for including it in the 2.7 docs for users 
of older versions.  If a longer recipe is needed, then ActiveState’s Python 
Cookbook would be more appropriate, and I’ll add a link to the docs.  If it’s 
very long and requires a PyPI project, then I’m willing to link to that.

--

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



[issue1170] shlex have problems with parsing unicode

2011-10-22 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

The second message in this page reports that StringIO.StringIO works, but when 
I pass a unicode string with non-ASCII chars there’s a method call that fails 
because of implicit unicode-to-str conversion:

Traceback (most recent call last):
  File /usr/lib/python2.7/shlex.py, line 150, in read_token
elif nextchar in self.wordchars:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xdf in position 63: 
ordinal not in range(128)

I’ll try to create a Shlex instance, replace self.wordchars with a decoded 
version and try again.

--

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