#4975: [with patch, positive review] Sage 3.2.2 chokes on utf-8 encoded files
----------------------------+-----------------------------------------------
 Reporter:  mkasperski      |        Owner:  mhansen 
     Type:  defect          |       Status:  reopened
 Priority:  critical        |    Milestone:  sage-3.3
Component:  user interface  |   Resolution:          
 Keywords:                  |  
----------------------------+-----------------------------------------------
Changes (by mkasperski):

  * status:  closed => reopened
  * resolution:  fixed =>

Comment:

 I can confirm that applying this patch on 3.2.2 resolves the problem I
 initially reported
 (cd ..../sage-3.2.2-ubuntu32bit-intel-i686-Linux/local/bin;
  patch -p1 < .../trac_4975.patch)

 Still, something is wrong. The following file is handled properly:

 {{{
 # -*- coding: utf-8 -*-

 """
 Zażółć gęślą jaźń
 """

 print 1
 print u"Zażółć gęślą jaźń"
 }}}

 but if you comment out `print 1`:

 {{{
 # -*- coding: utf-8 -*-

 """
 Zażółć gęślą jaźń"
 """

 print u"Zażółć gęślą jaźń"
 }}}

 it fails again:

 {{{
 sage test2.sage
   File "test2.py", line 3
 SyntaxError: Non-ASCII character '\xc5' in file test2.py on line 4, but no
 encoding declared; see http://www.python.org/peps/pep-0263.html for
 details
 }}}

 What is interesting, removing any of elements (either a """ string, or
 print) makes the problem to disappear.

 Here is .py generated from the file above:

 {{{

 """
 Zażółć gęślą jaźń"
 """
 # -*- coding: utf-8 -*-
 # This file was *autogenerated* from the file test2.sage.
 from sage.all_cmdline import *   # import sage library

 print u"Zażółć gęślą jaźń"
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4975#comment:5>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to