Skip to content

cli.ExistingFile: Scripts crash after upgrade to 1.10 #755

@tadada-o

Description

@tadada-o

I use pb's cli.ExistingFile objects in my scripts to handle command line arguments of type "file".
This worked up to version 1.9 of pb.

With version 1.10, all my scripts now fail with error message 'FileArgument' is not in list.

The complete Traceback is

2025-11-09 11:04:58,418 - 💥️ - ERROR - extrahiere Barcodes aus PDF.py,569 - root.<module> - 'FileArgument' is not in list

Traceback (most recent call last):

  File "/Users/Guy/bin/extrahiere Barcodes aus PDF.py", line 565, in <module>

    ermittleDatenausBarcodesinPDF.run()

  File "/Users/Guy/Library/Python/3.12/lib/python/site-packages/plumbum/cli/application.py", line 608, in run

    ordered, tailargs = inst._validate_args(swfuncs, tailargs)

                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/Guy/Library/Python/3.12/lib/python/site-packages/plumbum/cli/application.py", line 549, in _validate_args

    positional[args_names.index(item)] = annotation

               ^^^^^^^^^^^^^^^^^^^^^^

ValueError: 'FileArgument' is not in list

After reverting pbto 1.9, the error no longer occurs

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions