gramps/gramps/gen/utils
John Ralls 85a1c39092 7258: Transcode FS paths to avoid a crash
The problem is really that the paths get munged into strings in the
system codepage, losing or misinterpreting most Unicode. Python's os
module is smart enough to encode the unicode to the file system
encoding, but the bsddb module needs a little help.

Provide a new function, constfunc.get_env_var(name, default=None) to
cleanly import Unicode environment variables in Windows and use it in
place of all instances of foo = os.environ['BAR] or foo =
os.environ.get('BAR').

Os path functions are smart enough to convert unicode to the file system
encoding on their own, but Db functions aren't, so provide an _encode
function in gen.db.write.py and apply it where a path is being passed to
DBEnv.open().

Also convert paths from the UI to unicode from 'utf8' rather than
sysfilesystemencoding. The latter happens to be correct most of the time
on Linux and OSX but is wrong on Windows.
2014-03-23 15:09:51 -07:00
..
docgen 6618: Export CSV crashes gramps 4.0 beta 2013-04-15 11:01:08 +00:00
test 6926: merge to trunk p2: gramps/ code changes 2013-10-16 14:04:21 +00:00
__init__.py GEPS 026: Replace 'make' for Gramps build 2012-09-30 11:55:52 +00:00
alive.py Changed {} format 2013-12-20 00:18:46 -05:00
callback.py Improve gen.utils documentation 2013-11-12 21:44:01 +00:00
callman.py Add Tag class to CallbackManager 2013-03-23 22:26:35 +00:00
cast.py Fix crash when Gramps is passed an invalid locale 2013-08-09 19:58:34 +00:00
config.py Code guideline: move to relative import within gen module 2012-10-01 20:53:08 +00:00
configmanager.py 7519: GRAMPs unable to handle ... Path with accented characters 2014-03-17 12:54:22 -07:00
db.py Improve gen.utils documentation 2013-11-12 21:44:01 +00:00
debug.py debug.profile: support kwargs and ret values 2014-02-16 13:57:47 +02:00
file.py Add checksum to media objects 2013-08-15 17:49:51 +00:00
grampslocale.py 7258: Transcode FS paths to avoid a crash 2014-03-23 15:09:51 -07:00
id.py 2620: GEPS 031: Python 3 support - 3.2 2012-11-07 17:53:14 +00:00
image.py 7288/7290: port image_dpi legacy gtk code to gtk3 2013-12-15 15:09:12 +02:00
keyword.py GrampsLocale: Remove get_translation() 2013-04-12 22:32:11 +00:00
lds.py GrampsLocale: Remove get_translation() 2013-04-12 22:32:11 +00:00
libformatting.py Code guideline: move to relative import within gen module 2012-10-01 20:53:08 +00:00
location.py GEPS 6: Implement place hierarchy 2013-11-01 19:13:16 +00:00
maclocale.py Remove some left-over diagnostic messages. 2014-03-08 13:40:47 -08:00
place.py Improve gen.utils documentation 2013-11-12 21:44:01 +00:00
resourcepath.py 7258: Transcode FS paths to avoid a crash 2014-03-23 15:09:51 -07:00
string.py 7124: Complete Individual Report does incomplete translation 2013-10-20 16:46:53 +00:00
unknown.py GrampsLocale: Remove get_translation() 2013-04-12 22:32:11 +00:00