benoitc / benoitc/restkit

Exception in thread Thread-1 (most likely raised during interpreter shutdown

Open
#141 0 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
Python
Stars
404
Forks
70
PR merge metrics
No merged PRs in 30d

Description

I wrote a simple script, which connect to a local cherrypy website with persistent session.

``` python
#!/usr/bin/python
from time import sleep

import restkit
uri = 'http://127.0.0.1:8000/'
method = 'GET'
ret = restkit.request(uri, method=method)
print ret.body_string()
sleep(1)
```

But some requests ends with unexpected traceback:

``` python
python test.py
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
File "/usr/lib/python2.7/dist-packages/socketpool/backend_thread.py", line 51, in run
File "/usr/lib/python2.7/dist-packages/socketpool/pool.py", line 88, in murder_connections
File "/usr/lib/python2.7/dist-packages/socketpool/backend_thread.py", line 30, in __next__
: 'NoneType' object has no attribute 'Empty'
```

If a add "ret.should_close = True" before call to 'body_string', there is no more error.

ubuntu: Ubuntu 14.04.2 LTS
ubuntu package python-restkit: 4.2.2-1
ubuntu package python-socketpool: 0.5.3-1

Regards,

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.