This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Pyton1.5.2: urllib.always_safe variable
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: delun, gvanrossum
Priority: normal Keywords:

Created on 2001-04-09 14:45 by delun, last changed 2022-04-10 16:03 by admin. This issue is now closed.

Messages (2)
msg4207 - (view) Author: HERMAN Etienne (delun) Date: 2001-04-09 14:45
Our environment is:
Python 1.5.2 (#1, Feb  1 2000, 16:32:16)  [GCC
egcs-2.91.66 19990314/Linux (egcs- on linux-i386)
LANG=fr_FR

Bug in the urllib.always_safe variable, it contains
accented characters :

>>> import urllib
>>> print urllib.always_safe
abcdefghijklmnopqrstuvwxyzßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ0123456789_,.-
>>> urllib.quote('élève')
'\351l\350ve'


>>> urllib.always_safe = 'abcdefghijklmnopqrstuvwxyz' +
'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + '0123456789' + '*' +
'_.-'
>>> urllib.quote('élève')
'%e9l%e8ve'

Etienne HERMAN
devel@logilab.fr
msg4208 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2001-04-10 19:18
Logged In: YES 
user_id=6380

Thanks; this was fixed in Python 2.x already.

We now simply do this in urllib.py

always_safe = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
               'abcdefghijklmnopqrstuvwxyz'
               '0123456789' '_.-')
History
Date User Action Args
2022-04-10 16:03:56adminsetgithub: 34299
2001-04-09 14:45:31deluncreate