From: Enrico Forestieri Date: Sat, 24 Dec 2011 11:54:30 +0000 (+0000) Subject: Fix bug #7933 (lyx2lyx error while running lyxpak.py) X-Git-Tag: 2.1.0beta1~2168 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5003431903c9e873ad61c80ceb60a504b8be8887;p=features.git Fix bug #7933 (lyx2lyx error while running lyxpak.py) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40544 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/scripts/lyxpak.py b/lib/scripts/lyxpak.py index 696acef81d..37829e09c2 100755 --- a/lib/scripts/lyxpak.py +++ b/lib/scripts/lyxpak.py @@ -285,6 +285,10 @@ def main(args): # Find the topmost dir common to all files if len(incfiles) > 1: topdir = os.path.commonprefix(incfiles) + # Check whether topdir is valid, as os.path.commonprefix() works on + # a character by character basis, rather than on path elements. + if not os.path.exists(topdir): + topdir = os.path.dirname(topdir) + os.path.sep else: topdir = os.path.dirname(incfiles[0]) + os.path.sep