Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: [BUG] 'stg add FILE' when FILE is a symlink to dir adds dir contents

From: Karl Hasselström <hidden>
Date: 2016-06-15 22:43:04

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help