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)

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

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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>
Project 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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.4