bugpyFormex - Bugs: bug #56168, running a script from the GUI...

 
 

bug #56168: running a script from the GUI fails if python file special characters (Python3)

Submitter:  francesco <francio>
Submitted:  Fri 19 Apr 2019 05:04:14 AM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 19 Apr 2019 07:17:47 AM UTC, comment #1: 

Well, it worked rater by accident in Python2.
Did you have an encoding declared in the source?

You should only be using utf-8 encoding now.
E.g., here is a script I executed:


print("äç°ø")  # ¡°¿


and it properly prints äç°ø




Benedict Verhegghe <bverheg>
Group administrator
Fri 19 Apr 2019 05:04:14 AM UTC, original submission:  

A script failed to run in python3 (it was working in python 2)
as there was a comment with a special character ° (degree sign)
error below

Running script (test.py)
Traceback (most recent call last):
  File "/home/francesco/pyformex/pyformex/gui/draw.py", line 605, in play
   
runAny(refresh=refresh)
  File "/home/francesco/pyformex/pyformex/script.py", line 674, in runAny
   
return runScript(appname, argv)
  File "/home/francesco/pyformex/pyformex/script.py", line 529, in runScript
   
scr = checkPrintSyntax(fn)
  File "/home/francesco/pyformex/pyformex/script.py", line 466, in checkPrintSyntax
   
script = f.read()
  File "/usr/lib/python3.6/codecs.py", line 321, in decode
   
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError
:
'utf-8' codec can't decode byte 0xb0 in position 7531: invalid start byte

francesco <francio>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bverheg (Posted a comment)
  • -email is unavailable- added by francio (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-07-07 bverheg StatusNone Invalid
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code