Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to pickle on Windows 10 #245

Open
naamancampbell opened this issue Dec 8, 2017 · 0 comments
Open

Unable to pickle on Windows 10 #245

naamancampbell opened this issue Dec 8, 2017 · 0 comments

Comments

@naamancampbell
Copy link

naamancampbell commented Dec 8, 2017

As part of using Flask-Testing's LiveServerTestCase, I've changed the project's utils.py to use multiprocess (and dill) to work around a known Windows pickle error.

Using multiprocess/dill, I get past the original error and get the following error:

platform win32  Python 3.6.3, pytest-3.2.5, py-1.5.2, pluggy-0.4.0

================================== FAILURES ===================================
_____________________ TestRegistration.test_registration ______________________

obj = <module 'app.auth.views' from 'C:\\Users\\naama\\OneDrive\\Documents\\Code\\strobla-python\\app\\auth\\views.py'>
name = 'View.as_view.<locals>.view'

    def _getattribute(obj, name):
        for subpath in name.split('.'):
            if subpath == '<locals>':
                raise AttributeError("Can't get local attribute {!r} on {!r}"
                                     .format(name, obj))
            try:
                parent = obj
>               obj = getattr(obj, subpath)
E               AttributeError: module 'app.auth.views' has no attribute 'View'

'c:\python36\Lib\pickle.py':269: AttributeError

The obj object is made up of multiple Flask classes (first three below):

AuthorisationView: <class 'app.auth.views.AuthorisationView'>
Blueprint: <class 'flask.blueprints.Blueprint'>
Client: <class 'stravalib.client.Client'>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant