Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Turn shutil into a runnable module #126562

Open
zhihaoy opened this issue Nov 8, 2024 · 3 comments
Open

Turn shutil into a runnable module #126562

zhihaoy opened this issue Nov 8, 2024 · 3 comments
Labels
pending The issue will be closed if no feedback is provided stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@zhihaoy
Copy link

zhihaoy commented Nov 8, 2024

Feature or enhancement

Proposal:

Introduction

py -m shutil copy2 ~/my/src.txt .

I often find it necessary to use some shutil functionalities in scripts. It does the right thing efficiently, has more precise error handling than cmake -E, and, most importantly, is cross-platform.

Precedent

The zipfile module can be used by py -m zipfile. It gains credits for being a cross-platform ZIP64 decompressor.

Details

  • The subcommands should cover copyfile, copystat, copy, copy2, copytree, rmtree, move, chown, which, make_archive, and unpack_archive;
  • The keyword arguments that are easy to represent in cmdline should be adapted into --kw arg cmdline options; flags can follow the style --follow_symlinks and --no-follow_symlinks.
  • It would be even nicer if combined with a progress bar (See also: Add a basic progressbar implementation to shutil)

Links

DPO: https://discuss.python.org/t/turn-shutil-into-a-runnable-module/70503

@zhihaoy zhihaoy added the type-feature A feature request or enhancement label Nov 8, 2024
@ZeroIntensity
Copy link
Member

I'm pretty sure this needs to get discussed on DPO.

@ZeroIntensity ZeroIntensity added the pending The issue will be closed if no feedback is provided label Nov 8, 2024
@picnixz picnixz added the stdlib Python modules in the Lib dir label Nov 8, 2024
@nineteendo
Copy link
Contributor

Can't this be closed in the meantime?

@ZeroIntensity
Copy link
Member

It could, but I don't see the need. It will just get reopened if we decide to go with the feature, and if not, then we'll close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending The issue will be closed if no feedback is provided stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants