wos: TypeError: expected string or buffer

Hello, using wos I stumbled upon following TypeError:

>>> with WosClient(username, password, lite=True) as client:
            print wos.utils.query(client, 'AU=Knuth Donald')

Authenticated (SID: ...)
Traceback (most recent call last):

  File "<ipython-input-7-51b5a119f6af>", line 19, in <module>
    print wos.utils.query(client, 'AU=Knuth Donald')

  File "/home/.../anaconda3/envs/py27/lib/python2.7/site-packages/wos/utils.py", line 22, in query
    for x in range(offset, count+1, limit)]

  File "/home/.../anaconda3/envs/py27/lib/python2.7/site-packages/wos/utils.py", line 12, in single
    xml = _re.sub(' xmlns="[^"]+"', '', result.records, count=1).encode('utf-8')

  File "/home/.../anaconda3/envs/py27/lib/python2.7/re.py", line 155, in sub
    return _compile(pattern, flags).sub(repl, string, count)

TypeError: expected string or buffer

I used different queries, but I always get the same error. I’m using the latest wos version 0.1.9 and updated regex recently. Do you have some advice for me?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 25 (13 by maintainers)

Most upvoted comments

I just stumbled across this branch when looking at an issue we were having. As far as I can tell, the new branch works, thanks!