rpms/python-cherrypy2/F-12 python-cherrypy-deprecation.patch, NONE, 1.1 python-cherrypy2.spec, 1.9, 1.10

Toshio くらとみ toshio at fedoraproject.org
Sat Jan 9 01:36:14 UTC 2010


Author: toshio

Update of /cvs/pkgs/rpms/python-cherrypy2/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23761

Modified Files:
	python-cherrypy2.spec 
Added Files:
	python-cherrypy-deprecation.patch 
Log Message:

* Fri Dec 4 2009 Toshio Kuratomi <toshio at fedoraproject.org> - 2.3.0-11
- Fix deprecation warnings.
- Change setuptools BuildRequirement as we're back to one package in F-13.


python-cherrypy-deprecation.patch:
 filters/sessionfilter.py |    8 ++++++--
 lib/cptools.py           |    8 +++++---
 2 files changed, 11 insertions(+), 5 deletions(-)

--- NEW FILE python-cherrypy-deprecation.patch ---
Index: CherryPy-2.3.0/cherrypy/lib/cptools.py
===================================================================
--- CherryPy-2.3.0.orig/cherrypy/lib/cptools.py
+++ CherryPy-2.3.0/cherrypy/lib/cptools.py
@@ -1,6 +1,8 @@
 """Tools which both CherryPy and application developers may invoke."""
-
-import md5
+try:
+    from hashlib import md5
+except ImportError:
+    from md5 import new as md5
 import mimetools
 import mimetypes
 mimetypes.init()
@@ -99,7 +101,7 @@ def validate_etags(autotags=False):
     if (not etag) and autotags:
         if status == 200:
             etag = response.collapse_body()
-            etag = '"%s"' % md5.new(etag).hexdigest()
+            etag = '"%s"' % md5(etag).hexdigest()
             response.headers['ETag'] = etag
     
     response.ETag = etag
Index: CherryPy-2.3.0/cherrypy/filters/sessionfilter.py
===================================================================
--- CherryPy-2.3.0.orig/cherrypy/filters/sessionfilter.py
+++ CherryPy-2.3.0/cherrypy/filters/sessionfilter.py
@@ -30,7 +30,11 @@ try:
 except ImportError:
     import pickle
 import random
-import sha
+try:
+    from hashlib import sha1
+except ImportError:
+    from sha import new as sha1
+
 import time
 import thread
 import threading
@@ -450,7 +454,7 @@ except (AttributeError, NotImplementedEr
     # os.urandom not available until Python 2.4. Fall back to random.random.
     def generate_session_id():
         """Return a new session id."""
-        return sha.new('%s' % random.random()).hexdigest()
+        return sha1('%s' % random.random()).hexdigest()
 else:
     def generate_session_id():
         """Return a new session id."""


Index: python-cherrypy2.spec
===================================================================
RCS file: /cvs/pkgs/rpms/python-cherrypy2/F-12/python-cherrypy2.spec,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- python-cherrypy2.spec	12 Aug 2009 22:18:11 -0000	1.9
+++ python-cherrypy2.spec	9 Jan 2010 01:36:14 -0000	1.10
@@ -2,7 +2,7 @@
 
 Name:           python-cherrypy2
 Version:        2.3.0
-Release:        10%{?dist}
+Release:        11%{?dist}
 Summary:        A pythonic, object-oriented web development framework
 Group:          Development/Libraries
 License:        BSD
@@ -13,11 +13,12 @@ BuildRoot:      %{_tmppath}/%{name}-%{ve
 Patch0:         python-cherrypy-tutorial-doc.patch
 Patch1:         python-cherrypy-2.3.0-EINTR.patch
 Patch2:         python-cherrypy-2.3.0-py26-test.patch
+Patch3:         python-cherrypy-deprecation.patch
 
 BuildArch:      noarch
 
 BuildRequires:  python-devel
-%if 0%{?fedora} >= 8
+%if 0%{?fedora} && 0%{?fedora} <= 12
 BuildRequires: python-setuptools-devel
 %else
 BuildRequires: python-setuptools
@@ -38,6 +39,7 @@ CherryPy.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1 -b .depr
 
 %{__sed} -i 's/\r//' CHANGELOG.txt README.txt CHERRYPYTEAM.txt cherrypy/tutorial/README.txt
 cp -p %{SOURCE1} .
@@ -65,6 +67,10 @@ rm -rf $RPM_BUILD_ROOT
 %{python_sitelib}/*
 
 %changelog
+* Fri Dec 4 2009 Toshio Kuratomi <toshio at fedoraproject.org> - 2.3.0-11
+- Fix deprecation warnings.
+- Change setuptools BuildRequirement as we're back to one package in F-13.
+
 * Wed Aug 12 2009 Toshio Kuratomi <toshio at fedoraproject.org> - 2.3.0-10
 - Remove the touch of easy_install.pth.  It's not necessary and leads to file
   conflicts with other packages.




More information about the fedora-extras-commits mailing list