LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-05-2004, 09:51 AM   #1
jalal
Member
 
Registered: Aug 2003
Location: .bh
Distribution: Gentoo
Posts: 188

Rep: Reputation: 30
wxTextCtrl.LoadFile error


Hello,

I am trying to load a text file into a wxTextCtrl, and I keep getting this message:

Quote:
(test.py:4676): Gtk-CRITICAL **: file gtktextbuffer.c: line 557 (gtk_text_buffer_emit_insert): assertion `g_utf8_validate (text, len, NULL)' failed
Here is the code I am using:

Code:
from wxPython.wx import *
class MainWindow(wxFrame):
    """ We simply derive a new class of Frame. """
    def __init__(self,parent,id,title):
        wxFrame.__init__(self,parent,wxID_ANY, title, size = ( 400,300),
                                     style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
        control = wxTextCtrl(self, 1, style=wxTE_MULTILINE)
        control.LoadFile("/etc/hosts")
        self.control = control
        self.Show(true)
app = wxPySimpleApp()
frame = MainWindow(None, -1, "Test")
app.MainLoop()

Any help will be appreciated.
 
Old 02-01-2005, 11:30 AM   #2
leonora
LQ Newbie
 
Registered: Oct 2003
Location: Zaragoza
Distribution: Mandrake 9.0
Posts: 11

Rep: Reputation: 0
I have the same problem ¿Have you solved the problem?

Many thanks in advance
 
Old 02-02-2005, 12:46 PM   #3
leonora
LQ Newbie
 
Registered: Oct 2003
Location: Zaragoza
Distribution: Mandrake 9.0
Posts: 11

Rep: Reputation: 0
Somebody can help me?
 
Old 02-04-2005, 03:37 AM   #4
leonora
LQ Newbie
 
Registered: Oct 2003
Location: Zaragoza
Distribution: Mandrake 9.0
Posts: 11

Rep: Reputation: 0
Somebody can help me?
 
Old 09-12-2005, 08:53 PM   #5
MicahCarrick
Member
 
Registered: Jul 2004
Distribution: Fedora
Posts: 241

Rep: Reputation: 31
I too am having trouble loading text files that were creating on other OS's due to the UTF-8 validation check. You can call the function g_utf8_validate() to handle the error in your program before it crashes, however, I have yet found out how to convert the files to utf-8. I'm using C and not python, but I believe we have similar issues here.

If I figure it out I will let you know.

- Micah
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
updating new installation of 9.3 ERROR...ERROR...ERROR Morbid SUSE / openSUSE 3 08-15-2005 11:22 PM
kudzu error loading libraries & respawning too fast error CatherineBennet Linux - Newbie 0 01-05-2005 05:04 PM
QMAIL error:554 Transaction failed: message format error mpk25 Linux - Software 1 10-15-2004 12:53 PM
firewall error? couldn't load target "accept ...ipt_accept? error piratebiter Linux - Security 1 09-19-2003 05:37 PM
cdrecord inupt/output error. write_g1: scsi sendcmd: no error lucstuk Linux - Software 9 08-09-2003 09:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration