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

When launching vmprof --web from python 3.4 you get TypeError: Can't convert 'bytes' object to str implicitly exception #1

Open
jbzdak opened this issue Oct 31, 2015 · 0 comments

Comments

@jbzdak
Copy link

jbzdak commented Oct 31, 2015

Stacktrace attached at the end of issue.

Problem lies in upload.upload function, that contains, where val variable is a bytes object, that is concatenated to string objects.

To fix this you'll need to encode it:

 val = res.read().decode('ascii')

Traceback:

Traceback (most recent call last):
  File "/home/jb/.pythonz/pythons/CPython-3.4.3/lib/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/jb/.pythonz/pythons/CPython-3.4.3/lib/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/jb/programs/nasypy_webapp_backend/venv/lib/python3.4/site-packages/vmprof/__main__.py", line 67, in <module>
    main()
  File "/home/jb/programs/nasypy_webapp_backend/venv/lib/python3.4/site-packages/vmprof/__main__.py", line 64, in main
    show_stats(prof_file.name, output_mode, args)
  File "/home/jb/programs/nasypy_webapp_backend/venv/lib/python3.4/site-packages/vmprof/__main__.py", line 25, in show_stats
    upload_stats(stats, args)
  File "/home/jb/programs/nasypy_webapp_backend/venv/lib/python3.4/site-packages/vmprof/__main__.py", line 36, in upload_stats
    res = vmprof.upload.upload(stats, name, argv, host, auth)
  File "/home/jb/programs/nasypy_webapp_backend/venv/lib/python3.4/site-packages/vmprof/upload.py", line 35, in upload
    return "http://" + host + "/#/" + val[1:-1]
TypeError: Can't convert 'bytes' object to str implicitly
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