changes from Python 2.7 to Python 3

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

changes from Python 2.7 to Python 3

Hans Ulrich Frink-2
Dear Devs
I am running gramps Master with python3 on windows8.1 and adapt some reports that i created and which run perfect on python 2.7 and gramps 4.1.3 to run on python3 and gramps 4.2
My question: did anything change with  'EventRoleType' ? as I get the following error:
line 298, in listeventref
    pedic[eventref.ref].add((eventref.get_role(),pe))
TypeError: unhashable type: 'EventRoleType'

Thanks
Uli



Full error report:
64747: WARNING: _manager.py: line 279: Plugin error (from 'PeopleCitationsEventRoleRelationFamParXLSReport'): No module named 'gramps.gen.my_relationship'
64747: ERROR: grampsapp.py: line 107: Unhandled exception
Traceback (most recent call last):
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\viewmanager.py", line 1634, in <lambda>
    return lambda x: run_plugin(pdata, dbstate, uistate)
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\viewmanager.py", line 1611, in run_plugin
    'error_msg': pmgr.get_fail_list()[-1][1][1]})
IndexError: list index out of range

100880: ERROR: _reportdialog.py: line 735: Failed to run report.
Traceback (most recent call last):
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\plug\report\_reportdialog.py", line 699, in report
    MyReport.write_report()
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\plugins\textreport\baptregisterreport.py", line 205, in write_report
    self.listeventref()
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\plugins\textreport\baptregisterreport.py", line 298, in listeventref
    pedic[eventref.ref].add((eventref.get_role(),pe))
TypeError: unhashable type: 'EventRoleType'

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: changes from Python 2.7 to Python 3

DS Blank
On Tue, May 26, 2015 at 9:46 AM, Hans Ulrich Frink <[hidden email]> wrote:
Dear Devs
I am running gramps Master with python3 on windows8.1 and adapt some reports that i created and which run perfect on python 2.7 and gramps 4.1.3 to run on python3 and gramps 4.2
My question: did anything change with  'EventRoleType' ? as I get the following error:

Can you provide instructions on how to replicate the error? Otherwise, it looks like a corrupted family tree.

-Doug

 
line 298, in listeventref
    pedic[eventref.ref].add((eventref.get_role(),pe))
TypeError: unhashable type: 'EventRoleType'

Thanks
Uli



Full error report:
64747: WARNING: _manager.py: line 279: Plugin error (from 'PeopleCitationsEventRoleRelationFamParXLSReport'): No module named 'gramps.gen.my_relationship'
64747: ERROR: grampsapp.py: line 107: Unhandled exception
Traceback (most recent call last):
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\viewmanager.py", line 1634, in <lambda>
    return lambda x: run_plugin(pdata, dbstate, uistate)
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\viewmanager.py", line 1611, in run_plugin
    'error_msg': pmgr.get_fail_list()[-1][1][1]})
IndexError: list index out of range

100880: ERROR: _reportdialog.py: line 735: Failed to run report.
Traceback (most recent call last):
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\plug\report\_reportdialog.py", line 699, in report
    MyReport.write_report()
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\plugins\textreport\baptregisterreport.py", line 205, in write_report
    self.listeventref()
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\plugins\textreport\baptregisterreport.py", line 298, in listeventref
    pedic[eventref.ref].add((eventref.get_role(),pe))
TypeError: unhashable type: 'EventRoleType'

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel



------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: changes from Python 2.7 to Python 3

Hans Ulrich Frink-2
Hi Doug
It is easy and difficult to give instructions how to replicate. Just use the report in both versions. If interested i could send that report.
Cheers
Uli

Von: [hidden email]
Gesendet: ‎26.‎05.‎2015 16:18
An: [hidden email]
Cc: [hidden email]
Betreff: Re: [Gramps-devel] changes from Python 2.7 to Python 3

On Tue, May 26, 2015 at 9:46 AM, Hans Ulrich Frink <[hidden email]> wrote:
Dear Devs
I am running gramps Master with python3 on windows8.1 and adapt some reports that i created and which run perfect on python 2.7 and gramps 4.1.3 to run on python3 and gramps 4.2
My question: did anything change with  'EventRoleType' ? as I get the following error:

Can you provide instructions on how to replicate the error? Otherwise, it looks like a corrupted family tree.

-Doug

 
line 298, in listeventref
    pedic[eventref.ref].add((eventref.get_role(),pe))
TypeError: unhashable type: 'EventRoleType'

Thanks
Uli



Full error report:
64747: WARNING: _manager.py: line 279: Plugin error (from 'PeopleCitationsEventRoleRelationFamParXLSReport'): No module named 'gramps.gen.my_relationship'
64747: ERROR: grampsapp.py: line 107: Unhandled exception
Traceback (most recent call last):
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\viewmanager.py", line 1634, in <lambda>
    return lambda x: run_plugin(pdata, dbstate, uistate)
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\viewmanager.py", line 1611, in run_plugin
    'error_msg': pmgr.get_fail_list()[-1][1][1]})
IndexError: list index out of range

100880: ERROR: _reportdialog.py: line 735: Failed to run report.
Traceback (most recent call last):
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\plug\report\_reportdialog.py", line 699, in report
    MyReport.write_report()
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\plugins\textreport\baptregisterreport.py", line 205, in write_report
    self.listeventref()
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\plugins\textreport\baptregisterreport.py", line 298, in listeventref
    pedic[eventref.ref].add((eventref.get_role(),pe))
TypeError: unhashable type: 'EventRoleType'

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel



------------------------------------------------------------------------------

_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: changes from Python 2.7 to Python 3

DS Blank
On Tue, May 26, 2015 at 3:37 PM, Hans Ulrich Frink <[hidden email]> wrote:
Hi Doug
It is easy and difficult to give instructions how to replicate. Just use the report in both versions. If interested i could send that report.

