[EMAIL PROTECTED] wrote:
>  Please post your Python code.  I don't see the problem you're
> describing.

OK, here's a copy. This works on Mac/Unix/Linux yet has no effect on 
Windows:

-----------------------------------------------------------------
import os
import os.path

for root, dirs, files in os.walk(os.getcwd()):
     for d in dirs:
         new_d = d.strip()

## Uncomment the next 4 lines just to print dirs with end spaces.
##        if new_d != d:
##            print d
##        else:
##            print "No end spaces."

## Uncomment the next 7 lines to try a rename of dirs with end spaces.
##        if new_d != d:
##            try:
##                new_path = os.path.join(root, new_d)
##                old_path = os.path.join(root, d)
##                os.renames(old_path, new_path)
##            except Exception, e:
##                print e
------------------------------------------------------------------
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to