Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 626120 - dev-python/scandir - A better directory iterator and faster os.walk()
Summary: dev-python/scandir - A better directory iterator and faster os.walk()
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Proxy Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-25 07:24 UTC by Marius Brehler
Modified: 2017-07-26 07:29 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marius Brehler 2017-07-25 07:24:23 UTC
scandir() is a directory iteration function like os.listdir(), except that instead of returning a list of bare filenames, it yields DirEntry objects that include file type and stat information along with the name. Using scandir() increases the speed of os.walk() by 2-20 times (depending on the platform and file system) by avoiding unnecessary calls to os.stat() in most cases.

scandir has been included in the Python 3.5 standard library as os.scandir(), and the related performance improvements to os.walk() have also been included. However, to bump dev-python/pathlib2 to the newest version, this package is required for Python 2.7. and Python 3.4.
Comment 1 Marius Brehler 2017-07-25 07:29:05 UTC
https://github.com/gentoo/gentoo/pull/5207
Comment 2 Patrice Clement (RETIRED) gentoo-dev 2017-07-25 22:18:03 UTC
Hi and thank you for your bug report. It looks like an awesome package to tinker with. I will add it shortly to the tree.
Comment 3 Patrice Clement (RETIRED) gentoo-dev 2017-07-25 22:35:09 UTC
commit 21ed8befb71cb458f7a1e15738042d69dda8cddc (HEAD -> master, origin/master, origin/HEAD)
Author:     Marius Brehler <marbre@linux.sungazer.de>
AuthorDate: Tue Jul 25 09:32:21 2017 +0200
Commit:     Patrice Clement <monsieurp@gentoo.org>
CommitDate: Wed Jul 26 00:34:26 2017 +0200

dev-python/scandir: new package.

A better directory iterator and faster os.walk().

scandir() is a directory iteration function like os.listdir(), except that
instead of returning a list of bare filenames, it yields DirEntry objects that
include file type and stat information along with the name. Using scandir()
increases the speed of os.walk() by 2-20 times (depending on the platform and
file system) by avoiding unnecessary calls to os.stat() in most cases.

Required by dev-python/pathlib2[python2_7,python3_4].

Gentoo-Bug: https://bugs.gentoo.org/626120

Package-Manager: Portage-2.3.6, Repoman-2.3.1
Closes: https://github.com/gentoo/gentoo/pull/5207

dev-python/scandir/Manifest           |  1 +
dev-python/scandir/metadata.xml       | 12 ++++++++++++
dev-python/scandir/scandir-1.5.ebuild | 23 +++++++++++++++++++++++
3 files changed, 36 insertions(+)
create mode 100644 dev-python/scandir/Manifest
create mode 100644 dev-python/scandir/metadata.xml
create mode 100644 dev-python/scandir/scandir-1.5.ebuild

PR merged, thanks!
Comment 4 Marius Brehler 2017-07-26 07:29:02 UTC
Thanks for merging it into the tree that quick!