[issue1698] urlparse and usernames containing @

2007-12-25 Thread Olivier Croquette

New submission from Olivier Croquette:

Some servers allow the @ character is usernames. It gives URLs like:
ftp://[EMAIL PROTECTED]@host/dir

[EMAIL PROTECTED] could for example by an email address.

I am not sure if this is RFC compliant. What's sure is that is makes
trouble with urlparse: 


>>> from urlparse import urlparse
>>> p = urlparse("ftp://[EMAIL PROTECTED]@host2/dir") 
>>> print p.username
user
>>> print p.hostname
[EMAIL PROTECTED]

By using rsplit instead of split in lib/python2.5/urlparse.py, the
problem can be solved.

--
components: Library (Lib)
messages: 58990
nosy: ocroquette
severity: normal
status: open
title: urlparse and usernames containing @
type: behavior
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1698>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1698] urlparse and usernames containing @

2007-12-26 Thread Olivier Croquette

Olivier Croquette added the comment:

Hi!

Thanks for the reply!

The problem right now is that urlparse parses silently an URL which is
not compliant, but does the wrong thing with it (since usernames can
contain @, and hostname can not, it's a more logical thing to parse from
the right using rsplit instead of split).

I see two possibilities to address that:

1. return a parse error if the URL contains two raw @
This way users and app developers will notice the problem rapidly

2. still accept this malformed URLs, but do what the user expects

Both solutions seem to me better than the current behaviour, so I would
say a change is necessary anyways.

PS: will urlparse transform an encoded "@" in the username when
.username is called, or does the application have to decode explicitely?

Olivier

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1698>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1698] urlparse and usernames containing @

2007-12-26 Thread Olivier Croquette

Olivier Croquette added the comment:

See also the related bug on duplicity:
http://savannah.nongnu.org/bugs/?21475

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1698>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1698] urlparse and usernames containing @

2007-12-26 Thread Olivier Croquette

Olivier Croquette added the comment:

And about the decoding, sorry, it's clear from your snippets that
urlparse doesn't do it:
>>> print q.username
user%40xyz

Maybe it should do it, I am not sure. What do you think? It would save
work for the module user.

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1698>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37351] Drop libpython38.a from Windows release

2020-11-04 Thread Olivier Croquette


Olivier Croquette  added the comment:

I don't know what version of gendef is meant, but the one from MSYS2 / MinGW64 
doesn't output the result on stdout, but rather writes the file "python38.def" 
itself. So the commands are the following:

cd libs
gendef ..\python38.dll
dlltool --dllname python38.dll --def python38.def --output-lib libpython38.a

--
nosy: +ocroquette

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