Jim, you think this is an encoding problem?

Isaac,

First, this code is changed for upcoming  3.0 version, so there it should not happen.
Please test if it is a problem for linux too, this is an os specific piece of code.

Could you test some commands in python?
Just start a python session in windows, then:

python
Python 2.5.1 (r251:54863, May  2 2007, 16:27:44)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2      --> in your case this should be win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.getfilesystemencoding()
>>> import os
>>> user_home = os.environ['USERPROFILE']
>>> home_dir = os.path.join(user_home,'gramps')
>>> env_dir = os.path.join(home_dir,"env")
>>> print env_dir
>>> newfilename = '_WRITE_HERE_THE_FILENAME '
>>> drive, tmp_name = os.path.splitdrive(newfilename)
>>> tmp_name = tmp_name.lstrip(os.sep)
>>> print tmp_name
>>> env_name = os.path.join(os.path.expanduser(env_dir), tmp_name)
>>> print env_name

GRAMPS crashes on that second to last line, so the crash is in a python module.
I would like to have the output you obtain from the print statements above. Can you paste them here?
Now, the general problem is that if you write here a filename, it is in the encoding of how you type strings, however, in GRAMPS, the filename comes from a filechooser dialog, so it is given in the encoding of the filesystem.

Benny

PS, in linux it is user_home = os.environ['HOME'], and the join is with .gramps, not gramps

2008/2/7, Isaac Sánchez Barrera <isaac_saba@telefonica.net>:
When I save in GRAMPS XML format or GEDCOM, it saves correctly. If I try to save the file in a ".grdb" format, I get the error I told you on the last message.
I'm currently using English filenames without spaces (of the format x:\foldername\treefilename.ged OR x:\foldername\treefilename.gramps) and, if I'm not wrong, the GEDCOM (and the GRAMPS file) are using the UTF-8 charset, but there are surnames and individuals with Spanish characters.

OS: Windows XP Professional [Win32 5.1]

I've also got a Ubuntu-Studio installation and I think the same problem appears when trying to export to a .grdb file.

Thanks for your fast answer,

Isaac

PS: I've just signed up on the Windows list with my gmail account.



Benny Malengier wrote:
Isaac, this looks like a windows bug with the name of a database.

Is it correct you did a Save As, and gave a name with eg spanish characters? Could you give the name you gave?

It should work if you limit yourself to english language characters, but we would be interested to know what is not working on Windows. Could you give the Windows version too, and if possible, what charset you work with? I don't use windows so unfortunately I cannot tell you where to find that info, but we have a gramps windows mailing list (http://www.gramps-project.org/wiki/index.php?title=Contact&grampsd_wiki_session=1ac7cb6147a0c92333b0f1cd4112ff65) where you can ask that.

Benny

PS: export to .gramps format regularly on Windows

2008/2/7, Isaac Sánchez Barrera <isaac_saba@telefonica.net>:
User Information:
===================

I was saving on grdb


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

35655: ERROR: dbloader.py: line 488: Failed to open database.
Traceback (most recent call last):
  File "C:\Archivos de programa\gramps\DbLoader.py", line 485, in open_saved_as
    self.uistate.pulse_progressbar)
  File "C:\Archivos de programa\gramps\GrampsDb\_GrampsBSDDB.py", line 465, in load_from
    self.load(filename,callback)
  File "C:\Archivos de programa\gramps\GrampsDb\_GrampsBSDDB.py", line 354, in load
    tmp_name)
  File "C:\Python25\lib\ntpath.py", line 102, in join
    path += "\\" + b
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 33-35: invalid data

System Information:
===================

Python version: 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]
BSDDB version: 4.4.5.2
Gramps version: 2.2.10-1
LANG: es
OS: win32
Distribution:  


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gramps-bugs mailing list
Gramps-bugs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gramps-bugs