
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
betterpath
Advanced tools
betterpath, or "bp", is an adaptation of the classic Twisted FilePath type
and interface. bp provides a simple, robust, well-tested object abstraction
over file paths, generalizing the concept of file paths beyond filesystems.
bp exposes an interface, bp.abstract.IFilePath, for file paths, and
provides the following concrete implementations:
bp.filepath.FilePath, for the root filesystembp.zippath.ZipPath, for ZIP archivesbp.memory.MemoryPath, for in-memory temporary filesystemsIn addition, there are combining abstract file paths which can be wrapped around other file paths:
bp.readonly.ReadOnlyPath, for read-only filesystemsAPI documentation is available at http://betterpath.rtfd.org/.
The venerable champ, os.path has been the cause of (and solution to) most
of Python's path problems over the years.
Pros
* In the standard library
Cons
pathlib hopes to carve a path towards greatness through PEP 428.
Pros
* Convenient ``__div__()`` overloading
Cons
The Old Way
::
def save(base, fragments, data):
# `fragments` could contain unsafe paths!
if ".." in fragments or "." in fragments:
raise ValueError("Unsafe paths!")
path = os.path.join(os.path.abspath(base), os.sep.join(fragments))
# Alternatively: path = os.path.join(os.path.abspath(base), *fragments)
# I hope that this doesn't fail mid-write! Also, did the directories
# exist? I think so, yes.
with open(path, "wb") as handle:
handle.write(data)
The New Way
::
def save(base, fragments, data):
path = base.descendant(fragments)
path.parent().makeDirs()
path.setContent(data)
FAQs
Path manipulation library
We found that betterpath demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.