Re: UnicodeError for join()

2009-01-15 Thread tmallen
On Jan 15, 4:09 pm, "Martin v. Löwis" wrote: > >> One of self.title and self.content is a Unicode string, the other is > >> a byte string. You need to change them to have the same type (depending > >> on whether you want to process them as Unicode or byte strings). > > > How can I do that? > > Fir

Re: UnicodeError for join()

2009-01-15 Thread Martin v. Löwis
>> One of self.title and self.content is a Unicode string, the other is >> a byte string. You need to change them to have the same type (depending >> on whether you want to process them as Unicode or byte strings). >> > > How can I do that? First, you need to find out what the respective types ar

Re: UnicodeError for join()

2009-01-15 Thread tmallen
On Jan 15, 3:34 pm, "Martin v. Löwis" wrote: > > rc_file.write("\n\n".join([self.title, "### BEGIN CONTENT ###", > > self.content])) > > . > > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position > > 442: ordinal not in range() > > > What should I change to make thi

Re: UnicodeError for join()

2009-01-15 Thread Martin v. Löwis
> rc_file.write("\n\n".join([self.title, "### BEGIN CONTENT ###", > self.content])) > . > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position > 442: ordinal not in range() > > What should I change to make this unicode-safe? One of self.title and self.content is a

UnicodeError for join()

2009-01-15 Thread tmallen
This line of code is throwing a UnicodeError for a handful of the few hundred files I'm processing: rc_file.write("\n\n".join([self.title, "### BEGIN CONTENT ###", self.content])) . UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 442: ordinal not in range() Wh