Ticket #32 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

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

Changed 6 years ago by anonymous

Upon a bit closer inspection, the fix I attached, won't quite fix it entirely. The case of ensure_dir('/'), still won't be quite right.

Aaron B.

Changed 6 years ago by ianb@…

  • status changed from new to closed
  • resolution set to fixed

Should be fixed in r3686, for both cases.

Changed 6 years ago by anonymous

Great resource. Really helpful for understand odbc things.

Thanks.

my email:googlefans@163.com

=============Some my site====================

1. wow gold

2. world of warcraft gold

3. wow gold

Note: See TracTickets for help on using tickets.