Could you search for occurrences of "__reduce_cython__" in SnapPy.c on your
side? There should be a line like this in a PyMethodDef struct:
{"__reduce_cython__",
(PyCFunction)__pyx_pw_6SnapPy_12AbelianGroup_21__reduce_cython__,
METH_NOARGS, __pyx_doc_6SnapPy_12AbelianGroup_20__reduce_cython__},
> This problem manifests itself on both macOS (clang) and Windows (msvc) but
> only with Python 3.* as good old Python 2.7 continues to work fine.
That is very surprising, because there shouldn't be any Py2/3 difference
here. Could you check if both Py2 and Py3 generate the exact same .c file
for you?
File "stringsource", line 2, in pytraj.trajectory.c_traj.c_trajectory.TrajectoryCpptraj.__reduce_cython__ TypeError: no default __reduce__ due to non-trivial __cinit__
Hai
--
---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Could you clarify what you mean by"it" that's been working fine?
> hg clone https://bitbucket.org/t3m/snappy
> cd snappy
> hg update -r 092c5c15a4e8
Could maybe someone with a MacOS system try to reproduce the original
failure? I.e. this:
"""
File "cython/core/basic.pyx", line 676, in init SnapPy
cdef class AbelianGroup(object):
AttributeError: type object 'SnapPy.AbelianGroup' has no attribute
'__reduce_cython__'
"""
It's supposed to show under Py3 on MacOS and Windows.
Regarding the error you get, that's a safety measure, probably still a bit
too broad for now. You can explicit enable auto-pickling support for this
class in Cython 0.26 by adding the decorator "@cython.auto_pickle(True)".
Stefan
--
---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
I'm on MacOS 10.12.6. I did the above steps, and then the steps from the Appveyor log referenced earlier ("setup.py install", "python -m snappy.test") in a fresh virtualenv of python 3.6 (macports) with Cython 0.26 installed. I could not reproduce the problem.Now, I didn't have OpenGL or tkinter installed, so it looked like the `browser` module wasn't even being imported. So I tried to manually import the source of the trouble based on the stack trace in the log:$ python -c 'from snappy.SnapPy import AbelianGroup; print(AbelianGroup)'<class 'SnapPy.AbelianGroup'>I tried with both clang 8.1 and clang 9.0 successfully.
I did run into a separate problem compiling spherogram-1.6.1[1], but fortunately they had wheels published to PyPI that I was able to install.
but one difference I see between our setups is that your Python comes via macports and mine is from the Python.org installer.
I did run into a separate problem compiling spherogram-1.6.1[1], but fortunately they had wheels published to PyPI that I was able to install.Weird, I am also one of the developers of spherogram and I have had no problems with Cython 0.26 there.
On Friday, 28 July 2017 09:15:30 UTC-5, Nathan Dunfield wrote:but one difference I see between our setups is that your Python comes via macports and mine is from the Python.org installer.That seems to be it. If I use the python.org installer, I *do* reproduce the error as described. I checked both Python3.6.0 and 3.6.2 with clang 8.1, and Python 3.6.2 with clang 9.0; all combos produced the error.
I installed Python 3.6.2 via homebrew on the same machine as before and it *also* exhibits the error. I wonder what is special about macports' Python...
To summarize, there's two issues in this thread.
The first is an attribute error with __reduce_cython__ in snappy,
triggered by some import issue (which is suppressed if tkinter is not
present). I suspect that this is due to the exception from a hasattr
call not getting properly cleared, and then surfacing later (and
perhaps this was formerly an import error which was being caught and
ignored), but I think there's still some fix/cleanup to be done here.
The second is with "pytraj" (and possibly others) where we now throw
an explicit error rather than generate broken pickles.
This fix in
this case is to fix the project to either add pickling logic or avoid
pickling.
(One can revert back to the old logic of producing broken
pickles by setting auto_pickle=False too, though obviously this is not
recommended--the fact that broken pickles were being generated
(leading to silent or difficult to hunt down bugs) was one of the
motivations for this change in the first place.)
Does that sound right?
> email to cython-users+unsubscribe@googlegroups.com.
--
---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users+unsubscribe@googlegroups.com.
The first is an attribute error with __reduce_cython__ in snappy,
triggered by some import issue (which is suppressed if tkinter is not
present). I suspect that this is due to the exception from a hasattr
call not getting properly cleared, and then surfacing later (and
perhaps this was formerly an import error which was being caught and
ignored), but I think there's still some fix/cleanup to be done here.