Skip to content

Commit baedf97

Browse files
committed
Merge branch 'master' of github.com:giampaolo/pyftpdlib
2 parents fa92b04 + bb42be8 commit baedf97

22 files changed

+1644
-1541
lines changed

HISTORY.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
Bug tracker at https://github.com/giampaolo/pyftpdlib/issues
22

3+
Version: 2.2.0 - XXXX-XX-XX
4+
===========================
5+
6+
7+
**Compatibility notes**
8+
9+
* ``pyftpdlib.authorizers.AuthenticationFailed`` moved into
10+
``pyftpdlib.exceptions.AuthenticationFailed``. Old alias is still available.
11+
* ``pyftpdlib.authorizers.AuthorizerError`` moved into
12+
``pyftpdlib.exceptions.AuthorizerError``. Old alias is still available.
13+
* ``pyftpdlib.filesystems.FilesystemError`` moved into
14+
``pyftpdlib.exceptions.FilesystemError``. Old alias is still available.
15+
16+
17+
318
Version: 2.1.0 - 2025-09-25
419
===========================
520

MANIFEST.in

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,18 @@ include make.bat
3838
include pyftpdlib/__init__.py
3939
include pyftpdlib/__main__.py
4040
include pyftpdlib/authorizers.py
41+
include pyftpdlib/exceptions.py
4142
include pyftpdlib/filesystems.py
42-
include pyftpdlib/handlers.py
43+
include pyftpdlib/handlers/__init__.py
44+
include pyftpdlib/handlers/ftp/__init__.py
45+
include pyftpdlib/handlers/ftp/control.py
46+
include pyftpdlib/handlers/ftp/data.py
47+
include pyftpdlib/handlers/ftp/dispatchers.py
48+
include pyftpdlib/handlers/ftp/producers.py
49+
include pyftpdlib/handlers/ftps/__init__.py
50+
include pyftpdlib/handlers/ftps/control.py
51+
include pyftpdlib/handlers/ftps/data.py
52+
include pyftpdlib/handlers/ftps/ssl.py
4353
include pyftpdlib/ioloop.py
4454
include pyftpdlib/log.py
4555
include pyftpdlib/prefork.py

demo/md5_ftpd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import hashlib
1212
import os
1313

14-
from pyftpdlib.authorizers import AuthenticationFailed
1514
from pyftpdlib.authorizers import DummyAuthorizer
15+
from pyftpdlib.exceptions import AuthenticationFailed
1616
from pyftpdlib.handlers import FTPHandler
1717
from pyftpdlib.servers import FTPServer
1818

docs/api.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,26 @@ Modules and classes hierarchy
1414

1515
::
1616

17-
pyftpdlib.authorizers.AuthenticationFailed
1817
pyftpdlib.authorizers.DummyAuthorizer
1918
pyftpdlib.authorizers.UnixAuthorizer
2019
pyftpdlib.authorizers.WindowsAuthorizer
21-
pyftpdlib.handlers.FTPHandler
22-
pyftpdlib.handlers.TLS_FTPHandler
23-
pyftpdlib.handlers.DTPHandler
24-
pyftpdlib.handlers.TLS_DTPHandler
25-
pyftpdlib.handlers.ThrottledDTPHandler
26-
pyftpdlib.filesystems.FilesystemError
20+
pyftpdlib.exceptions.AuthenticationFailed
21+
pyftpdlib.exceptions.AuthorizerError
22+
pyftpdlib.exceptions.FilesystemError
2723
pyftpdlib.filesystems.AbstractedFS
2824
pyftpdlib.filesystems.UnixFilesystem
29-
pyftpdlib.servers.FTPServer
30-
pyftpdlib.servers.ThreadedFTPServer
31-
pyftpdlib.servers.MultiprocessFTPServer
32-
pyftpdlib.ioloop.IOLoop
33-
pyftpdlib.ioloop.Connector
25+
pyftpdlib.handlers.DTPHandler
26+
pyftpdlib.handlers.FTPHandler
27+
pyftpdlib.handlers.ThrottledDTPHandler
28+
pyftpdlib.handlers.TLS_DTPHandler
29+
pyftpdlib.handlers.TLS_FTPHandler
3430
pyftpdlib.ioloop.Acceptor
3531
pyftpdlib.ioloop.AsyncChat
32+
pyftpdlib.ioloop.Connector
33+
pyftpdlib.ioloop.IOLoop
34+
pyftpdlib.servers.FTPServer
35+
pyftpdlib.servers.MultiprocessFTPServer
36+
pyftpdlib.servers.ThreadedFTPServer
3637

