Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#108 closed defect (fixed)

set base to "." if not running from source

Reported by: Zooko Owned by:
Priority: major Milestone: 0.4.0
Component: logging Version: 0.3.0
Keywords: patch Cc:

Description

This was necessary to make flogtool run after installing it on Windows:

$ python `cygpath -m \`type -p hg\`` diff
diff -r 66eb3cffca75 bin/flogtool
--- a/bin/flogtool      Wed Oct 15 13:41:59 2008 -0700
+++ b/bin/flogtool      Sat Jan 03 12:59:56 2009 -0700
@@ -6,6 +6,8 @@ where = os.path.realpath(sys.argv[0]).sp
 where = os.path.realpath(sys.argv[0]).split(os.sep)
 if len(where) >= 2 and where[-2] == "bin":
     base = os.sep.join(where[:-2])
+else:
+    base = "."
 if (os.path.exists(os.path.join(base, "setup.py")) and
     os.path.exists(os.path.join(base, "foolscap"))):
     sys.path.insert(0, base)

Change History (2)

comment:1 Changed 16 years ago by Brian Warner

Milestone: undecided0.3.3
Resolution: fixed
Status: newclosed

I've patched it to set base to os.path.realpath(".") instead of a bare ".", since "base" is supposed to be an absolute directory (not relative). Does that still work on windows?

Applied in [36fb36d50ec672915df00d959140a94feb6ca89e]

comment:2 Changed 16 years ago by Brian Warner

Milestone: 0.3.30.4.0
Note: See TracTickets for help on using tickets.