indygreg / indygreg/PyOxidizer

argv[0] is None

Open
#307 16 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
6.2k
Forks
256
PR merge metrics
No merged PRs in 30d

Description

I have problem with pyoxidizer 0.9.0 and sys.argv. I make simple test app (via pyoxidizer init-config-file pyapp)

[/tmp/pyapp] $ cat foo/bar.py

import sys

def main():
    print("argv:", sys.argv)

if __name__ == "__main__":
    main()

and run it with parameters

/tmp/pyapp/./build/x86_64-unknown-linux-gnu/debug/install/pyapp foo bar
argv: [None, 'foo', 'bar']

As you can see, first element in argv is None.
May be I need some config options for pyoxidizer.bzl?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with foo/bar.py and the generated build/x86_64-unknown-linux-gnu/debug/install/pyapp command, then trace how PyOxidizer initializes Python's sys.argv. Check the pyoxidizer.bzl configuration and the runtime entry point mentioned by the reproduction; done means the installed application reports its executable path as argv[0] while preserving the supplied arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.