question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: expected string or buffer

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:25 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
ianabccommented, Aug 23, 2016

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!

0reactions
enricobaciscommented, Jul 8, 2019

Ok, this has been open for too long. I’ll consider the wos-lite branch as final and I’ll merge it to master.

I’ll bump the version to 0.2, thus if you have any problem because of the merge, please revert to 0.1.x and open an issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: expected string or buffer - python - Stack Overflow
TypeError: expected string or buffer · 1. Replace f.readlines() by f.read() . – Martin Thoma. Mar 26, 2014 at 0:51 · 1. If...
Read more >
Why am I getting TypeError: expected string or buffer?
The problem is get_user_timeline because it returns a list of strings i.e you can't just pass it to the tokenize function.
Read more >
[Python] Expected string or buffer error : r/learnprogramming
You're trying to pass a file object to re.search() , but it requires a string. There is no reason to be opening the...
Read more >
TypeError: expected string or buffer #532 - sublimelsp/LSP
it seems there is a bug of some sort in sublime, where settings.get('syntax') returns 0 instead of None . Might be the issue...
Read more >
How to Fix: Typeerror: expected string or bytes-like object
This error typically occurs when you attempt to use the re.sub() function to replace certain patterns in an object but the object you're...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found