[ 
https://issues.apache.org/jira/browse/STORM-3847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bipin Prasad updated STORM-3847:
--------------------------------
    Fix Version/s: 2.5.0

> Fix various problems in the python PowerShell execution
> -------------------------------------------------------
>
>                 Key: STORM-3847
>                 URL: https://issues.apache.org/jira/browse/STORM-3847
>             Project: Apache Storm
>          Issue Type: Improvement
>          Components: storm-submit-tools
>            Reporter: Bipin Prasad
>            Assignee: Bipin Prasad
>            Priority: Major
>             Fix For: 2.5.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> *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



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to