3738
Users
3839
=====
@@ -91,7 +92,7 @@ Users
9192

9293
.. method:: validate_authentication(username, password, handler)
9394

94-
Raises :class:`pyftpdlib.authorizers.AuthenticationFailed` if the supplied
95+
Raises :class:`pyftpdlib.exceptions.AuthenticationFailed` if the supplied
9596
username and password don't match the stored credentials.
9697

9798
*Changed in 1.0.0: new handler parameter.*

pyftpdlib/authorizers.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,19 @@ class for:
1717
interact with UNIX and Windows password database.
1818
"""
1919

20-
2120
import os
2221
import warnings
2322

23+
from .exceptions import AuthenticationFailed
24+
from .exceptions import AuthorizerError
25+
2426
__all__ = [
2527
"DummyAuthorizer",
2628
# 'BaseUnixAuthorizer', 'UnixAuthorizer',
2729
# 'BaseWindowsAuthorizer', 'WindowsAuthorizer',
2830
]
2931

3032

31-
# ===================================================================
32-
# --- exceptions
33-
# ===================================================================
34-
35-
36-
class AuthorizerError(Exception):
37-
"""Base class for authorizer exceptions."""
38-
39-
40-
class AuthenticationFailed(Exception):
41-
"""Exception raised when authentication fails for any reason."""
42-
43-
4433
# ===================================================================
4534
# --- base class
4635
# ===================================================================

pyftpdlib/exceptions.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright (C) 2007 Giampaolo Rodola' <g.rodola@gmail.com>.
2+
# Use of this source code is governed by MIT license that can be
3+
# found in the LICENSE file.
4+
5+
__all__ = ["AuthenticationFailed", "AuthorizerError", "FilesystemError"]
6+
7+
8+
class AuthorizerError(Exception):
9+
"""Base class for authorizer exceptions."""
10+
11+
12+
class AuthenticationFailed(Exception):
13+
"""Exception raised when authentication fails for any reason."""
14+
15+
16+
class FilesystemError(Exception):
17+
"""Custom class for filesystem-related exceptions.
18+
You can raise this from an AbstractedFS subclass in order to
19+
send a customized error string to the client.
20+
"""
21+
22+
23+
class _RetryError(Exception):
24+
"""Raised when a socket operation would block, and hence it should
25+
be retried at a later time.
26+
"""
27+
28+
29+
class _FileReadWriteError(OSError):
30+
"""Exception raised when reading or writing a file during a transfer."""
31+
32+
33+
class _GiveUpOnSendfile(Exception):
34+
"""Exception raised in case use of sendfile() fails on first try,
35+
in which case send() will be used.
36+
"""

pyftpdlib/filesystems.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import tempfile
88
import time
99

10+
from .exceptions import FilesystemError
1011
from .utils import memoize
1112

1213
try:
@@ -16,7 +17,7 @@
1617
pwd = grp = None
1718

1819

19-
__all__ = ["AbstractedFS", "FilesystemError"]
20+
__all__ = ["AbstractedFS"]
2021

2122

2223
_months_map = {
@@ -35,18 +36,6 @@
3536
}
3637

3738

38-
# ===================================================================
39-
# --- custom exceptions
40-
# ===================================================================
41-
42-
43-
class FilesystemError(Exception):
44-
"""Custom class for filesystem-related exceptions.
45-
You can raise this from an AbstractedFS subclass in order to
46-
send a customized error string to the client.
47-
"""
48-
49-
5039
# ===================================================================
5140
# --- base class
5241
# ===================================================================

pyftpdlib/handlers/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (C) 2007 Giampaolo Rodola' <g.rodola@gmail.com>.
2+
# Use of this source code is governed by MIT license that can be
3+
# found in the LICENSE file.
4+
5+
from .ftp.control import FTPHandler # noqa: F401
6+
from .ftp.data import DTPHandler # noqa: F401
7+
from .ftp.data import ThrottledDTPHandler # noqa: F401
8+
9+
try:
10+
from OpenSSL import SSL # noqa: F401
11+
except ImportError:
12+
pass
13+
else:
14+
from .ftps.control import TLS_FTPHandler # noqa: F401
15+
from .ftps.data import TLS_DTPHandler # noqa: F401

pyftpdlib/handlers/ftp/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Copyright (C) 2007 Giampaolo Rodola' <g.rodola@gmail.com>.
2+
# Use of this source code is governed by MIT license that can be
3+
# found in the LICENSE file.

0 commit comments

Comments
 (0)