From: Karl Hasselström Date: Thu, 12 Apr 2007 06:58:10 GMT Subject: Re: [BUG] 'stg add FILE' when FILE is a symlink to dir adds dir contents Message-ID: <20070412065810.GA22949@diana.vm.bytemark.co.uk> In-Reply-To: <20070411155452.GL5329@moonlight.home> On 2007-04-11 19:54:52 +0400, Tomash Brechko wrote: > I have no knowledge of Python, so I can't fix it myself, but perhaps > one should check for symlink before 'if os.path.isdir(i):'. Correct. From the Python library reference: isdir(path) Return True if path is an existing directory. This follows symbolic links, so both islink() and isdir() can be true for the same path. So, os.path.islink() would be the function to use. -- Karl Hasselström, kha@treskal.com www.treskal.com/kalle