How to display .txt file in textview of glade

varnikat t varnikat22 at gmail.com
Wed Apr 14 16:29:59 EDT 2010


Hi,
Whenever I try to open a .txt file in textview of glade, it never opens and
throws this error:
GtkWarning: gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text,
len, NULL)' failed

self.text_view.get_buffer().insert(self.text_view.get_buffer().get_end_iter(),
"\n" + file.read())

It opens .py, .html, etc. nicely but doesn't open .txt file.
Can anyone temme what to do in order to display a .txt file?
Do i need to convert .txt file into something else...? there is some UTF-8
encoding problem....i guess.
Please help me.

-- 
Varnika Tewari
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100415/0ebb33cf/attachment.html>


More information about the Python-list mailing list