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

proxy os.PathLike to a file-like NSURL #589

Closed
ronaldoussoren opened this issue Jan 20, 2024 · 1 comment
Closed

proxy os.PathLike to a file-like NSURL #589

ronaldoussoren opened this issue Jan 20, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ronaldoussoren
Copy link
Owner

os.PathLike is similar to Cocoa's use of NSURL to represent paths. Proxy os.PathLike to NSURL to allow using pathlib.Path values where framework's expect a file URL.

NSSecureCoding could be an issue here, NSURL implements this protocol whereas PyObjC cannot claim to support that protocol for arbitrary Python objects. It should be possible to do this for pathlib's classes though (I'm thinking of encoding those basically as the base NSURL, leaving the pickle-based implementation of NSCoding for other PathLike classes).

@ronaldoussoren ronaldoussoren added the enhancement New feature or request label Jan 20, 2024
@RhetTbull
Copy link

This is wonderful! Looking forward to trying this in 10.2. Thanks for all your work on pybojc -- I use it every day in a number of projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants