<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__ &nbsp; &nbsp;= &quot;Evan
Martin &lt;martine@danga.com&gt;&quot;</font>
<br><font size=2 face="sans-serif">__version__ = &quot;1.36&quot;</font>
<br><font size=2 face="sans-serif">__copyright__ = &quot;Copyright (C)
2003 Danga Interactive&quot;</font>
<br><font size=2 face="sans-serif">__license__ &nbsp; = &quot;Python&quot;</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__ &nbsp; &nbsp;= &quot;Evan Martin &lt;martine@danga.com&gt;&quot;<br>
__version__ &nbsp; = &quot;1.2&quot;<br>
__copyright__ = &quot;Copyright (C) 2003 Danga Interactive&quot;<br>
__license__ &nbsp; = &quot;Python&quot;</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">&nbsp; &nbsp; &quot;&quot;&quot;Checks
sanity of key. &nbsp;Fails if:</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Key length
is &gt; SERVER_MAX_KEY_LENGTH (Raises MemcachedKeyLength).</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Contains
control characters &nbsp;(Raises MemcachedKeyCharacterError).</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Is not a
string (Raises MemcachedStringEncodingError)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot;&quot;&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; if not isinstance(key,
str):</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; raise Client.MemcachedStringEncodingError,
(&quot;Keys must be str()'s, not&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &quot;unicode. &nbsp;Convert your unicode strings using &quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &quot;mystring.encode(charset)!&quot;)</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; if isinstance(key, basestring):</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; if len(key)
+ key_extra_len &gt; SERVER_MAX_KEY_LENGTH:</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;raise Client.MemcachedKeyLengthError, (&quot;Key length is &gt; %s&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;% SERVER_MAX_KEY_LENGTH)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; for char
in key:</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if
ord(char) &lt; 33:</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
raise Client.MemcachedKeyCharacterError, &quot;Control characters not allowed&quot;</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>