[GRASS-dev] Windows comatibility: python import pwd

Hello,

I’ve realized that m.printws won’t compile on windows from the repository.

-------------------------------Information source:

https://wingrass.fsv.cvut.cz/grass70/x86_64/addons/latest/logs/

and especially:

https://wingrass.fsv.cvut.cz/grass70/x86_64/addons/latest/logs/m.printws.log

-------------------------------End of Log:

[...]
m.printws.tmp.html ; fi
Traceback (most recent call last):
  File "C:/Users/landa/grass_packager/grass705RC1/x86_64/addons/m.printws/scripts/[m.printws.py](http://m.printws.py)", line 177, in <module>
    import pwd
ImportError: No module named pwd
/c/msys64/usr/src/grass705RC1/include/Make/Html.make:14: recipe for target 'm.printws.tmp.html' failed
make: *** [m.printws.tmp.html] Error 1
rm m.printws.tmp.html

I’ve realized that pwd module is not available on windows. Very well, I

made a functional workaround and the key part is this:

if os.name <> ‘nt’:
import pwd

On Tue, Sep 6, 2016 at 2:36 PM, Robert Kuszinger <kuszinger@giscom.hu> wrote:

Hello,

I've realized that m.printws won't compile on windows from the repository.

...

I've realized that pwd module is not available on windows. Very well, I
made a functional workaround and the key part is this:

if os.name <> 'nt':
import pwd

See
http://stackoverflow.com/a/16529231/452464

for some winpwd trick (I just found it, untested)

Markus