View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001083 | FreeCAD | Bug | public | 2013-04-05 03:28 | 2013-04-23 21:54 |
| Reporter | crashfridh | Assigned To | |||
| Priority | normal | Severity | block | Reproducibility | always |
| Status | closed | Resolution | not fixable | ||
| Summary | 0001083: Methods added to FeaturePython objects are not restored | ||||
| Description | A method added to a FeaturePython object is not restored after saving and loading. | ||||
| Tags | No tags attached. | ||||
| FreeCAD Information | |||||
|
2013-04-05 03:28
|
|
|
|
This is technically not possible because functions cannot be serialized. Example: import json def test(): print "Hello, World!" test() s=json.dumps(test) Error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/json/__init__.py", line 231, in dumps return _default_encoder.encode(obj) File "/usr/lib/python2.7/json/encoder.py", line 201, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/lib/python2.7/json/encoder.py", line 264, in iterencode return _iterencode(o, 0) File "/usr/lib/python2.7/json/encoder.py", line 178, in default raise TypeError(repr(o) + " is not JSON serializable") TypeError: <function test at 0x88f3224> is not JSON serializable So, again it's up to the Python programmer to do that in __getstate__ and __setstate__ |
|
|
I assume this bug report can be closed? |
|
|
oops it is closed already. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2013-04-05 03:28 | crashfridh | New Issue | |
| 2013-04-05 03:28 | crashfridh | File Added: savingmethods.py | |
| 2013-04-05 09:49 | wmayer | Note Added: 0003044 | |
| 2013-04-05 09:50 | wmayer | Resolution | open => not fixable |
| 2013-04-23 21:53 | yorik | Note Added: 0003104 | |
| 2013-04-23 21:54 | yorik | Note Added: 0003105 | |
| 2013-04-23 21:54 | yorik | Status | new => closed |
FreeCAD