Re: requests.Session() how do you set 'replace' on the encoding?

2015-07-09 Thread Veek M
dieter wrote: > > It looks strange that you can set "s.encoding" after you have > called "s.get" - but, as you apparently get an error related to > the "gbk" encoding, it seems to work. Ooo! Sorry, typo - that was outside the function but before the call. Unfortunately whilst improving my functi

Re: requests.Session() how do you set 'replace' on the encoding?

2015-07-06 Thread dieter
Veek M writes: > dieter wrote: > >> Veek M writes: >>> UnicodeEncodeError: 'gbk' codec can't encode character u'\xa0' in >>> position 8: illegal multibyte sequence >> >> You give us very little context. > > It's a longish chunk of code: basically, i'm trying to download using the > 'requests.S

Re: requests.Session() how do you set 'replace' on the encoding?

2015-07-06 Thread Veek M
dieter wrote: > Veek M writes: >> UnicodeEncodeError: 'gbk' codec can't encode character u'\xa0' in >> position 8: illegal multibyte sequence > > You give us very little context. It's a longish chunk of code: basically, i'm trying to download using the 'requests.Session' module and that should

Re: requests.Session() how do you set 'replace' on the encoding?

2015-07-02 Thread dieter
Veek M writes: > I'm getting a Unicode error: > > Traceback (most recent call last): > File "fooxxx.py", line 56, in > parent = anchor.getparent() > UnicodeEncodeError: 'gbk' codec can't encode character u'\xa0' in position > 8: illegal multibyte sequence You give us very little context.

requests.Session() how do you set 'replace' on the encoding?

2015-07-02 Thread Veek M
I'm getting a Unicode error: Traceback (most recent call last): File "fooxxx.py", line 56, in parent = anchor.getparent() UnicodeEncodeError: 'gbk' codec can't encode character u'\xa0' in position 8: illegal multibyte sequence I'm doing: s = requests.Session() to suck data in, so.. how do