Code Monkey home page Code Monkey logo

Comments (2)

satra avatar satra commented on July 30, 2024

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.

satra avatar satra commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.