This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author The Compiler
Recipients The Compiler, hieu.nguyen, serhiy.storchaka, tweksteen, vstinner
Date 2020-05-06.09:32:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1588757525.36.0.428936320881.issue40527@roundup.psfhosted.org>
In-reply-to
Content
A minor issue I just discovered today: When e.g. doing "python3 --foo", the output is:

  unknown option --foo
  unknown option --foo
  unknown option --foo
  usage: /usr/bin/python3 [option] ... [-c cmd | -m mod | file | -] [arg] ...

With more dashes in the options, it seems to get worse:

  unknown option --foo-bar-baz
  unknown option --foo-bar-baz
  unknown option --foo-bar-baz
  unknown option --foo-bar-baz
  unknown option --foo-bar-baz
  unknown option --foo-bar-baz
  unknown option --foo-bar-baz
  usage: /usr/bin/python3 [option] ... [-c cmd | -m mod | file | -] [arg] ...

This seems very similar to issue16306 (thus why I added people involved there to the nosy list), except that it happens with long rather than short arguments.

This only happens with Python 3.8/3.9, not 3.7 or older. I was able to bisect this to the following commit:

commit 6dcb54228e7520abd058897440c26e323f62afcd
Author: Victor Stinner <vstinner@redhat.com>
Date:   Tue Mar 5 02:44:12 2019 +0100

    bpo-36142: Add _PyPreConfig_ReadFromArgv() (GH-12173)
    
    The new function is now responsible to parse -E and -I command line
    arguments.
History
Date User Action Args
2020-05-06 09:32:05The Compilersetrecipients: + The Compiler, vstinner, hieu.nguyen, serhiy.storchaka, tweksteen
2020-05-06 09:32:05The Compilersetmessageid: <1588757525.36.0.428936320881.issue40527@roundup.psfhosted.org>
2020-05-06 09:32:05The Compilerlinkissue40527 messages
2020-05-06 09:32:04The Compilercreate