From: Jeremy Stanley Date: Sat, 16 Sep 2017 17:29:38 +0000 (+0000) Subject: Interpret a "." prefix as the startdir X-Git-Tag: 0.0.1~135 X-Git-Url: https://mudpy.org/gitweb?a=commitdiff_plain;h=ccabf1c36488ef0f0a3107f99e9bd43c3b307216;p=mudpy.git Interpret a "." prefix as the startdir Since daemonization explicitly changes the working directory to "/", specifying a mudpy.filing.prefix of "." should be taken to refer to the original starting directory recorded in Universe.startdir rather than the current directory for the process. --- diff --git a/mudpy/data.py b/mudpy/data.py index f113369..99e6d21 100644 --- a/mudpy/data.py +++ b/mudpy/data.py @@ -215,8 +215,8 @@ def find_file( prefix = os.path.join(universe.startdir, prefix) # when no root path is specified, assume the current working directory - if not prefix: - prefix = os.getcwd() + if (not prefix or prefix == ".") and hasattr(universe, "startdir"): + prefix = universe.startdir # make sure it's absolute prefix = os.path.realpath(prefix)