View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002196 | FreeCAD | Bug | public | 2015-07-20 11:12 | 2015-08-05 02:33 |
| Reporter | rparkins | Assigned To | yorik | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | no change required | ||
| Platform | PC | OS | Linux | OS Version | Ubuntu 14.04.2 L |
| Product Version | 0.15 | ||||
| Fixed in Version | 0.16 | ||||
| Summary | 0002196: Non-ASCII character in comment makes macro fail silently | ||||
| Description | A copyright symbol in a comment in macro causes the macro to do nothing at all when run. No error message or other output is generated. | ||||
| Steps To Reproduce | Run this macro. Nothing happens. Replace the © by (c). The macro runs and creates an object as expected. # Copyright © 2015 Richard P. Parkins, M. A. # All dimensions in millimeters tol = 0.2 # clearance tolerance in mm size = 10.0 # one little cube small = 6.0 # size of hole import Part from FreeCAD import Base import FreeCADGui if App.ActiveDocument == None: App.newDocument() App.setActiveDocument("Unnamed") App.ActiveDocument=App.getDocument("Unnamed") Gui.ActiveDocument=Gui.getDocument("Unnamed") v1 = Base.Vector(- size / 2, - size / 2, 0) b1 = Part.makeBox(size, size, size, v1) v1 = Base.Vector((2 * tol - small) * 0.707, 0, size + small - tol) v2 = Base.Vector(1, 1, 0) b2 = Part.makeBox(small - 2 * tol, small - tol, small - 2 * tol, v1, v2) v1 = Base.Vector(size / 2, (- small) * 0.707, size / 2) v2 = Base.Vector(0, 1, 1) b3 = Part.makeBox(small, small, small, v1, v2) c1 = FreeCAD.ActiveDocument.addObject("Part::Feature","c1") c1.Shape = b1.fuse(b2).cut(b3) Gui.updateGui() | ||||
| Tags | No tags attached. | ||||
| FreeCAD Information | |||||
|
|
It does generate an error message to the Report View, but I didn't have that window wisible. In any case complaining about characters in comments is not necessary or useful. |
|
|
This is not a bug but a feature of python. You need to add this line at the beginning of your script (the very first line): # -*- coding: utf8 -*- (or any other encoding if you use another one) |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2015-07-20 11:12 | rparkins | New Issue | |
| 2015-07-20 13:10 | rparkins | Note Added: 0006256 | |
| 2015-08-05 02:33 | yorik | Note Added: 0006274 | |
| 2015-08-05 02:33 | yorik | Status | new => closed |
| 2015-08-05 02:33 | yorik | Assigned To | => yorik |
| 2015-08-05 02:33 | yorik | Resolution | open => no change required |
| 2015-08-05 02:33 | yorik | Fixed in Version | => 0.16 |
FreeCAD