New submission from Barney Gale <barney.g...@gmail.com>:

This is one of a series of bug reports / PRs that lay the groundwork for making 
pathlib extensible. See here for detail: 
https://discuss.python.org/t/make-pathlib-extensible/3428

Currently `_Accessor.open()` is expected to function like `os.open()` and 
return a file descriptor. I'd suggest this interface is too low-level if our 
eventual aim is to allow users to implement their own accessor.

It would be better is `_Accessor.open()` is expected to function like 
`io.open()` and return a file object. That way, accessors don't need to deal 
with file descriptors at all, which is important if they're working with remote 
filesystems.

I'm planning to wait for bpo-39895 / gh-18838 to land before starting work on 
this.

----------
components: Library (Lib)
messages: 365283
nosy: barneygale
priority: normal
severity: normal
status: open
title: pathlib: make `_Accessor.open()` return a file object and not a file 
descriptor
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40107>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to