InviteBox / django-live-profiler

A database access profiler for Django-based applications that can be ran in production
193 stars 44 forks source link

TypeError: unicode not allowed, use setsockopt_string with python 3.2 on Debian Wheezy #22

Closed binary-data closed 8 years ago

binary-data commented 10 years ago

Hi I am launching server with aggregated --host 127.0.0.1 --port 5556 and it throws me an exception: Traceback (most recent call last): File "/home/webapp/www/env/bin/aggregated", line 9, in load_entry_point('django-live-profiler==0.0.9', 'console_scripts', 'aggregated')() File "/home/webapp/www/env/lib/python3.2/site-packages/aggregate/server.py", line 73, in main socket.setsockopt(zmq.SUBSCRIBE,'') File "socket.pyx", line 310, in zmq.backend.cython.socket.Socket.set (zmq/backend/cython/socket.c:3184) TypeError: unicode not allowed, use setsockopt_string

I use python 3.2 on Debian Wheezy and virtualenv.

Matt3o12 commented 10 years ago

Doesn't work on Mac OS X Yosemite using python 3.3 either.
Have you found a fix for that, yet?

mchccc commented 9 years ago

Just add a 'b' on line 73 in server.py, like so:

socket.setsockopt(zmq.SUBSCRIBE, b'')
binary-data commented 8 years ago

Closing because it seems a little outdated :)

techdragon commented 8 years ago

@binary-data I just got this issue with the current pypi package.

binary-data commented 8 years ago

@techdragon I don't think that this will be fixed, last update of this repo was three years ago :)

pra-dan commented 3 years ago

Just an addition/alternative to the answer above,

topicfilter = 10005
socket.setsockopt(zmq.SUBSCRIBE, bytes(topicfilter))
aminPial commented 3 years ago

Just an addition/alternative to the answer above, (2)

topicfilter = 10005
socket.setsockopt(zmq.SUBSCRIBE, str.encode(topicfilter)) # basically we need byte repr. that's it