Author vstinner
Recipients amaury.forgeotdarc, benjamin.peterson, brett.cannon, sjmachin, vstinner
Date 2009-02-18.00:22:10
SpamBayes Score 6.15297e-12
Marked as misclassified No
Message-id <>
@benjamin.peterson: I don't see you changes... I read both patches 
carrefuly and I saw:
 - source_as_string(): remove "cf.cf_flags = supplied_flags | 
 - rename PyTokenizer_FromUnicode() to PyTokenizer_FromUTF8()
 - update NEWS

I don't understand the change in source_as_string(). Except of that, 
it looks correct.

> The one problem is that it causes test_coding to fail because 
> coding cookies are ignored and not checked to see if they
> are the same as the encoding of the file.

The test have to fail, but the error is not the the compile() patch, 
but in the test. Input file is opened as unicode instead of bytes. A 
propose this patch to fix the test:

Index: Lib/test/
--- Lib/test/     (révision 69723)
+++ Lib/test/     (copie de travail)
@@ -17,7 +17,7 @@

         path = os.path.dirname(__file__)
         filename = os.path.join(path, module_name + '.py')
-        fp = open(filename, encoding='utf-8')
+        fp = open(filename, 'rb')
         text =
         self.assertRaises(SyntaxError, compile, text, 
filename, 'exec')
Date User Action Args
2009-02-18 00:22:12vstinnersetrecipients: + vstinner, brett.cannon, sjmachin, amaury.forgeotdarc, benjamin.peterson
2009-02-18 00:22:12vstinnersetmessageid: <>
2009-02-18 00:22:10vstinnerlinkissue4626 messages
2009-02-18 00:22:10vstinnercreate