netvor / copr / copr

Forked from copr/copr 4 years ago
Clone

dd5381d deserialize in python-marshmallow 2.1+ need 4 params

Authored and Committed by msuchy 7 years ago
    deserialize in python-marshmallow 2.1+ need 4 params
    
    This is from Fedora 24+
    
    addressing:
    tests/coprs_test_case.py:422: in request_rest_api_with_auth
        return self.tc.open(url, **kwargs)
    /usr/lib/python2.7/site-packages/flask/testing.py:108: in open
        follow_redirects=follow_redirects)
    /usr/lib/python2.7/site-packages/werkzeug/test.py:751: in open
        response = self.run_wsgi_app(environ, buffered=buffered)
    /usr/lib/python2.7/site-packages/werkzeug/test.py:668: in run_wsgi_app
        rv = run_wsgi_app(self.application, environ, buffered=buffered)
    /usr/lib/python2.7/site-packages/werkzeug/test.py:871: in run_wsgi_app
        app_rv = app(environ, start_response)
    /usr/lib/python2.7/site-packages/flask/app.py:1836: in __call__
        return self.wsgi_app(environ, start_response)
    /usr/lib/python2.7/site-packages/flask/app.py:1820: in wsgi_app
        response = self.make_response(self.handle_exception(e))
    coprs/rest_api/__init__.py:44: in error_router
        return original_handler(e)
    /usr/lib/python2.7/site-packages/flask/app.py:1403: in handle_exception
        reraise(exc_type, exc_value, tb)
    /usr/lib/python2.7/site-packages/flask/app.py:1817: in wsgi_app
        response = self.full_dispatch_request()
    /usr/lib/python2.7/site-packages/flask/app.py:1477: in full_dispatch_request
        rv = self.handle_user_exception(e)
    coprs/rest_api/__init__.py:44: in error_router
        return original_handler(e)
    /usr/lib/python2.7/site-packages/flask/app.py:1381: in handle_user_exception
        reraise(exc_type, exc_value, tb)
    /usr/lib/python2.7/site-packages/flask/app.py:1475: in full_dispatch_request
        rv = self.dispatch_request()
    /usr/lib/python2.7/site-packages/flask/app.py:1461: in dispatch_request
        return self.view_functions[rule.endpoint](**req.view_args)
    /usr/lib/python2.7/site-packages/flask_restful/__init__.py:477: in wrapper
        resp = resource(*args, **kwargs)
    /usr/lib/python2.7/site-packages/flask/views.py:84: in view
        return self.dispatch_request(*args, **kwargs)
    /usr/lib/python2.7/site-packages/flask_restful/__init__.py:587: in dispatch_request
        resp = meth(*args, **kwargs)
    coprs/rest_api/common.py:115: in decorated_function
        return f(*args, **kwargs)
    coprs/rest_api/resources/project.py:161: in put
        project_dict = mm_deserialize(ProjectSchema(), flask.request.data.decode("utf-8")).data
    coprs/rest_api/util.py:48: in mm_deserialize
        result = schema.loads(json_string)
    /usr/lib/python2.7/site-packages/marshmallow/schema.py:561: in loads
        return self.load(data, many=many, partial=partial)
    /usr/lib/python2.7/site-packages/marshmallow/schema.py:539: in load
        result, errors = self._do_load(data, many, partial=partial, postprocess=True)
    /usr/lib/python2.7/site-packages/marshmallow/schema.py:604: in _do_load
        index_errors=self.opts.index_errors,
    /usr/lib/python2.7/site-packages/marshmallow/marshalling.py:290: in deserialize
        index=(index if index_errors else None)
    /usr/lib/python2.7/site-packages/marshmallow/marshalling.py:65: in call_and_store
        value = getter_func(data)
    /usr/lib/python2.7/site-packages/marshmallow/marshalling.py:283: in <lambda>
        data
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    self = <fields.SpaceSeparatedList(default=<marshmallow.missing>, attribute=None, vali...value.', u'null': u'Field may not be null.', u'type': u'Invalid input type.'})>
    value = [], attr = 'repos'
    data = {'build_enable_net': False, 'contact': 'foo@example.com', 'description': 'foo bar', 'disable_createrepo': True, ...}
    
        def deserialize(self, value, attr=None, data=None):
            """Deserialize ``value``.
    
                :raise ValidationError: If an invalid value is passed or if a required value
                    is missing.
                """
            # Validate required fields, deserialize, then validate
            # deserialized value
            self._validate_missing(value)
            if getattr(self, 'allow_none', False) is True and value is None:
                return None
    >       output = self._deserialize(value, attr, data)
    E       TypeError: _deserialize() takes exactly 2 arguments (4 given)
    
    /usr/lib/python2.7/site-packages/marshmallow/fields.py:260: TypeError