[Python-checkins] r85861 - in python/branches/py3k/Lib: shlex.py test/test_sax.py test/test_shlex.py test/test_unicode.py

antoine.pitrou python-checkins at python.org
Wed Oct 27 20:52:48 CEST 2010


Author: antoine.pitrou
Date: Wed Oct 27 20:52:48 2010
New Revision: 85861

Log:
Recode modules from latin-1 to utf-8



Modified:
   python/branches/py3k/Lib/shlex.py
   python/branches/py3k/Lib/test/test_sax.py
   python/branches/py3k/Lib/test/test_shlex.py
   python/branches/py3k/Lib/test/test_unicode.py

Modified: python/branches/py3k/Lib/shlex.py
==============================================================================
--- python/branches/py3k/Lib/shlex.py	(original)
+++ python/branches/py3k/Lib/shlex.py	Wed Oct 27 20:52:48 2010
@@ -1,4 +1,3 @@
-# -*- coding: iso-8859-1 -*-
 """A lexical analyzer class for simple shell-like syntaxes."""
 
 # Module and documentation by Eric S. Raymond, 21 Dec 1998
@@ -35,8 +34,8 @@
         self.wordchars = ('abcdfeghijklmnopqrstuvwxyz'
                           'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_')
         if self.posix:
-            self.wordchars += ('ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ'
-                               'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ')
+            self.wordchars += ('ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ'
+                               'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ')
         self.whitespace = ' \t\r\n'
         self.whitespace_split = False
         self.quotes = '\'"'

Modified: python/branches/py3k/Lib/test/test_sax.py
==============================================================================
--- python/branches/py3k/Lib/test/test_sax.py	(original)
+++ python/branches/py3k/Lib/test/test_sax.py	Wed Oct 27 20:52:48 2010
@@ -1,4 +1,4 @@
-# regression test for SAX 2.0            -*- coding: iso-8859-1 -*-
+# regression test for SAX 2.0
 # $Id$
 
 from xml.sax import make_parser, ContentHandler, \
@@ -114,7 +114,7 @@
                           "<Donald Duck & Co>")
 
     def test_escape_extra(self):
-        self.assertEquals(escape("Hei på deg", {"å" : "å"}),
+        self.assertEquals(escape("Hei pÃ¥ deg", {"Ã¥" : "å"}),
                           "Hei på deg")
 
     # ===== unescape
@@ -126,7 +126,7 @@
                           "<Donald Duck & Co>")
 
     def test_unescape_extra(self):
-        self.assertEquals(unescape("Hei på deg", {"å" : "&aring;"}),
+        self.assertEquals(unescape("Hei på deg", {"å" : "&aring;"}),
                           "Hei p&aring; deg")
 
     def test_unescape_amp_extra(self):

Modified: python/branches/py3k/Lib/test/test_shlex.py
==============================================================================
--- python/branches/py3k/Lib/test/test_shlex.py	(original)
+++ python/branches/py3k/Lib/test/test_shlex.py	Wed Oct 27 20:52:48 2010
@@ -1,4 +1,3 @@
-# -*- coding: iso-8859-1 -*-
 import unittest
 import os, sys, io
 import shlex
@@ -68,7 +67,7 @@
 foo\ bar|foo|\|bar|
 foo#bar\nbaz|foobaz|
 :-) ;-)|:|-|)|;|-|)|
-áéíóú|á|é|í|ó|ú|
+áéíóú|á|é|í|ó|ú|
 """
 
 posix_data = r"""x|x|
@@ -132,7 +131,7 @@
 foo\ bar|foo bar|
 foo#bar\nbaz|foo|baz|
 :-) ;-)|:-)|;-)|
-áéíóú|áéíóú|
+áéíóú|áéíóú|
 """
 
 class ShlexTest(unittest.TestCase):

Modified: python/branches/py3k/Lib/test/test_unicode.py
==============================================================================
--- python/branches/py3k/Lib/test/test_unicode.py	(original)
+++ python/branches/py3k/Lib/test/test_unicode.py	Wed Oct 27 20:52:48 2010
@@ -1,4 +1,3 @@
-# -*- coding: iso-8859-1 -*-
 """ Test script for the Unicode implementation.
 
 Written by Marc-Andre Lemburg (mal at lemburg.com).
@@ -403,11 +402,11 @@
         self.assertTrue("b0".isidentifier())
         self.assertTrue("bc".isidentifier())
         self.assertTrue("b_".isidentifier())
-        self.assertTrue("µ".isidentifier())
+        self.assertTrue("µ".isidentifier())
 
         self.assertFalse(" ".isidentifier())
         self.assertFalse("[".isidentifier())
-        self.assertFalse("©".isidentifier())
+        self.assertFalse("©".isidentifier())
         self.assertFalse("0".isidentifier())
 
     def test_isprintable(self):


More information about the Python-checkins mailing list