 +from random import random
 +from errno import EAGAIN
 +from zlib import compress, decompress
++from cPickle import dumps as pickle, loads as unpickle, PicklingError, UnpicklingError
  
  import xattr
  

         return r
 
     def _decode(clazz, name):
@@ -97,19 +95,41 @@
 
     def get(self, qname):
         try:
-            value = self.attrs[self._encode(qname)]
+            data = self.attrs[self._encode(qname)]
+            try:
+                value = decompress(data)
+            except zlib.error:
+                # Value is not compressed; data was stored by old
+                # code.  This is easy to handle, so let's keep
+                # compatibility here.
+                value = data
+            del data
         except KeyError:
             raise HTTPError(StatusResponse(
                 responsecode.NOT_FOUND,

===================================================================
--- twisted/web2/dav/xattrprops.py	(revision 19773)
+++ twisted/web2/dav/xattrprops.py	(working copy)
@@ -33,12 +33,19 @@
 
 import urllib
 import sys
