<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 10, 2019 at 7:08 AM Maris Nartiss <<a href="mailto:maris.gis@gmail.com">maris.gis@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">trešd., 2019. g. 9. janv., plkst. 18:47 — lietotājs Markus Neteler<br>
(<<a href="mailto:neteler@osgeo.org" target="_blank">neteler@osgeo.org</a>>) rakstīja:<br>
><br>
> On Wed, Jan 9, 2019 at 4:01 PM Maris Nartiss <<a href="mailto:maris.gis@gmail.com" target="_blank">maris.gis@gmail.com</a>> wrote:<br>
> ...<br>
> > Too late. Python is already broken (I had to fix my scripts;<br>
> > previously working tests are now broken). Do not expect your 7.2/7.4<br>
> > Python scripts to work with 7.6/7.8 without modifications (depends on<br>
> > functionality in use).<br>
><br>
> This is weird. Can you elaborate?<br>
Unfortunately I just fixed my code and moved on (as transitioning to<br>
Python 3 has to be done). But here are two examples from the top of my<br>
head:<br>
<a href="https://trac.osgeo.org/grass/ticket/3707" rel="noreferrer" target="_blank">https://trac.osgeo.org/grass/ticket/3707</a><br>
grass.script.parse now returns unicode strings, previously – byte<br>
strings (too lazy to search for a specific revision when it was<br>
introduced). Took a while to understand why calls to an external<br>
library started to fail.<br></blockquote><div><br></div><div>All the recent Python3 changes are in 7.8 only. Pietro did some Python 3 changes early on (not sure which version), unfortunately these were not clearly communicated. In general, all Python API functions should now (since 7.8) return unicode (for both Python 2 and 3), because that's what users would expect with python 3.</div><div><br></div><div>It's hard to know exactly how much work is still needed, because tests cover just part of the codebase. GUI is mostly working, some issues might come up for less used components, but these are mostly easy to fix, some of the issues are due to the switch to wxPython 4 (wxPython 3 doesn't support Python3). Python components with ctypes need more work. PyGRASS is getting there, tests should be mostly running (not doctests), but there is more work with temporal framework. Add-ons will probably need some small adjustments, but I haven't looked at that. Of course, I am testing only linux now.</div><div><br></div><div>Anna</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> > Still – it is not so bad – some Python parts never have been working<br>
> > correctly anyway ;-)<br>
><br>
> Please open ticket(s) if you want to see it fixed.<br>
This is really tricky as for many aspects of GRASS Python code there<br>
are no working examples in the GRASS source or add-ons and thus it is<br>
hard to understand if it is broken or just "I'm holding it the wrong<br>
way" ;-)<br>
I'll try to come up with a test case for raster.history, as it is one<br>
of things I can not get working at the moment.<br>
<br>
> Markus<br>
Māris.<br>
_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org" target="_blank">grass-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-dev</a></blockquote></div></div>