Aaron Misquith wrote:
> I'm trying to obtain the questions present in StackOverflow for a
> particular tag.
>
> Whenever I try to run the program i get this *error:*
>
> Message File Name Line Position
> Traceback
> C:\Users\Aaron\Desktop\question.py 20
> UnicodeEncodeError: 'ascii' codec c
I'm trying to obtain the questions present in StackOverflow for a
particular tag.
Whenever I try to run the program i get this *error:*
Message File Name Line Position
Traceback
C:\Users\Aaron\Desktop\question.py 20
UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in
positi
>>> You're right, I realised after playing with Tim's example that the
>>> problem was that I wasn't calling close() on the codecs file. Adding
>>> this after the f.write(html_text) seems to flush the buffer which
>>> means that the content now gets written to the file.
>>
>> Quick note: it may
Danny Yoo wrote:
>> You're right, I realised after playing with Tim's example that the
>> problem was that I wasn't calling close() on the codecs file. Adding
>> this after the f.write(html_text) seems to flush the buffer which means
>> that the content now gets written to the file.
>
> Hi Fran
> You're right, I realised after playing with Tim's example that the
> problem was that I wasn't calling close() on the codecs file. Adding
> this after the f.write(html_text) seems to flush the buffer which means
> that the content now gets written to the file.
Hi Frank,
Quick note: it may be
Kent Johnson wrote:
>Do you explicitly close the output file? If not, the data may not be
>actually written.
>
>
Kent,
You're right, I realised after playing with Tim's example that the
problem was that I wasn't calling close() on the codecs file.
Adding this after the f.write(html_text) seem
Frank Moore wrote:
> The later code (where I use codecs) is not giving me an error (I must
> have got that error during an intermediate step I performed).
> However, it's also not writing anything away. It seems to be silently
> failing as html_text definitely has content.
Do you explicitly clos
[Frank Moore]
| I'm getting the following error when I try and write some HTML with
| German text in it.
|
| UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in
| position 1367: ordinal not in range(128)
|
| I've now read the 'Unicode - How To' by AMKuchling and
| changed the
Frank Moore wrote:
> Hi,
>
> I'm getting the following error when I try and write some HTML with
> German text in it.
>
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in
> position 1367: ordinal not in range(128)
>
> This was my code:
>
> html_text = open(inFile, 'r'
Hi,
I'm getting the following error when I try and write some HTML with
German text in it.
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in
position 1367: ordinal not in range(128)
This was my code:
html_text = open(inFile, 'r').read()
# ... do some processing on
10 matches
Mail list logo