wxFileDialog in 2.5

Hi

The following code gives me a file dialog in wxPython 2.4 (GTK, Python 2.3 on Linux), but fails in 2.5:
from wxPython.wx import *
app = wxPySimpleApp()
frame = wxFrame(None, -1, 'test')
frame.Show(1)
wxFileDialog(frame).ShowModal()

The error message is the following:
Traceback (most recent call last):
  File "wxdialogtest.py", line 6, in ?
    wxFileDialog(frame).ShowModal()
  File "/usr/lib/python2.3/site-packages/wx/windows.py", line 2105, in __init__
wx.core.PyAssertionError: C++ assertion "m_pLine == 0" failed in ../src/common/fileconf.cpp(1295)

Versions are wxPythonGTK-py2.3-2.4.2.4-1 and wxPythonGTK-py2.3-2.5.1.5-1 on Fedora Core 1/2

Any ideas/help? (The absence of parameters is for simplification, it also does this with normal title, wildcard parameters, etc)

David

I tested the code on my WinXP box and... it works; so the error is not 2.5 per se, might be something related to wxPythonGTK

I have wxpython 2.5.1.5u on python 2.3.3

···

On Tue, 20 Apr 2004 18:30:54 +0200, David Fraser <davidf@sjsoft.com> wrote:

Hi

The following code gives me a file dialog in wxPython 2.4 (GTK, Python 2.3 on Linux), but fails in 2.5:
from wxPython.wx import *
app = wxPySimpleApp()
frame = wxFrame(None, -1, 'test')
frame.Show(1)
wxFileDialog(frame).ShowModal()

The error message is the following:
Traceback (most recent call last):
  File "wxdialogtest.py", line 6, in ?
    wxFileDialog(frame).ShowModal()
  File "/usr/lib/python2.3/site-packages/wx/windows.py", line 2105, in __init__
wx.core.PyAssertionError: C++ assertion "m_pLine == 0" failed in ../src/common/fileconf.cpp(1295)

Versions are wxPythonGTK-py2.3-2.4.2.4-1 and wxPythonGTK-py2.3-2.5.1.5-1 on Fedora Core 1/2

Any ideas/help? (The absence of parameters is for simplification, it also does this with normal title, wildcard parameters, etc)

David

--
Peter Damoc
Hacker Wannabe
http://www.sigmacore.net/about.html

David Fraser wrote:

Hi

The following code gives me a file dialog in wxPython 2.4 (GTK, Python 2.3 on Linux), but fails in 2.5:
from wxPython.wx import *
app = wxPySimpleApp()
frame = wxFrame(None, -1, 'test')
frame.Show(1)
wxFileDialog(frame).ShowModal()

The error message is the following:
Traceback (most recent call last):
File "wxdialogtest.py", line 6, in ?
   wxFileDialog(frame).ShowModal()
File "/usr/lib/python2.3/site-packages/wx/windows.py", line 2105, in __init__
wx.core.PyAssertionError: C++ assertion "m_pLine == 0" failed in ../src/common/fileconf.cpp(1295)

Versions are wxPythonGTK-py2.3-2.4.2.4-1 and wxPythonGTK-py2.3-2.5.1.5-1 on Fedora Core 1/2

Any ideas/help? (The absence of parameters is for simplification, it also does this with normal title, wildcard parameters, etc)

wxGTK's wxFileDialog will store/load a couple parameters from the current wxConfig, if there is one. That is where this error is coming from, perhaps there is a syntax error in the wxFileConfig? But I don't know why it would do it in the simple case above (and it doesn't for me) since you don't have an active wxConfig and it won't create one automatically...

Python 2.3 (#2, Aug 31 2003, 17:27:29)
[GCC 3.3.1 (Mandrake Linux 9.2 3.3.1-1mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from wxPython.wx import *
>>> app = wxPySimpleApp()
>>> f = wxFrame(None, -1, 'test')
>>> f.Show()
True
>>> wxYield() # to actually show the frame
True
>>> d = wxFileDialog(f)
>>> d.ShowModal()
5100
>>> d.Destroy()
True

···

app.MainLoop()

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

David Fraser wrote:

Hi

The following code gives me a file dialog in wxPython 2.4 (GTK, Python 2.3 on Linux), but fails in 2.5:
from wxPython.wx import *
app = wxPySimpleApp()
frame = wxFrame(None, -1, 'test')
frame.Show(1)
wxFileDialog(frame).ShowModal()

The error message is the following:
Traceback (most recent call last):
File "wxdialogtest.py", line 6, in ?
wxFileDialog(frame).ShowModal()
File "/usr/lib/python2.3/site-packages/wx/windows.py", line 2105, in __init__
wx.core.PyAssertionError: C++ assertion "m_pLine == 0" failed in ../src/common/fileconf.cpp(1295)

Versions are wxPythonGTK-py2.3-2.4.2.4-1 and wxPythonGTK-py2.3-2.5.1.5-1 on Fedora Core 1/2

Any ideas/help? (The absence of parameters is for simplification, it also does this with normal title, wildcard parameters, etc)

wxGTK's wxFileDialog will store/load a couple parameters from the current wxConfig, if there is one. That is where this error is coming from, perhaps there is a syntax error in the wxFileConfig? But I don't know why it would do it in the simple case above (and it doesn't for me) since you don't have an active wxConfig and it won't create one automatically...

Interesting. I had an error before from a duplicate setting in /usr/share/config/kdeglobals when trying to open the dialog. When I removed the duplicate (General/widgetStyle) it gave the error message. Is this related?
Where is the wxFileConfig/wxConfig stored? I can try debug it...

David

David Fraser wrote:

Robin Dunn wrote:

David Fraser wrote:

Hi

The following code gives me a file dialog in wxPython 2.4 (GTK, Python 2.3 on Linux), but fails in 2.5:
from wxPython.wx import *
app = wxPySimpleApp()
frame = wxFrame(None, -1, 'test')
frame.Show(1)
wxFileDialog(frame).ShowModal()

The error message is the following:
Traceback (most recent call last):
File "wxdialogtest.py", line 6, in ?
wxFileDialog(frame).ShowModal()
File "/usr/lib/python2.3/site-packages/wx/windows.py", line 2105, in __init__
wx.core.PyAssertionError: C++ assertion "m_pLine == 0" failed in ../src/common/fileconf.cpp(1295)

Versions are wxPythonGTK-py2.3-2.4.2.4-1 and wxPythonGTK-py2.3-2.5.1.5-1 on Fedora Core 1/2

Any ideas/help? (The absence of parameters is for simplification, it also does this with normal title, wildcard parameters, etc)

wxGTK's wxFileDialog will store/load a couple parameters from the current wxConfig, if there is one. That is where this error is coming from, perhaps there is a syntax error in the wxFileConfig? But I don't know why it would do it in the simple case above (and it doesn't for me) since you don't have an active wxConfig and it won't create one automatically...

Interesting. I had an error before from a duplicate setting in /usr/share/config/kdeglobals when trying to open the dialog. When I removed the duplicate (General/widgetStyle) it gave the error message. Is this related?

Oh yeah, I forgot about that... wxFileDialog also uses wxMimeTypesManager in order to try to show the right icons, etc. foir files. wxMimeTypesManager was recently changed to read the KDE files with wxFileConfig since the formats are the same. So yes, there may be something in one of your kde files that is confusing it. If you are able to isolate what it is and you feel that it is valid, then please enter a bug report about this.

For reference, the C++ code for wxMimeTypesManager that reads KDE files is in http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/src/unix/mimetype.cpp

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

David Fraser wrote:

Robin Dunn wrote:

David Fraser wrote:

Hi

The following code gives me a file dialog in wxPython 2.4 (GTK, Python 2.3 on Linux), but fails in 2.5:
from wxPython.wx import *
app = wxPySimpleApp()
frame = wxFrame(None, -1, 'test')
frame.Show(1)
wxFileDialog(frame).ShowModal()

The error message is the following:
Traceback (most recent call last):
File "wxdialogtest.py", line 6, in ?
wxFileDialog(frame).ShowModal()
File "/usr/lib/python2.3/site-packages/wx/windows.py", line 2105, in __init__
wx.core.PyAssertionError: C++ assertion "m_pLine == 0" failed in ../src/common/fileconf.cpp(1295)

Versions are wxPythonGTK-py2.3-2.4.2.4-1 and wxPythonGTK-py2.3-2.5.1.5-1 on Fedora Core 1/2

Any ideas/help? (The absence of parameters is for simplification, it also does this with normal title, wildcard parameters, etc)

wxGTK's wxFileDialog will store/load a couple parameters from the current wxConfig, if there is one. That is where this error is coming from, perhaps there is a syntax error in the wxFileConfig? But I don't know why it would do it in the simple case above (and it doesn't for me) since you don't have an active wxConfig and it won't create one automatically...

Interesting. I had an error before from a duplicate setting in /usr/share/config/kdeglobals when trying to open the dialog. When I removed the duplicate (General/widgetStyle) it gave the error message. Is this related?

Oh yeah, I forgot about that... wxFileDialog also uses wxMimeTypesManager in order to try to show the right icons, etc. foir files. wxMimeTypesManager was recently changed to read the KDE files with wxFileConfig since the formats are the same. So yes, there may be something in one of your kde files that is confusing it. If you are able to isolate what it is and you feel that it is valid, then please enter a bug report about this.

For reference, the C++ code for wxMimeTypesManager that reads KDE files is in http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/src/unix/mimetype.cpp

OK, thanks for the info, this helped to track it down.
The problem was the same section name appearing multiple times.
So the following patch was neccessary to stop it failing:
[KDE Action Restrictions]
action/help_about_kde=false

···

-
-[KDE Action Restrictions]
action/help_report_bug=false

(And another section name)

I think this was an original Fedora config file, so there probably should be a bug filed ... tomorrow

David

David Fraser wrote:

Robin Dunn wrote:

David Fraser wrote:

Robin Dunn wrote:

David Fraser wrote:

Hi

The following code gives me a file dialog in wxPython 2.4 (GTK, Python 2.3 on Linux), but fails in 2.5:
from wxPython.wx import *
app = wxPySimpleApp()
frame = wxFrame(None, -1, 'test')
frame.Show(1)
wxFileDialog(frame).ShowModal()

The error message is the following:
Traceback (most recent call last):
File "wxdialogtest.py", line 6, in ?
wxFileDialog(frame).ShowModal()
File "/usr/lib/python2.3/site-packages/wx/windows.py", line 2105, in __init__
wx.core.PyAssertionError: C++ assertion "m_pLine == 0" failed in ../src/common/fileconf.cpp(1295)

Versions are wxPythonGTK-py2.3-2.4.2.4-1 and wxPythonGTK-py2.3-2.5.1.5-1 on Fedora Core 1/2

Any ideas/help? (The absence of parameters is for simplification, it also does this with normal title, wildcard parameters, etc)

wxGTK's wxFileDialog will store/load a couple parameters from the current wxConfig, if there is one. That is where this error is coming from, perhaps there is a syntax error in the wxFileConfig? But I don't know why it would do it in the simple case above (and it doesn't for me) since you don't have an active wxConfig and it won't create one automatically...

Interesting. I had an error before from a duplicate setting in /usr/share/config/kdeglobals when trying to open the dialog. When I removed the duplicate (General/widgetStyle) it gave the error message. Is this related?

Oh yeah, I forgot about that... wxFileDialog also uses wxMimeTypesManager in order to try to show the right icons, etc. foir files. wxMimeTypesManager was recently changed to read the KDE files with wxFileConfig since the formats are the same. So yes, there may be something in one of your kde files that is confusing it. If you are able to isolate what it is and you feel that it is valid, then please enter a bug report about this.

For reference, the C++ code for wxMimeTypesManager that reads KDE files is in http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/src/unix/mimetype.cpp

OK, thanks for the info, this helped to track it down.
The problem was the same section name appearing multiple times.
So the following patch was neccessary to stop it failing:
[KDE Action Restrictions]
action/help_about_kde=false
-
-[KDE Action Restrictions]
action/help_report_bug=false

(And another section name)

I think this was an original Fedora config file, so there probably should be a bug filed ... tomorrow

David

For anyone interested, I have filed bug 939195 at
https://sourceforge.net/tracker/index.php?func=detail&aid=939195&group_id=9863&atid=109863

David