This repository was archived by the owner on Feb 1, 2023. It is now read-only.
Commit d6cf85b
Release Manager
Trac #31182: Mutability class and pickling
If the class `Mutability` is used as mixin for mutability features, the
pickling goes wrong (see
[https://trac.sagemath.org/ticket/30261#comment:9 here]).
An attempt using this mixin class after #30281, still throws a pickling
test error, e.g. in #30310:
{{{
File "src/sage/manifolds/chart_func.py", line 2944, in
sage.manifolds.chart_func.MultiCoordFunction.__init__
Failed example:
TestSuite(f).run()
Expected nothing
Got:
Failure in _test_pickling:
Traceback (most recent call last):
File "sage/misc/persist.pyx", line 291, in sage.misc.persist.dumps
(build/cythonized/sage/misc/persist.c:4284)
return obj.dumps(compress)
File "sage/structure/sage_object.pyx", line 476, in
sage.structure.sage_object.SageObject.dumps
(build/cythonized/sage/structure/sage_object.c:3790)
return _base_dumps(self, compress=compress)
File "sage/misc/persist.pyx", line 264, in
sage.misc.persist._base_dumps
(build/cythonized/sage/misc/persist.c:4012)
gherkin = SagePickler.dumps(obj)
File "sage/misc/persist.pyx", line 771, in
sage.misc.persist.SagePickler.dumps
(build/cythonized/sage/misc/persist.c:6801)
pickler.dump(obj)
TypeError: cannot pickle 'MultiCoordFunction' object
<BLANKLINE>
During handling of the above exception, another exception occurred:
<BLANKLINE>
Traceback (most recent call last):
File "/home/michi/Projekte/sage-devel/local/lib/python3.8/site-
packages/sage/misc/sage_unittest.py", line 297, in run
test_method(tester=tester)
File "sage/structure/sage_object.pyx", line 647, in
sage.structure.sage_object.SageObject._test_pickling
(build/cythonized/sage/structure/sage_object.c:5007)
tester.assertEqual(loads(dumps(self)), self)
File "sage/misc/persist.pyx", line 293, in sage.misc.persist.dumps
(build/cythonized/sage/misc/persist.c:4337)
return _base_dumps(obj, compress=compress)
File "sage/misc/persist.pyx", line 264, in
sage.misc.persist._base_dumps
(build/cythonized/sage/misc/persist.c:4012)
gherkin = SagePickler.dumps(obj)
File "sage/misc/persist.pyx", line 771, in
sage.misc.persist.SagePickler.dumps
(build/cythonized/sage/misc/persist.c:6801)
pickler.dump(obj)
TypeError: cannot pickle 'MultiCoordFunction' object
------------------------------------------------------------
The following tests failed: _test_pickling
}}}
I found out that a non-cythonized alternative works without errors.
URL: https://trac.sagemath.org/31182
Reported by: gh-mjungmath
Ticket author(s): Michael Jung
Reviewer(s): Travis ScrimshawFile tree
3 files changed
+69
-4
lines changed- build/pkgs/configure
- src/sage/structure
3 files changed
+69
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
180 | 245 | | |
181 | 246 | | |
182 | 247 | | |
| |||
0 commit comments