You are here

[Fixed] Gramps 3.4.2 - Error when running Detailed Descendant Report

8 posts / 0 new
Last post
grissey
Offline
Last seen: 1 year 6 months ago
Joined: 2012-10-08 15:57
[Fixed] Gramps 3.4.2 - Error when running Detailed Descendant Report

I reported the following error to Gramps Bug Tracker and they replied suggesting I report to the PortableApps forum. It looks to me like an invalid path is specified (see end of Error Details).

Summary: Error when running Detailed Descendant Report
Description:
User Information:
===================

I just was initiating the "Detailed Descendant Report" for the Active Person
when this error occurred

Error Details:
===================

12233: WARNING: Spell.py: line 60: Spelling checker is not installed
22750: WARNING: geography.gpr.py: line 42: WARNING: osmgpsmap module not loaded.
Geography functionality will not be available.98530: ERROR: gramps.py: line 105:
Unhandled exception
Traceback (most recent call last):
File "C:\PortableApps\GrampsPortable\App\Gramps\gui\viewmanager.py", line
1911, in
return lambda Secret run_plugin(pdata, dbstate, uistate)
File "C:\PortableApps\GrampsPortable\App\Gramps\gui\viewmanager.py", line
1898, in run_plugin
pdata.category, pdata.require_active,
File
"C:\PortableApps\GrampsPortable\App\Gramps\gui\plug\report\_reportdialog.py",
line 636, in report
dialog = dialog_class(dbstate, uistate, options_class, name, trans_name)
File
"C:\PortableApps\GrampsPortable\App\Gramps\gui\plug\report\_textreportdialog.py",
line 102, in __init__
name, translated_name)
File
"C:\PortableApps\GrampsPortable\App\Gramps\gui\plug\report\_docreportdialog.py",
line 70, in __init__
name, trans_name)
File
"C:\PortableApps\GrampsPortable\App\Gramps\gui\plug\report\_reportdialog.py",
line 104, in __init__
self.init_options(option_class)
File
"C:\PortableApps\GrampsPortable\App\Gramps\gui\plug\report\_reportdialog.py",
line 135, in init_options
self.options = option_class(self.raw_name, self.db)
File
"C:\PortableApps\GrampsPortable\App\Gramps\plugins\textreport\DetAncestralReport.py",
line 719, in __init__
MenuReportOptions.__init__(self, name, dbase)
File "C:\PortableApps\GrampsPortable\App\Gramps\gen\plug\report\_options.py",
line 835, in __init__
MenuOptions.__init__(self)
File "C:\PortableApps\GrampsPortable\App\Gramps\gen\plug\_options.py", line
491, in __init__
self.add_menu_options(self.menu)
File
"C:\PortableApps\GrampsPortable\App\Gramps\plugins\textreport\DetAncestralReport.py",
line 759, in add_menu_options
for language in TransUtils.get_available_translations():
File "C:\PortableApps\GrampsPortable\App\Gramps\TransUtils.py", line 293, in
get_available_translations
for langdir in os.listdir(LOCALEDIR):
WindowsError: [Error 3] The system cannot find the path specified:
'C:\\PortableApps\\GrampsPortable\\App\\Gramps\\lang/*.*'

Bart.S
Offline
Last seen: 4 months 1 week ago
Developer
Joined: 2008-07-23 07:56
*sigh

I think something like the following is needed in TransUtils.py after line 52.

	if os.path.exists(LOCALEDIR):
		pass
	else:
		os.makedirs(LOCALEDIR)

Disclaimer: I'm not a programmer and haven't tested this. IMHO, it should be fixed upstream by the Gramps developers.

As a workaround, you could create the directory C:\PortableApps\GrampsPortable\App\Gramps\lang yourself.

grissey
Offline
Last seen: 1 year 6 months ago
Joined: 2012-10-08 15:57
Detailed Descendants Report

Thanks for the info.
Just to let you know that creating the directory, as suggested, fixes the problem.

Bart.S
Offline
Last seen: 4 months 1 week ago
Developer
Joined: 2008-07-23 07:56
You're welcome.

Now we can set the topic to [Solved]. Smile

Bart.S
Offline
Last seen: 4 months 1 week ago
Developer
Joined: 2008-07-23 07:56
Patch

I've created a patch. Would you be so kind and point to it in your Gramps issue report? Otherwise the Gramps developers probably won't find it. Thanks

--- F:/PortableApps/Gramps Portable/App/Gramps/TransUtils.py	Sun Oct 28 10:45:04 2012
+++ F:/PortableApps/GrampsPortable/App/Gramps/TransUtils.py	Fri Nov 02 09:00:00 2012
@@ -48,8 +48,11 @@
 # Public Constants
 #
 #-------------------------------------------------------------------------
-if "GRAMPSI18N" in os.environ:
-    LOCALEDIR = os.environ["GRAMPSI18N"]
+if os.environ.has_key('GRAMPSI18N'):
+    if os.path.exists(os.environ['GRAMPSI18N']):
+        LOCALEDIR = os.environ['GRAMPSI18N']
+    else:
+        LOCALEDIR = None
 elif os.path.exists( os.path.join(const.ROOT_DIR, "lang") ):
     LOCALEDIR = os.path.join(const.ROOT_DIR, "lang")
 elif os.path.exists(os.path.join(const.PREFIXDIR, "share/locale")):
@@ -219,8 +222,7 @@
         return
 
     # No complete/working translation found
-    logging.warning("Translation might not be complete/not working for",\
-           locale.getlocale()[0])
+    logging.warning("Translation might not be complete/not working for your locale.")
     
 
 def get_localedomain():
John T. Haller
John T. Haller's picture
Online
Last seen: 1 min 45 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Patch for Us

We can fix this in the next release by adding a PortableApps.comInstallerCustom.nsh in the Other\Source directory with the following:

!macro CustomCodePostInstall
	CreateDirectory "$INSTDIR\App\Gramps\lang"
!macroend

This ensures the lang directory exists even if the user elected not to install the translations.

Sometimes, the impossible can become possible, if you're awesome!

Bart.S
Offline
Last seen: 4 months 1 week ago
Developer
Joined: 2008-07-23 07:56
Fixed upstream

This issue is fixed in Gramps 3.4.3.

And btw, we had this PortableApps.comInstallerCustom.nsh until 3.4.1. Blum

John T. Haller
John T. Haller's picture
Online
Last seen: 1 min 45 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Fixed in 3.4.3

This issue was fixed in Gramps 3.4.3 upstream and, thus, Gramps Portable 3.4.3. We neglected to close the bug at the time, so I'm doing so now.

Sometimes, the impossible can become possible, if you're awesome!

Log in or register to post comments