-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File operations on Windows with Python 3.13 give Permission denied
#650
Comments
That means you can't open that specific file for reading. It's a problem of Windows permissions about that file / directory. You should fix it at system level, either by changing permissions for that specific user or changing the user. |
I can.
Nope. Also, I now see how this could be seen as a stupid newbie question, especially as I forgot to specify that the same code works with the same files with Python 3.12 so I'm not surprised that it was quickly closed but please reconsider. |
OK then please show your code and also the server logs (or traceback, if any). |
As I said the code is at https://pyftpdlib.readthedocs.io/en/latest/tutorial.html#a-base-ftp-server The server logs:
|
I don't have a Windows box at the moment, but your error originates from here: pyftpdlib/pyftpdlib/handlers.py Lines 2422 to 2427 in 53f3f66
What fails is the open() call, that's why I confirm that my suspicion is that the file path or its directory doesn't have enough permissions for your user. Try to add a raise statement at line 2425 and you should see the full file path + traceback.
|
Looks like it tries to open a dir for reading. I guess I can debug it from here later. |
|
Damn! This is huge in terms of backward compatibility breakage. It's also interesting that this is a cPython ticket from 17 years ago which was fixed very recently. As for what it concerns pyftpdlib, I'm gonna enable CI tests for python 3.13 and see if they turn red. I hope this is already covered by the test suite. After that we should think about a fix. This definitively breaks everything on Windows. |
They do (this is good): |
Fixes #650. Starting from Python 3.13, `os.path.isabs("/foo")` on Windows return `False`. This causes many file operations on Windows to fail with "Permission denied". This PR makes `os.path.isabs()` on Windows behave like in Python <= 3.12.
This should now be fixed. Please confirm it worked if you have the chance. |
Thanks! I haven't tried manual tests but the Scrapy tests which failed on Windows+3.13 before don't fail with pyftpdlib master. |
Since this was a critical issue, I've just released pyftpdlib 2.0.1. |
Steps to reproduce:
''
with127.0.0.1
for simplification but kept the rest).ftp.exe
, issueopen localhost 2121
, log in with either of the users defined in the server code. Issuedir
, so far it works.get <any existing file>
.What happens:
RETR
.Same with
STOR
orAPPE
(though it looks like it responds "550 File exists" forSTOR
, even if it doesn't exist).The text was updated successfully, but these errors were encountered: