PiRSquared17 / editra

Automatically exported from code.google.com/p/editra
Other
0 stars 0 forks source link

Add to History Error when Python file is opened #746

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install wxWidgets28 from ports (Source) with default encoding UTF-8
2. easy_install editra
3. Set default editra encoding to UTF-8
4. Open python file (either using edit or double-click)

I expect the file to be added to the history, and the file to open.  Instead, I 
see the stack trace below, and the file tab name is 'Untitled n'.  The file is 
editable, and Editra does not crash.

What version of the product are you using? Editra 0.7.01
On what operating system? FreeBSD RELEASE 9.0-p3

What method of install was your version installed with (Binary/Source)? 
easy_install / wxWidgets from ports

What version of python:  2.7.3 i686
What version of wxPython: 2.8.12.1

If I comment out "assert txtutil.IsUnicode(fname)" on line 65 in 
Editra-0.7.01-py2.7.egg/Editra/src/ebmlib/efilehist.py, then I see the expected 
behavior.

Stack trace follows.

#---- System Information ----#
Editra Version: 0.7.01
Operating System: FreeBSD 9.0-RELEASE-p3 i386
Python Version: 2.7.3 (default, Jun 22 2012, 23:08:16) 
[GCC 4.2.1 20070831 patched [FreeBSD]]
wxPython Version: 2.8.12.1 (gtk2-ansi)
wxPython Info: (__WXGTK__, wxGTK, ansi, gtk2, wx-assertions-off, SWIG-1.3.29)
Python Encoding: Default=ascii  File=UTF-8
wxPython Encoding: UTF-8
System Architecture: 32bit i386
Byte order: little
Frozen: False
#---- End System Information ----#

#---- Traceback Info ----#
*** Fri Jun 29 10:11:20 2012 ***
Traceback (most recent call last):
  File "/home/cslater/.config/Editra/plugins/Projects-1.7-py2.7.egg/projects/ProjectPane.py", line 1722, in OnActivate
    nbook.OnDrop([item])
  File "/usr/local/lib/python2.7/site-packages/Editra-0.7.01-py2.7.egg/Editra/src/ed_pages.py", line 1006, in OnDrop
    self.OpenPage(pathname, the_file)
  File "/usr/local/lib/python2.7/site-packages/Editra-0.7.01-py2.7.egg/Editra/src/ed_pages.py", line 804, in OpenPage
    self.frame.AddFileToHistory(path2file)
  File "/usr/local/lib/python2.7/site-packages/Editra-0.7.01-py2.7.egg/Editra/src/ed_main.py", line 382, in AddFileToHistory
    ed_msg.PostMessage(ed_msg.EDMSG_ADD_FILE_HISTORY, fname)
  File "/usr/local/lib/python2.7/site-packages/Editra-0.7.01-py2.7.egg/Editra/src/ed_msg.py", line 321, in PostMessage
    _ThePublisher.sendMessage(msgtype, msgdata, context=context)
  File "/usr/local/lib/python2.7/site-packages/Editra-0.7.01-py2.7.egg/Editra/src/extern/pubsub.py", line 798, in sendMessage
    self.__topicTree.sendMessage(aTopic, message, onTopicNeverCreated)
  File "/usr/local/lib/python2.7/site-packages/Editra-0.7.01-py2.7.egg/Editra/src/extern/pubsub.py", line 483, in sendMessage
    deliveryCount += node.sendMessage(message)
  File "/usr/local/lib/python2.7/site-packages/Editra-0.7.01-py2.7.egg/Editra/src/extern/pubsub.py", line 321, in sendMessage
    listener(message)
  File "/usr/local/lib/python2.7/site-packages/Editra-0.7.01-py2.7.egg/Editra/src/ed_main.py", line 368, in OnUpdateFileHistory
    self.filehistory.AddFileToHistory(msg.GetData())
  File "/usr/local/lib/python2.7/site-packages/Editra-0.7.01-py2.7.egg/Editra/src/ebmlib/efilehist.py", line 65, in AddFileToHistory
    assert txtutil.IsUnicode(fname)
AssertionError

#---- End Traceback Info ----#

Original issue reported on code.google.com by chad.sla...@gmail.com on 29 Jun 2012 at 4:24

GoogleCodeExporter commented 9 years ago
You should use a Unicode build of wxWidgets with Editra. Only the unicode build 
is officially supported by Editra. The assert is there to ensure only Unicode 
data is passed through the application removing it may cause issues with mixed 
byte strings and unicode data in other parts of the program.

Original comment by CodyPrec...@gmail.com on 2 Jul 2012 at 2:11