<br><font size=2 face="sans-serif">hello</font>
<br>
<br><font size=2 face="sans-serif">I'm using the python wrapper for memcached
in it's version </font>
<br><font size=2 face="sans-serif">__author__ = "Evan
Martin <martine@danga.com>"</font>
<br><font size=2 face="sans-serif">__version__ = "1.36"</font>
<br><font size=2 face="sans-serif">__copyright__ = "Copyright (C)
2003 Danga Interactive"</font>
<br><font size=2 face="sans-serif">__license__ = "Python"</font>
<br>
<br><font size=2 face="sans-serif">I can't figure out if this is the latest
since the verion available in the svn repository is </font>
<br><font size=2 face="sans-serif">http://code.sixapart.com/svn/memcached/trunk/api/python/memcache.py</font>
<br><font size=3><tt>__author__ = "Evan Martin <martine@danga.com>"<br>
__version__ = "1.2"<br>
__copyright__ = "Copyright (C) 2003 Danga Interactive"<br>
__license__ = "Python"</tt></font>
<br>
<br>
<br><font size=2 face="sans-serif">anyway, my concern is that version 1.36
checks key validity with the followinf function, that excludes spaces char
(ascii32)</font>
<br><font size=2 face="sans-serif">as being 'control characters'. </font>
<br>
<br><font size=2 face="sans-serif">I was wondering is this is correct.
</font>
<br><font size=2 face="sans-serif">and also wondering why other chars as
DEL(ascii127) are not excluded </font>
<br>
<br><font size=2 face="sans-serif">thanks for your clues </font>
<br>
<br><font size=2 face="sans-serif">jacques</font>
<br>
<br>
<br>
<br><font size=2 face="sans-serif">def check_key(key, key_extra_len=0):</font>
<br><font size=2 face="sans-serif"> """Checks
sanity of key. Fails if:</font>
<br><font size=2 face="sans-serif"> Key length
is > SERVER_MAX_KEY_LENGTH (Raises MemcachedKeyLength).</font>
<br><font size=2 face="sans-serif"> Contains
control characters (Raises MemcachedKeyCharacterError).</font>
<br><font size=2 face="sans-serif"> Is not a
string (Raises MemcachedStringEncodingError)</font>
<br><font size=2 face="sans-serif"> """</font>
<br><font size=2 face="sans-serif"> if not isinstance(key,
str):</font>
<br><font size=2 face="sans-serif"> raise Client.MemcachedStringEncodingError,
("Keys must be str()'s, not"</font>
<br><font size=2 face="sans-serif">
"unicode. Convert your unicode strings using "</font>
<br><font size=2 face="sans-serif">
"mystring.encode(charset)!")</font>
<br>
<br><font size=2 face="sans-serif"> if isinstance(key, basestring):</font>
<br><font size=2 face="sans-serif"> if len(key)
+ key_extra_len > SERVER_MAX_KEY_LENGTH:</font>
<br><font size=2 face="sans-serif">
raise Client.MemcachedKeyLengthError, ("Key length is > %s"</font>
<br><font size=2 face="sans-serif">
% SERVER_MAX_KEY_LENGTH)</font>
<br><font size=2 face="sans-serif"> for char
in key:</font>
<br><font size=2 face="sans-serif"> if
ord(char) < 33:</font>
<br><font size=2 face="sans-serif">
raise Client.MemcachedKeyCharacterError, "Control characters not allowed"</font>
<br>
<br>
<br>
<br>
<br>
<br>
<br><pre>This message and any attachments (the "message") is intended solely for the addressees and is confidential.
If you receive this message in error, please delete it and immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.
The internet can not guarantee the integrity of this message.
BNP PARIBAS (and its subsidiaries) shall (will) not therefore be liable for the message if modified.
Do not print this message unless it is necessary, consider the environment.
---------------------------------------------
Ce message et toutes les pieces jointes (ci-apres le "message") sont etablis a l'intention exclusive de ses destinataires et sont confidentiels. Si vous recevez ce
message par erreur, merci de le detruire et d'en avertir immediatement l'expediteur.
Toute utilisation de ce message non conforme a sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse.
L'internet ne permettant pas d'assurer l'integrite de ce message, BNP PARIBAS (et ses filiales) decline(nt) toute responsabilite au titre de ce message, dans l'hypothese ou il aurait ete modifie.
N'imprimez ce message que si necessaire, pensez a l'environnement.
</pre>