Comments (2)
and when using anonymous connection:
In [1]: from pyxnat import Interface
In [2]: central = Interface(server="https://central.xnat.org", anonymous=True)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/software/temp/nipype-tutorial/temp/<ipython-input-2-2bb5788bf194> in <module>()
----> 1 central = Interface(server="https://central.xnat.org", anonymous=True)
/software/virtualenvs.EPD/7.2/devpype/lib/python2.7/site-packages/pyxnat/core/interfaces.pyc in __init__(self, server, user, password, cachedir, config, anonymous)
192
193 if self._anonymous:
--> 194 response, content = self._http.request(self._server, 'GET')
195 self._jsession = response['set-cookie'][:44]
196
/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/httplib2/__init__.pyc in request(self, uri, method, body, headers, redirections, connection_type)
1054 content = new_content
1055 else:
-> 1056 (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
1057 except Exception, e:
1058 if self.force_exception_to_status_code:
/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/httplib2/__init__.pyc in _request(self, conn, host, absolute_uri, request_uri, method, body, headers, redirections, cachekey)
858 auth.request(method, request_uri, headers, body)
859
--> 860 (response, content) = self._conn_request(conn, request_uri, method, body, headers)
861
862 if auth:
/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/httplib2/__init__.pyc in _conn_request(self, conn, request_uri, method, body, headers)
827 for i in range(2):
828 try:
--> 829 conn.request(method, request_uri, body, headers)
830 response = conn.getresponse()
831 except socket.gaierror:
/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/httplib.pyc in request(self, method, url, body, headers)
953 def request(self, method, url, body=None, headers={}):
954 """Send a complete request to the server."""
--> 955 self._send_request(method, url, body, headers)
956
957 def _set_content_length(self, body):
/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/httplib.pyc in _send_request(self, method, url, body, headers)
987 for hdr, value in headers.iteritems():
988 self.putheader(hdr, value)
--> 989 self.endheaders(body)
990
991 def getresponse(self, buffering=False):
/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/httplib.pyc in endheaders(self, message_body)
949 else:
950 raise CannotSendHeader()
--> 951 self._send_output(message_body)
952
953 def request(self, method, url, body=None, headers={}):
/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/httplib.pyc in _send_output(self, message_body)
809 msg += message_body
810 message_body = None
--> 811 self.send(msg)
812 if message_body is not None:
813 #message_body was not a string (i.e. it is a file) and
/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/httplib.pyc in send(self, data)
771 if self.sock is None:
772 if self.auto_open:
--> 773 self.connect()
774 else:
775 raise NotConnected()
/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/httplib2/__init__.pyc in connect(self)
740 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
741 if self.timeout is not None:
--> 742 sock.settimeout(self.timeout)
743 sock.connect((self.host, self.port))
744 ssl = socket.ssl(sock, self.key_file, self.cert_file)
/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/socket.pyc in meth(name, self, *args)
222
223 def meth(name,self,*args):
--> 224 return getattr(self._sock,name)(*args)
225
226 for _m in _socketmethods:
TypeError: a float is required
from pyxnat.
updating httplib2 to the following version resolves the above issues. might want to put a minimum version requirement for pyxnat.
In [2]: httplib2.__version__
Out[2]: '0.7.4'
from pyxnat.
Related Issues (20)
- Could tests requiring real server connection auto-skip if no server is available? HOT 11
- Byte objects as caught errors are not being parsed
- Anaconda PackagesNotFoundError installing `requirements-dev.txt` packages
- Performance issue
- Latest pypi release not working HOT 1
- Refactor `help.py` informative functions with prints
- Tests won't run any more on Docker-based XNAT instance. HOT 1
- Wrong `cache_dir` variable (session_mirror.py)
- Please tag releases in sync with pypi HOT 4
- Add a lint check in Travis HOT 2
- Resource download does not work in WinOS
- pyxnat.Interface() displays IP and xnat password HOT 2
- XNAT REST API inconsistency derives in unexpected exception when listing Experiment resources
- pip install fails on MacOS Big Sur HOT 1
- docs: define resources in the tutorial page HOT 4
- is it possible to push data to prearchive ? HOT 4
- SSLE error (cached) HOT 5
- Receiving empty list, not list of projects HOT 4
- xnat-docker-compose pinned to specific tag due to CI-related errors
- nosetests deprecation in Debian HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyxnat.