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

Setting reload-os-env to True causes TypeError on python3.4 #1143

Open
iivvoo opened this issue Jan 6, 2016 · 0 comments · May be fixed by #2695
Open

Setting reload-os-env to True causes TypeError on python3.4 #1143

iivvoo opened this issue Jan 6, 2016 · 0 comments · May be fixed by #2695
Labels

Comments

@iivvoo
Copy link

iivvoo commented Jan 6, 2016

If I have reload-os-env = true in my uwsgi.conf, starting uwsgi will result in

Traceback (most recent call last):
  File "/srv/knip/development/KnipKnap/lib/python3.4/os.py", line 637, in __setitem__
    key = self.encodekey(key)
  File "/srv/knip/development/KnipKnap/lib/python3.4/os.py", line 706, in encode
    raise TypeError("str expected, not %s" % type(value).__name__)
TypeError: str expected, not bytes

Apparently, plugins/python/pyloader.c

https://github.com/unbit/uwsgi/blob/master/plugins/python/pyloader.c#L147

passes a bytestring in stead of a normal string (I don't know enough Python C api to say anything more sensible than this :)

reproduce:

$ virtualenv -p /usr/bin/python3.4 .; bin/pip install uwsgi==2.0.12
...
$ bin/uwsgi -s s --reload-os-env --wsgi-file=anything
....
Traceback (most recent call last):
  File "/srv/knip/development/KnipKnap/lib/python3.4/os.py", line 637, in __setitem__
    key = self.encodekey(key)
  File "/srv/knip/development/KnipKnap/lib/python3.4/os.py", line 706, in encode
    raise TypeError("str expected, not %s" % type(value).__name__)
TypeError: str expected, not bytes
(repeated)
@xrmx xrmx added the bug label Jan 6, 2016
@wszak wszak linked a pull request Nov 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants