FelixEngl opened a new pull request #3403:
URL: https://github.com/apache/storm/pull/3403


   ## What is the purpose of the change
   
   Fixing the python version check in storm.ps1, that always fails due to wrong 
handling of a string.
   Otherwise every windows user has to fix this file by themselves.
   
   ### Explanation
   (& python -V 2>&1) already returns a string. Accessing it with `(& python -V 
2>&1)[0]` returns a char. Therefore the script always fails with a 
NullPointerException at `[int]$PythonVersion.Split(".")[0]`.
   
   ## How was the change tested
   
   I ran the script 
([storm_python_check_test.zip](https://github.com/apache/storm/files/6776823/storm_python_check_test.zip))
 and the modified storm.ps1 on my Windows 10 Pro Machine (With Python 3.9.1, 
OpenJDK 11).
   
   When you execute the attached script you get the following console output:
   
   > Original Version:
   > 
   > PythonVersion=
   > error
   > Es ist nicht möglich, eine Methode für einen Ausdruck aufzurufen, der den 
NULL hat.
   > In <censored>\storm_python_check_test.ps1:11 Zeichen:3
   > \+   $PythonMajor = [int]$PythonVersion.Split(".")[0];
   > \+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   >     \+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
   >     \+ FullyQualifiedErrorId : InvokeMethodOnNull
   > 
   > Fixed Version:
   > 
   > PythonVersion=3.9.1
   > PythonMajor=3
   > PythonMinor=9
   > PythonNumVersion=39
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@storm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to