[GRASS-dev] Handling of Python scripts on MS Windows

Hi all,

Anna and I have fixed the script handing on MS Windows. Modules which are Python scripts and/or are from GRASS addons and/or calls other modules which are Python scripts didn’t worked for various reasons. The changeset r57910 should fix them all (and thus should fix #2039, particularly the MAXREPEAT error).

Unfortunately, the fix is not the absolutely correct solution. There are basically two things which are not completely resolved.

The idea of having scripts (and addons’ scripts) on the path and not using system to run a script (and using executable instead), does not seem completely correct to me. Although, this is needed for the system command line (which works now but I don’t know why).

The other problem is that now the solution is scattered over several functions on different places and there is some duplication. The reason is that there is a command running functionality repeated several times on various places in the GUI and in grass.script. This requires more complex refactoring.

If this influences #2015 is unclear. I don’t want to blame anybody but it seems (according to what we tested that time) that #2015 just appeared for (almost) all MS Windows versions and all GRASS versions (and builds) and then just disappeared, so one would say that the problem was with the system.

Vaclav

[r57910] https://trac.osgeo.org/grass/changeset/57910
[#2039] http://trac.osgeo.org/grass/ticket/2039
[#2015] http://trac.osgeo.org/grass/ticket/2015

Vaclav Petras wrote:

Anna and I have fixed the script handing on MS Windows. Modules which are
Python scripts and/or are from GRASS addons and/or calls other modules
which are Python scripts didn't worked for various reasons. The changeset
r57910 should fix them all (and thus should fix #2039, particularly the
MAXREPEAT error).

Note that I've removed the hacks from core.py. So whatever bugs they
were trying to work around will have to be fixed where they originate.

--
Glynn Clements <glynn@gclements.plus.com>

Comparing to unix-like systems, MS Windows works strangely in terms of executing programs (and scripts). Additionally, MS Windows don’t have package manager and packagers which would take care of incompatibilities between applications. Moreover, most of the MS Windows applications behaves in the way that they are the best and the only application on the system, so they just associate every possible file with their programs (and interpreters).

I’m always for pure, correct and clean solutions. However, I’m not expert neither in MS Windows registry nor in Python virtual environments nor in covering .py to .exe and nobody provided other implementation, so I provided mine which is messy but it only reflects mess which I—maybe just because of my lack of knowledge—see on that system.

I don’t vote for my change to be permanent if we find a different solution. But the fact is that scripts are not working now (for large number of people) and this is the only solution we have. Like with democracy which not perfect but it is the best political system available.

Vaclav

[r57910] https://trac.osgeo.org/grass/changeset/57910

[r57911] https://trac.osgeo.org/grass/changeset/57911

[#2039] http://trac.osgeo.org/grass/ticket/2039
[#2015] http://trac.osgeo.org/grass/ticket/2015

···

On Wed, Oct 2, 2013 at 7:16 AM, Glynn Clements <glynn@gclements.plus.com> wrote:

Vaclav Petras wrote:

Anna and I have fixed the script handing on MS Windows. Modules which are
Python scripts and/or are from GRASS addons and/or calls other modules
which are Python scripts didn’t worked for various reasons. The changeset
r57910 should fix them all (and thus should fix #2039, particularly the
MAXREPEAT error).

Note that I’ve removed the hacks from core.py. So whatever bugs they
were trying to work around will have to be fixed where they originate.


Glynn Clements <glynn@gclements.plus.com>

On 02/10/13 16:47, Vaclav Petras wrote:

I'm always for pure, correct and clean solutions. However, I'm not
expert neither in MS Windows registry nor in Python virtual environments
nor in covering .py to .exe and nobody provided other implementation, so
I provided mine which is messy but it only reflects mess which I---maybe
just because of my lack of knowledge---see on that system.

I don't vote for my change to be permanent if we find a different
solution. But the fact is that scripts are not working now (for large
number of people) and this is the only solution we have. Like with
democracy which not perfect but it is the best political system available.

I understand the frustration, but I do agree with Glynn that sometimes hack solutions are worse than no solution, as they cover (and make us forget) the underlying problem. And as this is a fundamental issue, I think we just have to be patient until someone finds the best solution.

I'm no Python expert at all, and don't have much time currently to look any further into any of this, but have you tried the python launcher as a possible path as outlined in [1] ?

Moritz

[1] http://lists.osgeo.org/pipermail/grass-dev/2013-July/065197.html

Vaclav

[r57910] https://trac.osgeo.org/grass/changeset/57910
[r57911] https://trac.osgeo.org/grass/changeset/57911
[#2039] http://trac.osgeo.org/grass/ticket/2039
[#2015] http://trac.osgeo.org/grass/ticket/2015

On Wed, Oct 2, 2013 at 7:16 AM, Glynn Clements <glynn@gclements.plus.com
<mailto:glynn@gclements.plus.com>> wrote:

    Vaclav Petras wrote:

     > Anna and I have fixed the script handing on MS Windows. Modules
    which are
     > Python scripts and/or are from GRASS addons and/or calls other
    modules
     > which are Python scripts didn't worked for various reasons. The
    changeset
     > r57910 should fix them all (and thus should fix #2039,
    particularly the
     > MAXREPEAT error).

    Note that I've removed the hacks from core.py. So whatever bugs they
    were trying to work around will have to be fixed where they originate.

    --
    Glynn Clements <glynn@gclements.plus.com
    <mailto:glynn@gclements.plus.com>>

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Hi Vaclav,

On Wed, Oct 2, 2013 at 3:47 PM, Vaclav Petras <wenzeslaus@gmail.com> wrote:

I'm always for pure, correct and clean solutions. However, I'm not expert
neither in MS Windows registry nor in Python virtual environments nor in
covering .py to .exe and nobody provided other implementation, so I provided
mine which is messy but it only reflects mess which I---maybe just because
of my lack of knowledge---see on that system.

Maybe, to resolve this issue, we can integrate in the windows
installer the virtualenv[0] python package, as reported in the link:
"virtualenv is a tool to create isolated Python environments". It
should works with Windows... but I never used on this platform... I'm
using virtualenv on linux, because the default python interpreter on
my distribution is python3.x, and in this way I can easily test GRASS
using different python versions (2.4, 2.6, 2.7).

I'm ignorant on Windows and maybe virtualenv is useless in this
case... or maybe integrate virtualenv on the windows installer is too
complex, I have no clue!

Pietro

[0] https://pypi.python.org/pypi/virtualenv

On Wed, Oct 2, 2013 at 12:32 PM, Pietro <peter.zamb@gmail.com> wrote:

Hi Vaclav,

On Wed, Oct 2, 2013 at 3:47 PM, Vaclav Petras <wenzeslaus@gmail.com>
wrote:
> I'm always for pure, correct and clean solutions. However, I'm not expert
> neither in MS Windows registry nor in Python virtual environments nor in
> covering .py to .exe and nobody provided other implementation, so I
provided
> mine which is messy but it only reflects mess which I---maybe just
because
> of my lack of knowledge---see on that system.

Maybe, to resolve this issue, we can integrate in the windows
installer the virtualenv[0] python package, as reported in the link:
"virtualenv is a tool to create isolated Python environments". It
should works with Windows... but I never used on this platform... I'm
using virtualenv on linux, because the default python interpreter on
my distribution is python3.x, and in this way I can easily test GRASS
using different python versions (2.4, 2.6, 2.7).

I'm ignorant on Windows and maybe virtualenv is useless in this
case... or maybe integrate virtualenv on the windows installer is too
complex, I have no clue!

Hi,

the question is: is anyone going to resolve this issue? Currently this is a
blocker for many Windows users which we can loose easily if we don't
provide solution soon enough.

Is this workaround worse than all the others which are already there?

Anna

Pietro

[0] https://pypi.python.org/pypi/virtualenv
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Moritz Lennert wrote:

I understand the frustration, but I do agree with Glynn that sometimes
hack solutions are worse than no solution, as they cover (and make us
forget) the underlying problem.

They don't just make you forget the underlying problem, they actively
obstruct attempts to actually fix it.

Windows does actually have a mechanism for executing scripts
(otherwise BAT/CMD files wouldn't work: those don't actually get any
special treatment compared to other types of scripts).

That mechanism requires that the interpreter is associated with the
file type, which in turn is associated with the extension. That cannot
be avoided. You might be able to patch the functions in core.py to
work around this requirement, but you can't patch e.g. MSVCRT's
system() function. If the relevant file associations aren't set
correctly, Python scripts will never be fully functional.

Secondly, in order to avoid having to specify the extension when
executing scripts, the extension must be present in PATHEXT. This one
shouldn't be a problem, as the environment is per-process, so the
GRASS start-up script can ensure that PATHEXT is set correctly (unlike
the file associations, which are system-wide).

In the unlikely event that it really is a problem, I'd rather just
keep the extension on all platforms. It's not as if Unix has problems
with dots in filenames.

--
Glynn Clements <glynn@gclements.plus.com>

On 02/10/13 18:57, Anna Petrášová wrote:

On Wed, Oct 2, 2013 at 12:32 PM, Pietro <peter.zamb@gmail.com
<mailto:peter.zamb@gmail.com>> wrote:

    Hi Vaclav,

    On Wed, Oct 2, 2013 at 3:47 PM, Vaclav Petras <wenzeslaus@gmail.com
    <mailto:wenzeslaus@gmail.com>> wrote:
     > I'm always for pure, correct and clean solutions. However, I'm
    not expert
     > neither in MS Windows registry nor in Python virtual environments
    nor in
     > covering .py to .exe and nobody provided other implementation, so
    I provided
     > mine which is messy but it only reflects mess which I---maybe
    just because
     > of my lack of knowledge---see on that system.

    Maybe, to resolve this issue, we can integrate in the windows
    installer the virtualenv[0] python package, as reported in the link:
    "virtualenv is a tool to create isolated Python environments". It
    should works with Windows... but I never used on this platform... I'm
    using virtualenv on linux, because the default python interpreter on
    my distribution is python3.x, and in this way I can easily test GRASS
    using different python versions (2.4, 2.6, 2.7).

    I'm ignorant on Windows and maybe virtualenv is useless in this
    case... or maybe integrate virtualenv on the windows installer is too
    complex, I have no clue!

Hi,

the question is: is anyone going to resolve this issue? Currently this
is a blocker for many Windows users which we can loose easily if we
don't provide solution soon enough.

Users come and users go. I don't think that we have to create unsatisfactory hacks just to get some users now, with the risk of losing them (and others) later when it becomes apparent that the hack doesn't solve everything...

I think we just have to accept that MS Windows work power is _very_ limited amongst us and that solutions for Windows will take time to be put in place.

Moritz

Hi all,

2013/10/3 Moritz Lennert <mlennert@club.worldonline.be>:

the question is: is anyone going to resolve this issue? Currently this
is a blocker for many Windows users which we can loose easily if we
don't provide solution soon enough.

that's the point. This issue is open for many months(!). The answer
for your question is quite predictable. The problem is that we don't
have a full-time Windows developer. Personally I was forced (by the
students or my collegues) to try to fix some of Windows bugs in the
past. If you are forced, usually you invest only a limited time to
solve the issue. Result is sometimes something like workarounds.
Better than nothing I would say!

Users come and users go. I don't think that we have to create unsatisfactory

Huh, I hope you are kidding otherwise I do not understand. Yes, they
come and go, but we should try to convince them to use our software
and not to dissuade them from using it. Please tell me what I can tell
the students who are attending my classes (they use Windows mostly) or
to my collegue (hydrologist) who would like to use GRASS in
comparision to ArcGIS in his research grant. Yes, he is also a Windows
user. I cannot find a reasonable explanation of this situation what I
can tell them.

First of all, thanks Vaclav that he found time to take a look at this
issue. His time is limited (as for all of us), the solution is not
perfect, but it's anyway step towards. After r57911 we are in the same
situation. Python scripts called from Python code do not work again!
It's very serious issue, yes, it's a blocker.

@Glynn: please revert your revert or find a time to implement better solution.

@Moritz: you were discussing tech-previews for many times. Are you
able to imagine releasing tech-previews with this serious bug. Not me.

hacks just to get some users now, with the risk of losing them (and others)
later when it becomes apparent that the hack doesn't solve everything...

What means "solve everything", could you elaborate a little bit? So
it's better to have broken functionality on Windows for many months?
It will probably not change within next weeks/months. Good to know,
it's a nice policy :wink:

I think we just have to accept that MS Windows work power is _very_ limited
amongst us and that solutions for Windows will take time to be put in place.

Right, that's what I am speaking about.

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

On 06/10/13 17:05, Martin Landa wrote:

Hi all,

2013/10/3 Moritz Lennert<mlennert@club.worldonline.be>:

the question is: is anyone going to resolve this issue? Currently this
is a blocker for many Windows users which we can loose easily if we
don't provide solution soon enough.

that's the point. This issue is open for many months(!). The answer
for your question is quite predictable. The problem is that we don't
have a full-time Windows developer. Personally I was forced (by the
students or my collegues) to try to fix some of Windows bugs in the
past. If you are forced, usually you invest only a limited time to
solve the issue. Result is sometimes something like workarounds.
Better than nothing I would say!

Users come and users go. I don't think that we have to create unsatisfactory

Huh, I hope you are kidding otherwise I do not understand. Yes, they
come and go, but we should try to convince them to use our software
and not to dissuade them from using it. Please tell me what I can tell
the students who are attending my classes (they use Windows mostly) or
to my collegue (hydrologist) who would like to use GRASS in
comparision to ArcGIS in his research grant. Yes, he is also a Windows
user. I cannot find a reasonable explanation of this situation what I
can tell them.

I agree with the frustration, I live it myself, but I don't think that we should make people believe that we have solutions when we don't. I would love to be able to tell my students to go ahead, use GRASS, it "just works" (tm), but there are limitations, and we do not seem to have the manpower currently to remove those rapidly. And even if this is frustrating, I prefer to say that, and hope that they'll find their way back to GRASS once we've had the opportunity to fix the issue.

And it's not as if GRASS is completely unusable on Windows...

First of all, thanks Vaclav that he found time to take a look at this
issue.

+1

His time is limited (as for all of us), the solution is not
perfect, but it's anyway step towards.

Well, that is the question. According to some, it is a step that takes us further away from a real solution. And some quick fixes actually will cost us more developer time in the long run.

This does not mean I don't support Vaclav in trying, on the contrary, but trying also implies the possibility of error.

After r57911 we are in the same
situation. Python scripts called from Python code do not work again!
It's very serious issue, yes, it's a blocker.

I agree. That's why we haven't been able to release a tech preview, yet. But let's take the time it needs to resolve the issue once and for all.

@Glynn: please revert your revert or find a time to implement better solution.

Has anyone actually tried the python launcher as I suggested ? If yes, what are your experiences ?

@Moritz: you were discussing tech-previews for many times. Are you
able to imagine releasing tech-previews with this serious bug. Not me.

I agree.

hacks just to get some users now, with the risk of losing them (and others)
later when it becomes apparent that the hack doesn't solve everything...

What means "solve everything",

s/doesn't solve everything/only provides a superficial solution which contains the risk that it will hit us in the face later, when we've already built other parts of the software on top of that solution, only making it harder to then roll everything back/

could you elaborate a little bit? So
it's better to have broken functionality on Windows for many months?
It will probably not change within next weeks/months. Good to know,
it's a nice policy :wink:

As bad as it might sound, but yes, I prefer to have openly broken functionality (listing it in known bugs) for the time it takes to find a real solution, than to try to put band-aids over it and then move on, hoping that the band-aid will stick.

I think we just have to accept that MS Windows work power is _very_ limited
amongst us and that solutions for Windows will take time to be put in place.

Right, that's what I am speaking about.

A solution might be to try to focus resources in the form of a specific Windows code sprint, ideally with some Windows power hackers who could help us.

BTW, it seems that the same is needed to solve the encoding issues on Windows.

Moritz

On Mon, Oct 7, 2013 at 9:57 AM, Moritz Lennert
<mlennert@club.worldonline.be> wrote:

A solution might be to try to focus resources in the form of a specific
Windows code sprint, ideally with some Windows power hackers who could help
us.

BTW, it seems that the same is needed to solve the encoding issues on
Windows.

Do we have capable programmers around? Perhaps we can co-finanze some
effort since it is unrealistic to obtain it on a voluntary base.

Markus

Markus Neteler wrote

On Mon, Oct 7, 2013 at 9:57 AM, Moritz Lennert
&lt;

mlennert@.worldonline

&gt; wrote:

A solution might be to try to focus resources in the form of a specific
Windows code sprint, ideally with some Windows power hackers who could
help
us.

BTW, it seems that the same is needed to solve the encoding issues on
Windows.

Do we have capable programmers around? Perhaps we can co-finanze some
effort since it is unrealistic to obtain it on a voluntary base.

Markus
_______________________________________________

see also here

http://lists.osgeo.org/pipermail/grass-psc/2013-February/001054.html

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Handling-of-Python-scripts-on-MS-Windows-tp5081335p5082169.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

Martin Landa wrote:

@Glynn: please revert your revert or find a time to implement better solution.

First, someone would need to explain the problem. "Doesn't work" isn't
sufficient. Nor is "I have a problem and this makes it work for me".

To start with, it needs to be established that Python is actually
installed correctly. To this end, I need to see the output from the
shell commands:

  assoc .py
  ftype python.file
  echo %PATHEXT%

Then, I would need to see the result of running a python script from
the shell (that's cmd.exe in a console window, not bash, or anything
running in MSys' rxvt, or the GUI's "command line").

If that works, but running the script from the GUI doesn't, then the
problem is in the GUI and any fix belongs in the GUI (and not e.g.
lib/python).

--
Glynn Clements <glynn@gclements.plus.com>

To start with, it needs to be established that Python is actually
installed correctly. To this end, I need to see the output from the
shell commands:

       assoc .py
       ftype python.file
       echo %PATHEXT%

tested with a _not pristine_ win7 + python-installation, so more
eventualities should be reported!

python is installed by ArcGIS on this testing box here.

ArcGIS 10.0 installed C:\Python26\ArcGIS10.0

after upgrade

ArcGIS 10.1 installed C:\Python27\ArcGIS10.1

AFAIR most of the winGRASS-users have ArcGIS 10.x installed

now above tests in a windows command line (started by windows start ->
command line - cmd.exe in a console window):

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.

C:\tmp\testpython>assoc .py
.py=Python.File

C:\tmp\testpython>ftype python.file
python.file="C:\Python27\ArcGIS10.1\python.exe" "%1" %*

C:\tmp\testpython>echo %PATHEXT%
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

Then, I would need to see the result of running a python script from
the shell (that's cmd.exe in a console window, not bash, or anything
running in MSys' rxvt, or the GUI's "command line").

test.py:

print "Hello, Python!";

C:\tmp\testpython\test.py

a error box pops up that test.py can't by executed because of no associated
program can be found (see echo %PATHEXT%)

please others report with other win7/8-python-confgurations

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Handling-of-Python-scripts-on-MS-Windows-tp5081335p5082254.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

Helmut Kudrnovsky wrote:

C:\tmp\testpython>echo %PATHEXT%
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

Note that lib/init/grass.py sets PATHEXT.

I was referring to cmd.exe *within* a GRASS session.

>Then, I would need to see the result of running a python script from
>the shell (that's cmd.exe in a console window, not bash, or anything
>running in MSys' rxvt, or the GUI's "command line").

test.py:

print "Hello, Python!";

C:\tmp\testpython\test.py

a error box pops up that test.py can't by executed because of no associated
program can be found (see echo %PATHEXT%)

This isn't related to PATHEXT. It suggests that the registry keys are
inconsistent.

There are two sets of registry keys used for file associations.

The keys under HKEY_LOCAL_MACHINE\SOFTWARE\Classes contain the
system-wide settings, while those under HKEY_USERS\*\Software\Classes
contain the per-user settings. Additionally, HKEY_CURRENT_USER is an
alias for HKEY_USERS\$user (where $user is the logged-in user) while
HKEY_CLASSES_ROOT is obtained by merging the two sets of *\Classes
keys (with the per-user settings taking precedence).

ftype and assoc show the system-wide settings, but these are ignored
if there are per-user keys. If the per-user keys exist but the values
are invalid, executing a script will result in a dialog asking you to
select the program to open that type of file.

--
Glynn Clements <glynn@gclements.plus.com>

I was referring to cmd.exe *within* a GRASS session.

ok, 2 tests with another windows VISTA box because of travelling (win7-box
from earlier test not available atm), now within a GRASS session:

---------------------------
winGRASS-session (1)
winGRASS 7 standalone installer and no python installation
winGRASS 7 standalone installer bundled with Python 2.7.4 (default, Apr 6
2013, 19:54:46) [MSC v.1500 32 bit (Intel)] on win32

System Info
GRASS version: 7.0.svn
GRASS SVN Revision: 57955
Build Date: 2013-10-08
GIS Library Revision: 56211 (2013-05-12)
GDAL/OGR: 1.9.2
PROJ.4: 4.8.0
GEOS: 3.3.6dev
SQLite: 3.7.17
Python: 2.7.4
wxPython: 2.8.12.1
Platform: Windows-Vista-6.0.6002-SP2

C:\Users\xxxx>assoc .py
Dateizuordnung für die Erweiterung .py nicht gefunden.
File association for the extension. py not found.

C:\Users\xxxx>ftype python.file
Dateityp "python.file" nicht gefunden, oder diesem Dateityp wurde kein
Öffnen-Befehl zugeordnet.
File type "python.file" not found or no associated open command.

C:\Users\xxxx>echo %PATHEXT%
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY

---------------------------
winGRASS-session (2)
winGRASS 7 standalone installer and a www.python.org 2.7.5 installation
(system wide installed in C:\Python27)
winGRASS 7 standalone installer bundled with Python 2.7.4 (default, Apr 6
2013, 19:54:46) [MSC v.1500 32 bit (Intel)] on win32

System Info
GRASS version: 7.0.svn
GRASS SVN Revision: 57955
Build Date: 2013-10-08
GIS Library Revision: 56211 (2013-05-12)
GDAL/OGR: 1.9.2
PROJ.4: 4.8.0
GEOS: 3.3.6dev
SQLite: 3.7.17
Python: 2.7.4
wxPython: 2.8.12.1
Platform: Windows-Vista-6.0.6002-SP2

C:\Users\xxxx>assoc .py
.py=Python.File

C:\Users\xxxx>ftype python.file
python.file="C:\Python27\python.exe" "%1" %*

C:\Users\normal>echo %PATHEXT%
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY

testscript.py:

import sys
print "Hello, World!"
print sys.version

C:\wd\pytest>python testscript.py
Hello, World!
2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]
---------------------------

the earlier test was in a win7-box with following python installation

python is installed by ArcGIS on this testing box here.

ArcGIS 10.0 installed C:\Python26\ArcGIS10.0

after upgrade

ArcGIS 10.1 installed C:\Python27\ArcGIS10.1

It suggests that the registry keys are inconsistent.

[...]

ftype and assoc show the system-wide settings, but these are ignored
if there are per-user keys. If the per-user keys exist but the values
are invalid, executing a script will result in a dialog asking you to
select the program to open that type of file.

could it be that ArcGIS installs a "inconsistent" python? if yes how to deal
with this?
AFAIK most of the winGRASS-users has also ArcGIS installed.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Handling-of-Python-scripts-on-MS-Windows-tp5081335p5082670.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

Helmut Kudrnovsky wrote:

>It suggests that the registry keys are inconsistent.
[...]
>ftype and assoc show the system-wide settings, but these are ignored
>if there are per-user keys. If the per-user keys exist but the values
>are invalid, executing a script will result in a dialog asking you to
>select the program to open that type of file.

could it be that ArcGIS installs a "inconsistent" python?

Possibly. Run regedit and examine the aforementioned keys.

if yes how to deal with this?

That would depend upon the details.

If it's a case that's easily detectable and clearly invalid, the
installer can fix it automatically.

Otherwise, it may be possible to have the installer perform a test,
and if it fails direct the user to a "Python on Windows" page on the
GRASS website.

AFAIK most of the winGRASS-users has also ArcGIS installed.

If it's a specific problem, hopefully it should have a specific
solution.

--
Glynn Clements <glynn@gclements.plus.com>

Hi all,

2013/10/6 Martin Landa <landa.martin@gmail.com>:

First of all, thanks Vaclav that he found time to take a look at this
issue. His time is limited (as for all of us), the solution is not
perfect, but it's anyway step towards. After r57911 we are in the same
situation. Python scripts called from Python code do not work again!
It's very serious issue, yes, it's a blocker.

@Glynn: please revert your revert or find a time to implement better solution.

[...]

What means "solve everything", could you elaborate a little bit? So
it's better to have broken functionality on Windows for many months?
It will probably not change within next weeks/months. Good to know,
it's a nice policy :wink:

Unfortunately nothing really changed as I noted 3 months ago. I am
using GRASS 7 at the university for teaching GIS and remote sensing.
During winter semester students started to report bugs related to this
issue. I was thinking how I can explain them why it's still broken or
better to say we are still keeping it broken. My patience is now at an
end, students couldn't simply solved final tasks to finish the course.

There are many places where a python script is called from a python
code (eg. `g.extension` from wxGUI wrapper, `r.mask` in different
python scripts or `v.db.addtable` in `g.gui.iclass` when exporting
training areas). Many more functionality is simply not working on
Windows.

I hoped that I will be not forced to do that, anyway the daily builds
of G7 [1] now contains Vaclav's workaround introduced in r57910. I
expect that such commit would be immediately reverted without
providing any better solution (as in October). Keep it simply broken
we don't care about our software whether is functional. It's our
message to the users which I was not able to say to the students. I
want to attract them to use open source and not to disgust them.

Martin

[1] http://wingrass.fsv.cvut.cz/grass70/

Martin,

On 18/01/14 10:36, Martin Landa wrote:

Unfortunately nothing really changed as I noted 3 months ago. I am
using GRASS 7 at the university for teaching GIS and remote sensing.
During winter semester students started to report bugs related to this
issue. I was thinking how I can explain them why it's still broken or
better to say we are still keeping it broken. My patience is now at an
end, students couldn't simply solved final tasks to finish the course.

There are many places where a python script is called from a python
code (eg. `g.extension` from wxGUI wrapper, `r.mask` in different
python scripts or `v.db.addtable` in `g.gui.iclass` when exporting
training areas). Many more functionality is simply not working on
Windows.

I hoped that I will be not forced to do that, anyway the daily builds
of G7 [1] now contains Vaclav's workaround introduced in r57910. I
expect that such commit would be immediately reverted without
providing any better solution (as in October). Keep it simply broken
we don't care about our software whether is functional. It's our
message to the users which I was not able to say to the students. I
want to attract them to use open source and not to disgust them.

Being confronted with the same issues with my students, I understand your frustration. And I wish a solution could be found.

The big question, as always, is how far do we want to go in doing things for the users, and how much can we ask users to do themselves. The general gist normally is that Windows users are computer illiterates and that we should, therefore, prepare everything for them. This however implies that _we_ have to find a solution to all problems this entails.

Another option would be to do what Glynn has been proposing all along (IIUC), which is to not install Python with Wingrass, but rather leave it up to the user to make sure a suitable Python is installed in the path. I personally would plead for the latter, as I think that someone who can handle GRASS should be able to follow some instructions concerning Python handling and as experience has shown that our team is too small to do everything for the user.

In my few tests, I had fairly good results with the Python launcher, but this was with the GRASS Python installation [1]. Everything "just worked", without any of the hacks proposed since then.

I don't know how hardcoded the existence of a GRASS Python installation is and how hard it would be to create an installer without Python in order to test different solution in that direction.

Maybe we could try to organize a "virtual sprint" where we all decide of a day and time for which we all prepare windows machines so that we can try to concentrate on this, major, issue and hopefully solve it "once and for all".

But we also need to answer the fundamental question on how far we should go in doing things for Windows users, instead of showing them the way to do it themselves.

Moritz

[1] http://lists.osgeo.org/pipermail/grass-dev/2013-July/065197.html

Hi Moritz,

Maybe we could try to organize a "virtual sprint" where we all decide of
a day and time for which we all prepare windows machines so that we can
try to concentrate on this, major, issue and hopefully solve it "once
and for all".

maybe the GRASS Community Sprint Vienna 2014
(http://grasswiki.osgeo.org/wiki/GRASS_Community_Sprint_Vienna_2014) would
be a good place ...

But we also need to answer the fundamental question on how far we should
go in doing things for Windows users, instead of showing them the way to
do it themselves.

also IMHO this is the main question, both possible solutions need a lot of
care and also work; and
I'm worried losing possible winGRASS-users with latter.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Handling-of-Python-scripts-on-MS-Windows-tp5081335p5099060.html
Sent from the Grass - Dev mailing list archive at Nabble.com.