rpms/pydot/F-11 pydot-need-quote.patch,NONE,1.1 pydot.spec,1.7,1.8

Tom Callaway spot at fedoraproject.org
Mon Jul 6 13:15:20 UTC 2009


Author: spot

Update of /cvs/extras/rpms/pydot/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11013/F-11

Modified Files:
	pydot.spec 
Added Files:
	pydot-need-quote.patch 
Log Message:
fix bugzilla 481540

pydot-need-quote.patch:

--- NEW FILE pydot-need-quote.patch ---
diff -up pydot-1.0.2/pydot.py.unicode pydot-1.0.2/pydot.py
--- pydot-1.0.2/pydot.py.unicode	2009-05-29 00:49:51.313446126 -0700
+++ pydot-1.0.2/pydot.py	2009-05-29 00:50:28.002459128 -0700
@@ -150,29 +150,17 @@ def needs_quotes( s ):
     If the string is one of the reserved keywords it will
     need quotes too.
     """
-        
+    # All keywords must be quoted
     if s in dot_keywords:
-        return False
-
-    chars = [ord(c) for c in s if ord(c)>0x7f or ord(c)==0]
-    if chars:
-        return False
-        
-    res = id_re_alpha_nums.match(s)
-    if not res:
-        res = id_re_num.match(s)
-        if not res:
-            res = id_re_dbl_quoted.match(s)
-            if not res:
-                res = id_re_html.match(s)
-                if not res:
-                    res = id_re_with_port.match(s)
-
-    if not res:
         return True
 
-    return False
+    # If any of these regexes match, then the string does not need quoting
+    if (id_re_alpha_nums.match(s) or id_re_num.match(s) or
+            id_re_dbl_quoted.match(s) or id_re_html.match(s) or
+            id_re_with_port.match(s)):
+        return False
 
+    return True
 
 
 def quote_if_necessary(s):


Index: pydot.spec
===================================================================
RCS file: /cvs/extras/rpms/pydot/F-11/pydot.spec,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- pydot.spec	26 Feb 2009 19:52:30 -0000	1.7
+++ pydot.spec	6 Jul 2009 13:14:50 -0000	1.8
@@ -2,12 +2,15 @@
 
 Name:		pydot
 Version:	1.0.2
-Release:	3%{?dist}
+Release:	4%{?dist}
 License:	MIT
 Group:		System Environment/Libraries
 Summary:	Python interface to Graphviz's Dot language
 URL:		http://code.google.com/p/pydot/
 Source0:	http://pydot.googlecode.com/files/pydot-%{version}.tar.gz
+# Fix bugzilla 481540, sent upstream in Issue 23
+# http://code.google.com/p/pydot/issues/detail?id=23
+Patch0:		pydot-need-quote.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:	pyparsing python-devel
 Requires:	graphviz, pyparsing
@@ -24,6 +27,7 @@ tools dot, neato, twopi.
 
 %prep
 %setup -q
+%patch0 -p1 -b .need-quote
 
 %build
 %{__python} setup.py build
@@ -44,6 +48,9 @@ rm -rf $RPM_BUILD_ROOT
 %{python_sitelib}/*
 
 %changelog
+* Mon Jul  6 2009 Tom "spot" Callaway <tcallawa at redhat.com> - 1.0.2-4
+- fix pydot crash with accented character (bugzilla 481540)
+
 * Thu Feb 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.0.2-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 




More information about the fedora-extras-commits mailing list