Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

The "Run Parameters" parser issue #123

Closed
piotrhoppe opened this issue Oct 16, 2024 · 1 comment
Closed

The "Run Parameters" parser issue #123

piotrhoppe opened this issue Oct 16, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@piotrhoppe
Copy link
Contributor

piotrhoppe commented Oct 16, 2024

Steps to reproduce the behavior:

  1. Prepare python project.
  2. Open "Project Properties|Run" and set param1 "param2a param2b" param3 'param4a param4b param3c' param5 as value of the "Run Parameters:"
  3. Run below code:
import sys


def print_argv():
    for value in sys.argv:
        print(f"{value}")

if __name__ == '__main__':
    print_argv()

Expected behavior
You should get below results:

param1
param2a param2b
param3
param4a param4b param3c
param5

Current behavior
Now you get below results:

param1
"param2a
param2b"
param3
'param4a
param4b
param3c'
param5

Desktop (please complete the following information):

  • OS: Any (Windows/Linux)
  • JDK: any
  • Python: any
  • Netbeans Version: any
  • Python Plugin Version: 1.9.1
@piotrhoppe piotrhoppe added the bug Something isn't working label Oct 16, 2024
Copy link

Thanks for reporting this issue, we will take a look on ASAP

@piotrhoppe piotrhoppe changed the title he "Run Parameters" parser issue The "Run Parameters" parser issue Oct 16, 2024
piotrhoppe added a commit to piotrhoppe/netbeansPython that referenced this issue Oct 16, 2024
In current implementation for split "Run Paramteres" of project
is used split method that split a String by space. I that not handle
qouted parameters with spaces and split it by space that not allow
to pass the text as parameter with spaces.

To handle this situation the split method are replaced by use the
StringTokenizer class, that support single (`) and duble (") quote
that arrond the tekst as a params.

Task: albilu#123
@albilu albilu closed this as completed Oct 16, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants