[CMF-checkins] CVS: CMF - slurp_release.py:1.7

Jens Vagelpohl jens at dataflake.org
Thu Mar 24 15:05:24 EST 2005


Update of /cvs-repository/CMF
In directory cvs.zope.org:/tmp/cvs-serv25360

Modified Files:
	slurp_release.py 
Log Message:
- Forward-port fixes that were inexplicably added on a single branch only


=== CMF/slurp_release.py 1.6 => 1.7 ===
--- CMF/slurp_release.py:1.6	Thu Mar 24 14:58:29 2005
+++ CMF/slurp_release.py	Thu Mar 24 15:05:23 2005
@@ -7,6 +7,7 @@
 import httplib
 import getopt
 import base64
+import mimetypes
 
 CVSROOT = ':pserver:anonymous at cvs.zope.org:/cvs-repository'
 
@@ -176,10 +177,16 @@
         """
         URL = ( '/Products/CMF/%s/%s' % ( self._version_id, filename ) )
         body = open( filename ).read()
+        content_type, content_enc = mimetypes.guess_type(URL)
+        headers = self._getAuthHeaders()
+        headers['Content-Length'] = len(body)
+        headers['Content-Type'] = content_type
+        headers['Content-Encoding'] = content_enc
 
         conn = httplib.HTTPConnection( 'www.zope.org' )
         print 'PUTting file, %s, to URL, %s' % ( filename, URL )
-        conn.request( 'PUT', URL, body, self._getAuthHeaders() )
+
+        conn.request( 'PUT', URL, body, headers )
         response = conn.getresponse()
         if int( response.status ) not in ( 200, 201, 204, 302 ):
             raise ValueError, 'Failed: %s (%s)' % ( response.status



More information about the CMF-checkins mailing list