New submission from Brendan Moloney:
As per a discussion on python-ideas [1], the consensus is that we should allow
users to create a DirEntry object themselves. This would just take a path and
call stat on it and cache the result of that stat call.
Nick Coghlan mentioned possibly allowing a
Brendan Moloney added the comment:
The functions were all written around DirEntry objects since that is what they
will be processing 99% of the time and I want to do that as efficiently as
possible. Converting a DirEntry object into a str representation doesn't help
me with my use case a
Brendan Moloney added the comment:
The pathlib Path class is different enough from the DirEntry class that it
doesn't really help my goal of allowing a function to work with either a
DirEntry or a plain (str) path.
These functions are going to be working with DirEntry objects generat
Brendan Moloney added the comment:
It makes it much easier to write functions that can work with either a DirEntry
object or a plain path.
--
___
Python tracker
<http://bugs.python.org/issue27
Brendan Moloney added the comment:
It would be nice if there was a supported way to create a DirEntry object from
a path. If you don't want to document the constructor perhaps expose some
helper function or class method (i.e. from_path)?
--
nosy: +mo
Brendan Moloney added the comment:
Here is a script illustrating the issue.
--
Added file: http://bugs.python.org/file35976/tarfile_issue.py
___
Python tracker
<http://bugs.python.org/issue21
New submission from Brendan Moloney:
If a directory path is under 100 char you have to omit the trailing slash from
the name passed to 'getmember'. If it is over 100 you have to include the
trailing slash.
As a work around I can use the private '_getmember' with 'norm