~sschwarzer/ftputil

2

Infinite recursion with host.stat call

Details
Message ID
<CAM1O0_-czWe0cYj0h8gGBF4ijkz_8FsdRV=65L=LJ4kCmORDaA@mail.gmail.com>
DKIM signature
missing
Download raw message
I'm getting infinite recursion with a host.stat call. The
path._is_file_system_entity is called by stat, and then calls stat.
ftputils v5.0.4 on Python 3.7 on Windows. Stack trace below:


Traceback (most recent call last):
  File "[my module].py", line 40, in <module>
    [my code]
  File "C:\Users\[username]\AppData\Local\Programs\Python\Python37-32\lib\site-packages\ftputil\host.py",
line 1017, in stat
    return self._stat._stat(path, _exception_for_missing_path)
  File "C:\Users\[username]\AppData\Local\Programs\Python\Python37-32\lib\site-packages\ftputil\stat.py",
line 846, in _stat
    self._real_stat, path, _exception_for_missing_path
  File "C:\Users\[username]\AppData\Local\Programs\Python\Python37-32\lib\site-packages\ftputil\stat.py",
line 801, in __call_with_parser_retry
    result = method(*args, **kwargs)
  File "C:\Users\[username]\AppData\Local\Programs\Python\Python37-32\lib\site-packages\ftputil\stat.py",
line 768, in _real_stat
    lstat_result = self._real_lstat(path, _exception_for_missing_path)
  File "C:\Users\[username]\AppData\Local\Programs\Python\Python37-32\lib\site-packages\ftputil\stat.py",
line 719, in _real_lstat
    if not self._path.isdir(dirname) and not _exception_for_missing_path:
  File "C:\Users\[username]\AppData\Local\Programs\Python\Python37-32\lib\site-packages\ftputil\path.py",
line 154, in isdir
    return self._is_file_system_entity(path, "dir")
  File "C:\Users\[username]\AppData\Local\Programs\Python\Python37-32\lib\site-packages\ftputil\path.py",
line 132, in _is_file_system_entity
    stat_result = self._host.stat(path, _exception_for_missing_path=False)
  File "C:\Users\[username]\AppData\Local\Programs\Python\Python37-32\lib\site-packages\ftputil\host.py",
line 1017, in stat
    return self._stat._stat(path, _exception_for_missing_path)
...
RecursionError: maximum recursion depth exceeded
Details
Message ID
<08d1ee13-f32a-d2e1-d20a-639e54ed5d83@sschwarzer.net>
In-Reply-To
<CAM1O0_-czWe0cYj0h8gGBF4ijkz_8FsdRV=65L=LJ4kCmORDaA@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
On 2022-09-01 17:36, Simon Cox wrote:
> I'm getting infinite recursion with a host.stat call. The
> path._is_file_system_entity is called by stat, and then calls stat.
> ftputils v5.0.4 on Python 3.7 on Windows. Stack trace below:

Can you please enter tickets [1] both for the parser
error issue and this one? If you don't have a Sourcehut
account, let me know. In this case, I can enter tickets
on your behalf.

[1] https://todo.sr.ht/~sschwarzer/ftputil

Best regards,
Stefan
Details
Message ID
<28d09b6a-6020-660f-7c90-f0506bfd0762@sschwarzer.net>
In-Reply-To
<08d1ee13-f32a-d2e1-d20a-639e54ed5d83@sschwarzer.net> (view parent)
DKIM signature
missing
Download raw message
Hi Simon,

On 2022-09-03 12:08, Stefan Schwarzer wrote:
> On 2022-09-01 17:36, Simon Cox wrote:
>> I'm getting infinite recursion with a host.stat call. The
>> path._is_file_system_entity is called by stat, and then calls stat.
>> ftputils v5.0.4 on Python 3.7 on Windows. Stack trace below:
> 
> Can you please enter tickets [1] both for the parser
> error issue and this one? If you don't have a Sourcehut
> account, let me know. In this case, I can enter tickets
> on your behalf.
> 
> [1] https://todo.sr.ht/~sschwarzer/ftputil

Since I didn't hear anything from you for a while, I've
entered the following tickets on your behalf:

https://todo.sr.ht/~sschwarzer/ftputil/152

https://todo.sr.ht/~sschwarzer/ftputil/153

I don't think I'll change ftputil to ignore arbitrary
unparsable lines, but I've explained the situation and
a workaround in the above ticket 152.

Regarding the infinite recursion problem, I don't have
an explanation at the moment. I added a comment in
ticket 153 on debugging the problem on your side. If
possible, please add your results to ticket 153. You can
cut the traceback if not only the calls but also the
printed paths repeat.

Best regards,
Stefan
Reply to thread Export thread (mbox)