[Python-modules-commits] [python-dsv] 06/12: avoid-unicoditis

Aaron M. Ucko ucko at moszumanska.debian.org
Wed Jan 25 03:44:39 UTC 2017


This is an automated email from the git hooks/post-receive script.

ucko pushed a commit to branch master
in repository python-dsv.

commit c7ce725083c0a83a0aa82314a7e7acf60a3e3003
Author: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
Date:   Wed Aug 27 23:33:10 2014 -0400

    avoid-unicoditis
    
    ===================================================================
    
    Gbp-Pq: Name 03-avoid-unicoditis.patch
---
 DSV/DSV.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/DSV/DSV.py b/DSV/DSV.py
index b17a91b..a925dd7 100644
--- a/DSV/DSV.py
+++ b/DSV/DSV.py
@@ -486,8 +486,14 @@ def importDSV(input, delimiter = ',', textQualifier = '"', columns = 0,
       list of lists of data
     """
     if type(input) != type([]):
-        raise InvalidData, "expected list of lists of strings"  
-    if type(delimiter) != type('') or not delimiter:
+        raise InvalidData, "expected list of lists of strings"
+    # Try to convert Unicode delimiters back to ASCII (wxPython can be
+    # overenthusiastic), but ultimately support either.
+    try:
+        delimiter = delimiter.encode()
+    except:
+        pass
+    if (type(delimiter) != str and type(delimiter) != unicode) or not delimiter:
         raise InvalidDelimiter, `delimiter`
 
 ##    if textQualifier:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-dsv.git



More information about the Python-modules-commits mailing list