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

Cant start: Werkzeug: TypeError: code() takes at least 14 arguments (13 given) #1545

Closed
mcjoshua opened this issue Aug 26, 2020 · 4 comments
Closed
Labels

Comments

@mcjoshua
Copy link

mcjoshua commented Aug 26, 2020

Describe the bug

user a simple example

Expected behavior

Actual behavior

C:\Users\Administrator\Desktop\my_locust>locust
[2020-08-26 13:40:22,369] DESKTOP-APUJUVJ/WARNING/locust.main: System open file limit setting is not high enough for load testing, and the OS didn't allow locust to increase it by itself. See https://github.com/locustio/locust/wiki/Installation#increasing-maximum-number-of-open-files-limit for more info.
[2020-08-26 13:40:22,369] DESKTOP-APUJUVJ/INFO/locust.main: Starting web interface at http://0.0.0.0:8089 (accepting connections from all network interfaces)
Traceback (most recent call last):
File "c:\python\python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\python\python38\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Python\Python38\Scripts\locust.exe_main
.py", line 7, in
File "c:\python\python38\lib\site-packages\locust\main.py", line 284, in main
web_ui = environment.create_web_ui(
File "c:\python\python38\lib\site-packages\locust\env.py", line 156, in create_web_ui
self.web_ui = WebUI(self, host, port, auth_credentials=auth_credentials, tls_cert=tls_cert, tls_key=tls_key, stats_csv_writer=stats_csv_writer)
File "c:\python\python38\lib\site-packages\locust\web.py", line 85, in init
app = Flask(name)
File "c:\python\python38\lib\site-packages\flask\app.py", line 601, in init
self.add_url_rule(
File "c:\python\python38\lib\site-packages\flask\app.py", line 98, in wrapper_func
return f(self, *args, **kwargs)
File "c:\python\python38\lib\site-packages\flask\app.py", line 1278, in add_url_rule
self.url_map.add(rule)
File "c:\python\python38\lib\site-packages\werkzeug\routing.py", line 1562, in add
rule.bind(self)
File "c:\python\python38\lib\site-packages\werkzeug\routing.py", line 711, in bind
self.compile()
File "c:\python\python38\lib\site-packages\werkzeug\routing.py", line 767, in compile
self._build = self._compile_builder(False)
File "c:\python\python38\lib\site-packages\werkzeug\routing.py", line 1128, in _compile_builder
return self.BuilderCompiler(self).compile(append_unknown)
File "c:\python\python38\lib\site-packages\werkzeug\routing.py", line 1119, in compile
co = types.CodeType(*code_args)
TypeError: code() takes at least 14 arguments (13 given)

C:\Users\Administrator\Desktop\my_locust>locust -f lct.py

Steps to reproduce

Environment

  • OS:
  • Python version: 3.8
  • Locust version: 1.2
  • Locust command line that you ran: locust -f lct.py
  • Locust file contents (anonymized if necessary):

lct.py

from locust import HttpUser, task, between

class QuickstartUser(HttpUser):

def on_start(self):
    pass

@task
def index_page(self):
    pass

@task(3)
def view_item(self):
    pass
@mcjoshua mcjoshua added the bug label Aug 26, 2020
@cyberw
Copy link
Collaborator

cyberw commented Aug 26, 2020

Can you check which version of flask and werkzeug you have? (using pip list)

@mcjoshua
Copy link
Author

mcjoshua commented Aug 27, 2020

Can you check which version of flask and werkzeug you have? (using pip list)

Flask 1.1.2
Werkzeug 0.15.2

@mcjoshua
Copy link
Author

mcjoshua commented Aug 27, 2020

Can you check which version of flask and werkzeug you have? (using pip list)

when the werkzeug is updated, it can work normally

@cyberw
Copy link
Collaborator

cyberw commented Aug 27, 2020

Huh. Probably we should just pin a higher version of werkzeug to fix this (it has happened before), but the strange thing is that it works for me with

Flask 1.1.2
Werkzeug 0.15.0

I'm on macOS though, so maybe that is the difference. I'll add a specific dependency on Werkzeug 1.0.1 instead of relying on the implicit (0.15) from Flask. (soon-ish)

@cyberw cyberw changed the title can start locust programe. Cant start: Werkzeug: TypeError: code() takes at least 14 arguments (13 given) Aug 27, 2020
@cyberw cyberw closed this as completed in 039187a Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants