def FileDlgFixExt(dlg, file):
    """this is needed to fix a problem in linux wx.FileDialog"""
    ext = dlg.GetWildcard().split('|')[2 * dlg.GetFilterIndex() + 1].strip('*')
    if ext not in file:
        file += ext
    return file
