PYTHONPATH and date format

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

PYTHONPATH and date format

derHeinzi
Hi,
I'm running GRAMPS 3.0.4-1 on WinXP with intstalled Python 2.5.2 and wx in version 2.8 installed in the ../Python25/Lib/site-packages/.. directory. The LANG environment variable is set to DE, so GRAMPS is running in a german version. I installed Boa Constructor as a Python IDE and tried to run some wx examples for learning purposes. For this to work I had to set the the environment variable PYTHONPATH to
C:\USR\Python25;C:\USR\Python25\Lib\site-packages\wx-2.8-msw-unicode\wxPython.

When working with GRAMPS again, I found the date entries in events to turn red (invalid date) and the date input dialog to be insensitive for these dates, so no data could be entered. In an empty date field a date could be entered (as well by typing the date as by using the date input dialog) and was shown in the "usual" way (e.g. "3. Mai 1993"), but immediately turned red again (invalid date).
After searching for corrupt data in the database (database repair): no change. All functions of GRAMPS were running flawlessly, except for the strange date behaviour. (I feared to end up with a useless database!) But the same was observed on earlier backups! So there had to be another reason.

Well, after some time I removed the PYTHONPATH entry and Bingo! the date was OK again.

Could someone explain to me why the PYTHONPATH environment variable has this effect on date entries in GRAMPS?

TIA  derHeinzi
Reply | Threaded
Open this post in threaded view
|

Re: PYTHONPATH and date format

Benny Malengier


2009/2/14 derHeinzi <[hidden email]>

Hi,
I'm running GRAMPS 3.0.4-1 on WinXP with intstalled Python 2.5.2 and wx in
version 2.8 installed in the ../Python25/Lib/site-packages/.. directory. The
LANG environment variable is set to DE, so GRAMPS is running in a german
version. I installed Boa Constructor as a Python IDE and tried to run some
wx examples for learning purposes. For this to work I had to set the the
environment variable PYTHONPATH to
C:\USR\Python25;C:\USR\Python25\Lib\site-packages\wx-2.8-msw-unicode\wxPython.

When working with GRAMPS again, I found the date entries in events to turn
red (invalid date) and the date input dialog to be insensitive for these
dates, so no data could be entered. In an empty date field a date could be
entered (as well by typing the date as by using the date input dialog) and
was shown in the "usual" way (e.g. "3. Mai 1993"), but immediately turned
red again (invalid date).
After searching for corrupt data in the database (database repair): no
change. All functions of GRAMPS were running flawlessly, except for the
strange date behaviour. (I feared to end up with a useless database!) But
the same was observed on earlier backups! So there had to be another reason.

Well, after some time I removed the PYTHONPATH entry and Bingo! the date was
OK again.

Could someone explain to me why the PYTHONPATH environment variable has this
effect on date entries in GRAMPS?

You should only change your path locally when working with this program,  not globally for all programs. In linux that would be in the script running the program.
When importing modules, python looks in the PYTHONPATH to find them, so it would appear one of the modules in GRAMPS conflicts with one present in wxpython. If you could tell us which, we could consider changing the name so as not to have this conflict.

Benny


TIA  derHeinzi

--
View this message in context: http://www.nabble.com/PYTHONPATH-and-date-format-tp22011134p22011134.html
Sent from the GRAMPS - User mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: PYTHONPATH and date format

derHeinzi
Thank you for the explanation, Benny. Since I'm still a learner in GRAMPS and Python I'm afraid I will not (yet) be able to provide the information you requested. But I will use start scripts setting the environment to avoid the problem. Thanks again.
derHeinzi

Benny Malengier wrote
2009/2/14 derHeinzi <heinzbrinker@yahoo.de>

> Well, after some time I removed the PYTHONPATH entry and Bingo! the date
> was OK again.
>
> Could someone explain to me why the PYTHONPATH environment variable has
> this effect on date entries in GRAMPS?

You should only change your path locally when working with this program,
...
would appear one of the modules in GRAMPS conflicts with one present in
wxpython. If you could tell us which, we could consider changing the name so
as not to have this conflict.

Benny
Reply | Threaded
Open this post in threaded view
|

Re: PYTHONPATH and date format

derHeinzi
In reply to this post by Benny Malengier
Hello again, Benny,

its been a while, but I think I found new information on this topic:

Benny Malengier wrote
When importing modules, python looks in the PYTHONPATH to find them, so it
would appear one of the modules in GRAMPS conflicts with one present in
wxpython. If you could tell us which, we could consider changing the name so
as not to have this conflict.

Benny
What I did was finding duplicates by the program DupKiller (http://www.dupkiller.net/) to find files with the same name in gramps and Python / wx. Here are the the results that might help you figure out where conflicts could come up:

Duplicates
----- attribute.py in
C:\USR\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\XRCed\
C:\USR\gramps\gen\lib\
----- autocomp.py in
C:\USR\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\Editra\src\autocomp\
C:\USR\gramps\
----- base.py in
C:\USR\Python25\Lib\email\mime\
C:\USR\gramps\gen\db\
----- calendar.py in
C:\USR\gramps\gen\lib\
C:\USR\Python25\Lib\
C:\USR\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\lib\
C:\USR\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\
C:\USR\Python25\Lib\site-packages\wx-2.8-msw-unicode\wxPython\
C:\USR\Python25\Lib\site-packages\wx-2.8-msw-unicode\wxPython\lib\
C:\USR\gramps\plugins\
----- dbutils.py in
C:\USR\Python25\Lib\bsddb\
C:\USR\gramps\gen\utils\
----- errors.py in                                                                        
C:\USR\Python25\Lib\email\
C:\USR\gramps\
C:\USR\Python25\Lib\distutils\
----- filter.py  in
C:\USR\gramps\gen\proxy\
C:\USR\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\Editra\src\extern\pygments\
----- utils.py  in
C:\USR\gramps\
C:\USR\Python25\Lib\email\

Maybe you should rename all the above files (e.g. add a leading g for GRAMPS so errors.py becomes gerrors.py) to avoid conflicts as long as they are not related?
Some of the filenames differ in case, but bear in mind that windows is not case sensitive with filenames.

Kind regards

Heinz