Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
*Reported by https://github.com/FelixEngl*
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) and the modified storm.ps1 on my Windows 10 Pro Machine (With Python 3.9.1, OpenJDK 15).
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 \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
Attachments
Issue Links
- links to