dweepy
dweepy copied to clipboard
Not Thread-Safe
I'm trying to use dweepy for a program to create a Google Docs-style collaboration mode. However, it seems like I have to run it in a thread, which apparently is not good (it uses urllib/htmllib, which isn't thread-safe). Is there a way to port this to urllib3/htmllib2?
I'd certainly like to fix this, maybe you can help me understand the issue a bit better.
dweepy uses the requests
library for all of its HTTP calls (which I thought built on urllib3
but maybe i'm mistaken?). The only place I import from urllib is that i use the quote
function when setting an alert.
Do you know what exactly is making the library unsafe?
No, I don't think I know exactly what. Here's my traceback: http://pastebin.com/MJdRriyH From that, it looks like it's httplib not working in urllib3, but I'm not sure (I'm a relative novice in Python)
Thanks for the traceback, I think I know what the issue is but i'll dig in more and hopefully should have a fix for this when i get some time over the next few days.
Sounds great! Thanks for the quick response :smile:
Do you know what the issue is?
Sorry about the delay, I'm looking at this again now. I thought I knew what the issue was but I'm having trouble recreating on my own rig (Linux/AMD64). I've tried the same python and requests versions that I can see in your traceback but still can't get it to fail.
Could you possibly provide a more complete example of exactly what's failing for you? Just a quick function that I can run that shows the failing behaviour and I'll try to find a Mac to test it out on. Even better would be a failing test case, but I understand if you're not able to provide that.
I just tried to make a small program that would give the error again, but it's actually working fine :
http://pastebin.com/Zc4S8g4K
Would I be able to send you the snippet of code in my program that's causing the error?
EDIT: just saw that it actually did print out an error - http://pastebin.com/9Ufi8mYX