Oh, it is a personal report of yours? I don't think we can debug it without the report. But if it is just using standard operations, it sounds like a corruption.

-Doug

 
Cheers
Uli

Von: [hidden email]
Gesendet: ‎26.‎05.‎2015 16:18
An: [hidden email]
Cc: [hidden email]
Betreff: Re: [Gramps-devel] changes from Python 2.7 to Python 3

On Tue, May 26, 2015 at 9:46 AM, Hans Ulrich Frink <[hidden email]> wrote:
Dear Devs
I am running gramps Master with python3 on windows8.1 and adapt some reports that i created and which run perfect on python 2.7 and gramps 4.1.3 to run on python3 and gramps 4.2
My question: did anything change with  'EventRoleType' ? as I get the following error:

Can you provide instructions on how to replicate the error? Otherwise, it looks like a corrupted family tree.

-Doug

 
line 298, in listeventref
    pedic[eventref.ref].add((eventref.get_role(),pe))
TypeError: unhashable type: 'EventRoleType'

Thanks
Uli



Full error report:
64747: WARNING: _manager.py: line 279: Plugin error (from 'PeopleCitationsEventRoleRelationFamParXLSReport'): No module named 'gramps.gen.my_relationship'
64747: ERROR: grampsapp.py: line 107: Unhandled exception
Traceback (most recent call last):
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\viewmanager.py", line 1634, in <lambda>
    return lambda x: run_plugin(pdata, dbstate, uistate)
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\viewmanager.py", line 1611, in run_plugin
    'error_msg': pmgr.get_fail_list()[-1][1][1]})
IndexError: list index out of range

100880: ERROR: _reportdialog.py: line 735: Failed to run report.
Traceback (most recent call last):
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\plug\report\_reportdialog.py", line 699, in report
    MyReport.write_report()
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\plugins\textreport\baptregisterreport.py", line 205, in write_report
    self.listeventref()
  File "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\plugins\textreport\baptregisterreport.py", line 298, in listeventref
    pedic[eventref.ref].add((eventref.get_role(),pe))
TypeError: unhashable type: 'EventRoleType'

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel




------------------------------------------------------------------------------

_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: changes from Python 2.7 to Python 3

Josip
In reply to this post by Hans Ulrich Frink-2
26.5.2015. u 15:46, Hans Ulrich Frink je napisao/la:

> Dear Devs
> I am running gramps Master with python3 on windows8.1 and adapt some
> reports that i created and which run perfect on python 2.7 and gramps
> 4.1.3 to run on python3 and gramps 4.2
> My question: did anything change with  'EventRoleType' ? as I get the
> following error:
> line 298, in listeventref
>     pedic[eventref.ref].add((eventref.get_role(),pe))
> TypeError: unhashable type: 'EventRoleType'
>
> Thanks
> Uli
>
>
>
> Full error report:
> 64747: WARNING: _manager.py: line 279: Plugin error (from
> 'PeopleCitationsEventRoleRelationFamParXLSReport'): No module named
> 'gramps.gen.my_relationship'
> 64747: ERROR: grampsapp.py: line 107: Unhandled exception
> Traceback (most recent call last):
>   File
> "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\viewmanager.py",
> line 1634, in <lambda>
>     return lambda x: run_plugin(pdata, dbstate, uistate)
>   File
> "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\viewmanager.py",
> line 1611, in run_plugin
>     'error_msg': pmgr.get_fail_list()[-1][1][1]})
> IndexError: list index out of range
>
> 100880: ERROR: _reportdialog.py: line 735: Failed to run report.
> Traceback (most recent call last):
>   File
> "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\gui\plug\report\_reportdialog.py",
> line 699, in report
>     MyReport.write_report()
>   File
> "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\plugins\textreport\baptregisterreport.py",
> line 205, in write_report
>     self.listeventref()
>   File
> "C:\GrampsAIO64-4.1.3-PY3\bin\gramps-master\gramps\plugins\textreport\baptregisterreport.py",
> line 298, in listeventref
>     pedic[eventref.ref].add((eventref.get_role(),pe))
> TypeError: unhashable type: 'EventRoleType'
>
>

This last one looks like python3 error (list is unhashable)


--
Josip

------------------------------------------------------------------------------
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: changes from Python 2.7 to Python 3

Josip
31.5.2015. u 16:37, Hans Ulrich Frink je napisao/la:

> Thanks for replying.
> in my report in
> line 298, in listeventref
>     pedic[eventref.ref].add((eventref.get_role(),pe))
> I store utf-8 text. I changed to saving eventref-handle and apply
> .get_role() later on in a for loop
> That helped with the error.
> If you are interested in the report I enclose. It rund from
> plugins\textreports
> cheers
> Uli

How about this

refhandlelist =[]
pedic ={}
pedic = defaultdict(list)
for pe in self.__db.get_person_handles():
    for eventref in self.__db.get_person_from_handle(pe).event_ref_list:
        pedic[eventref.ref].append((eventref.get_role(),pe))


--
Josip

------------------------------------------------------------------------------
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Fwd: changes from Python 2.7 to Python 3

Hans Ulrich Frink-2
Dear Devs
Thanks for replying.
in my report in
line 298, in listeventref
    pedic[eventref.ref].add((eventref.get_role(),pe))
I store utf-8 text. I changed to saving eventref-handle and apply .get_role() later on in a for loop 
That helped with the error.
But I will try Josips modification as well.
If you are interested in the report I enclose. It runs from plugins\textreports

**** I tried to enclose the report, but is seems to be too big for mailing list.*****
cheers
Uli

------------------------------------------------------------------------------

_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel