Ticket #32 (closed defect: fixed)
ensure_dir() maximum recursion depth exception
| Reported by: | abickell@… | Owned by: | ianb |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | paste | Version: | svn-trunk |
| Severity: | normal | Keywords: | |
| Cc: |
Description
When attempting to ensure_dir() for a relative directory, it goes into an infinite recurion, and breaks. I believe this can be fixed by changing from
def ensure_dir(self, dir, svn_add=True):
dir = dir.rstrip(os.sep)
if not os.path.exists(dir):
self.ensure_dir(os.path.dirname(dir))
if self.verbose:
...
to
def ensure_dir(self, dir, svn_add=True):
dir = dir.rstrip(os.sep)
if not os.path.exists(dir):
if len(dir.split(os.sep)) != 1:
self.ensure_dir(os.path.dirname(dir))
if self.verbose:
...
Doing this will ensure that it won't recurse forever if you call ensure_dir("abc"), for example.
Change History
Note: See
TracTickets for help on using
tickets.
