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

Not Thread-Safe #4

Open
Meorge opened this issue Mar 25, 2015 · 7 comments
Open

Not Thread-Safe #4

Meorge opened this issue Mar 25, 2015 · 7 comments

Comments

@Meorge
Copy link

Meorge commented Mar 25, 2015

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?

@paddycarey
Copy link
Owner

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?

@Meorge
Copy link
Author

Meorge commented Mar 25, 2015

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)

@paddycarey
Copy link
Owner

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.

@Meorge
Copy link
Author

Meorge commented Mar 25, 2015

Sounds great! Thanks for the quick response 😄

@Meorge
Copy link
Author

Meorge commented Apr 30, 2015

Do you know what the issue is?

@paddycarey
Copy link
Owner

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.

@Meorge
Copy link
Author

Meorge commented May 5, 2015

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

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

2 participants