From 7b5dc05a9b1890e3928c07343dc629500e9988a8 Mon Sep 17 00:00:00 2001 From: Valerij Talagayev <82884038+talagayev@users.noreply.github.com> Date: Tue, 6 Aug 2024 22:38:55 +0200 Subject: [PATCH] Update base.py --- package/MDAnalysis/topology/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/MDAnalysis/topology/base.py b/package/MDAnalysis/topology/base.py index 2d0f53809ee..1ced8a090b0 100644 --- a/package/MDAnalysis/topology/base.py +++ b/package/MDAnalysis/topology/base.py @@ -117,7 +117,10 @@ class TopologyReaderBase(IOBase, metaclass=_Topologymeta): """ def __init__(self, filename): - self.filename = filename + if isinstance(filename, util.NamedStream): + self.filename = filename + else: + self.filename = str(filename) def parse(self, **kwargs): # pragma: no cover raise NotImplementedError("Override this in each subclass")