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

demo.py: TypeError: unsupported operand type(s) for +: 'SQLAlchemy' and 'str' #17

Closed
jrc opened this issue Sep 29, 2018 · 4 comments
Closed

Comments

@jrc
Copy link

jrc commented Sep 29, 2018

safrs-1.0.22 / Python 3.7.0 / macOS Mojave 10.14

$ python3 -m venv env
$ source env/bin/activate
$ pip install safrs
$ curl -O https://raw.githubusercontent.com/thomaxxl/safrs/master/examples/demo.py
$ python demo.py

This fails with

Traceback (most recent call last):
  File "demo.py", line 64, in <module>
    SAFRS(app, db)
  File "/blah/blah/env/lib/python3.7/site-packages/safrs/__init__.py", line 37, in __new__
    app.register_blueprint(swaggerui_blueprint, url_prefix= prefix)
  File "/blah/blah/env/lib/python3.7/site-packages/flask/app.py", line 64, in wrapper_func
    return f(self, *args, **kwargs)
  File "/blah/blah/env/lib/python3.7/site-packages/flask/app.py", line 951, in register_blueprint
    blueprint.register(self, options, first_registration)
  File "/blah/blah/env/lib/python3.7/site-packages/flask/blueprints.py", line 151, in register
    endpoint='static')
  File "/blah/blah/env/lib/python3.7/site-packages/flask/blueprints.py", line 68, in add_url_rule
    rule = self.url_prefix + rule
TypeError: unsupported operand type(s) for +: 'SQLAlchemy' and 'str'
@thomaxxl
Copy link
Owner

I pushed changes to github that are not compatible with the pip release, related to the v2 being built.
Can you check with a github clone? And the thomaxxl_pythonanywhere demo?
I will investigate tomorrow (on my phone now).

@jrc
Copy link
Author

jrc commented Sep 29, 2018

Thanks for the fast response. Yes, looks like a GitHub clone works. So it's a problem with the PyPI release.

@thomaxxl
Copy link
Owner

The pip version works with previous versions of demo.py, eg. https://github.com/thomaxxl/safrs/blob/fdb951d0d3755d4586bfd9e3ae1dcce560cbe01a/examples/demo.py

I want to release the newest package (v2.0.0) but there are some more features I want to implement.
Please let me know if you have any other problems and I'll try to fix them asap (I'm not aware of any bugs atm though :) )

I keep this issue open until v2 is released.

@thomaxxl
Copy link
Owner

thomaxxl commented Oct 1, 2018

I created v1.1.0 which should work with this demo.py

@thomaxxl thomaxxl closed this as completed Oct 1, 2018
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

2 participants