TypeError: expected string or buffer
See original GitHub issueHello,
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:
- Created 7 years ago
- Comments:25 (13 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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!
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.