15
0

- Update to 2.0.1

* exposed a new FTPHandler.encoding attribute defaulting to 'utf-8'.
  * removed Python 2.7 support.
  * remove copies of asyncore.py and asynchat.py. Use backports from
    PYPI instead.
  * set default SSL version from deprecated SSLv23_METHOD to newer
    TLS_SERVER_METHOD.
  * pysendfile module is no longer a required dependency.
  * SSLv2 and SSLv3 connections are no longer accepted when client
    connects.
- Add py314.patch to add compatibility with Python 3.14

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyftpdlib?expand=0&rev=55
This commit is contained in:
2025-09-12 11:56:07 +00:00
committed by Git OBS Bridge
commit acdee83874
7 changed files with 512 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

52
keycert.pem Normal file
View File

@@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
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vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQC/tUGr3VSP9DTsFEurR7tO8xEacF4Mn1hOT+gj2+OEzknDNivC
REjNRxy/GxT59sj5wDXXIP3Tj8H9zMjdzP4290EPMGzVIKeLUzLjJiqo0BmGamS9
qfyT1cENJU8aJjqWmYoKRswrRY3FFbipwl3MgdUyewPgWas9Ah9phEqC5aLGY6IL
QDXoBpcnsJGGpVtJUy6vqYd5C2ouuArK1hSr/k1uDAIuRv0FbnGxFp+Bm32appFd
zr+o523O161pisUVJFIXAMrJmyIXV7H4r9VZrptYUhNCnM5ghfCjAzoKWNu3uOyR
WhKfTSyQ+5f/GRUUtx5KTMllkQnjrUzNx09LAgMBAAGjUzBRMB0GA1UdDgQWBBR4
2Iidy6npIXwDz9Z/HrEyiRWYJDAfBgNVHSMEGDAWgBR42Iidy6npIXwDz9Z/HrEy
iRWYJDAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQALxcn19FtW
3Yem9V1s8awYFNE+WMWjS95jq+bICaOaE4J+zfoWXsIeHKzOsp735QSAErCht5Dr
+5t+e76lbSLHDN7NEeleQRIWiOHE2pp7R6CrMUQrhEh5YUtkK6aBJUZ6MUdtzRsx
6PL1HZ6cXxHhktoCkpWiSPSsxdsd4qBpoTvOfgc8XLohSPppS1jfjjgBjIZsu006
2OL/Ko9P26LkffJv+5oyze42XMGbHocaMRoQbAcmDVd26zAOzYEaQ4QlaX9mzfiP
7GLQ3si3SkWtaTnSVXxtj4PYnErCC6rR9iKyd9gmuiAuh5R8y9bGlrwOb8udbYnZ
cB8K2q9TPBBa
-----END CERTIFICATE-----

46
py314.patch Normal file
View File

@@ -0,0 +1,46 @@
From d90297a181c8edd8ffe5c08ba03866845e9a3493 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Fri, 22 Nov 2024 22:20:13 +0100
Subject: [PATCH] Avoid the multiprocessing forkserver method (#656)
Python 3.14 changed the default multiprocessing method for POSIX (sans macOS)
from fork to forkserver. This causes errors like:
TypeError: cannot pickle 'select.epoll' object
when serializing dict item '_poller'
when serializing pyftpdlib.ioloop.Epoll state
when serializing pyftpdlib.ioloop.Epoll object
when serializing dict item 'ioloop'
when serializing pyftpdlib.servers.MultiprocessFTPServer state
when serializing pyftpdlib.servers.MultiprocessFTPServer object
when serializing tuple item 0
when serializing method reconstructor arguments
when serializing method object
when serializing dict item '_target'
when serializing multiprocessing.context.Process state
when serializing multiprocessing.context.Process object
See https://github.com/python/cpython/issues/125714
---
pyftpdlib/servers.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/pyftpdlib/servers.py b/pyftpdlib/servers.py
index 32c0db02..3dfc39c6 100644
--- a/pyftpdlib/servers.py
+++ b/pyftpdlib/servers.py
@@ -579,6 +579,13 @@ class MultiprocessFTPServer(_SpawnerBase):
_lock = multiprocessing.Lock()
_exit = multiprocessing.Event()
+ # Python 3.14 changed the non-macOS POSIX default to forkserver
+ # but the code in this module does not work with it
+ # See https://github.com/python/cpython/issues/125714
+ if multiprocessing.get_start_method() == 'forkserver':
+ _mp_context = multiprocessing.get_context(method='fork')
+ else:
+ _mp_context = multiprocessing.get_context()
def _start_task(self, *args, **kwargs):
- return multiprocessing.Process(*args, **kwargs)
+ return self._mp_context.Process(*args, **kwargs)

3
pyftpdlib-2.0.1.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ef0d172a82bfae10e2dec222e87533514609d41bf4b0fd0f07e29d4380fb96bf
size 202285

272
python-pyftpdlib.changes Normal file
View File

@@ -0,0 +1,272 @@
-------------------------------------------------------------------
Thu Sep 11 12:40:28 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Update to 2.0.1
* exposed a new FTPHandler.encoding attribute defaulting to 'utf-8'.
* removed Python 2.7 support.
* remove copies of asyncore.py and asynchat.py. Use backports from
PYPI instead.
* set default SSL version from deprecated SSLv23_METHOD to newer
TLS_SERVER_METHOD.
* pysendfile module is no longer a required dependency.
* SSLv2 and SSLv3 connections are no longer accepted when client
connects.
- Add py314.patch to add compatibility with Python 3.14
-------------------------------------------------------------------
Tue Aug 19 14:26:32 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives on SLE-16-based and newer systems only
-------------------------------------------------------------------
Thu Jul 10 08:53:50 UTC 2025 - Andreas Schwab <schwab@suse.de>
- Set CIBUILDWHEEL to avoid spurious test failures
-------------------------------------------------------------------
Tue Jul 8 13:56:26 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives
-------------------------------------------------------------------
Sat Aug 31 12:04:37 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 1.5.10:
* use black formatter.
* use argparse instead of deprecated optparse.
* use pytest instead of unittest.
* add ability to run tests in parallel with make test-
parallel.
* PermissionError may occur on Windows when binding ports
from a pre-configured PASV range.
-------------------------------------------------------------------
Mon Mar 25 14:21:26 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 1.5.9:
* Enhancements
* #611: use ruff code style checker instead of flake8 + isort
(much faster + makes many more code quality checks).
* Bug fixes
* #604: client connection may be reset in PASV/EPSV mode during
TLS handshake. (patch by Benedikt McMullin)
* #607: possible infinite wait in Epoll (patch by
@stat1c-void)
* #607: possible infinite traceback printing in DTPHandler
(patch by @stat1c-void)
* #613: (CRITICAL) bugfix for TLS disconnect causing 100% CPU
usage. (patch by @hakai)
* #614: close connection on SSL EOF error, instead of
erroneously replying with "226 Transfer completed."
* Enhancements
* #586: removed Python 2.6 support.
* #591: speedup logging by 28% by using logging._srcfile = None
trick. This avoids calling calling sys._getframe() for each
log record.
* #605: added support for Python 3.12.
* Enhancements
* #544: replace Travis with Github Actions for CI testing.
* Bug fixes
* #481: fix [WinError 10038] an operation was attempted on
something that is not a socket. (patch by Tailing Yuan)
* #578, [critical]: FTPS broke with PyOpenSSL version 22.1.0.
* Enhancements
* #467: added pre-fork concurrency model, spawn()ing worker
processes to split load.
* #520: directory LISTing is now 3.7x times faster.
* Enhancements
* #495: colored test output.
* Bug fixes
* #492: CRLF line endings are replaced with CRCRLF in ASCII
mode downloads.
* #496: import error due to multiprocessing.Lock() bug.
* Enhancements
* #463: FTPServer class can now be used as a context manager.
* Bug fixes
* #431: Ctrl-C doesn't exit python -m pyftpdlib on Windows.
* #436: ThreadedFTPServer.max_cons is evaluated
threading.activeCount(). If the user uses threads of its own
it will consume the number of max_cons.
* #447: ThreadedFTPServer and MultiprocessFTPServer do not
join() tasks which are no longer consuming resources.
* Enhancements
* #201: implemented SITE MFMT command which changes file
modification time. (patch by Tahir Ijaz)
* #327: add username and password command line options
* #433: documentation moved to readthedocs:
http://pyftpdlib.readthedocs.io
* Bug fixes
* #403: fix duplicated output log. (path by PonyPC)
* #414: Respond successfully to STOR only after closing file
handle.
- drop support-python-312.patch (upstream)
-------------------------------------------------------------------
Tue Sep 19 05:14:22 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-python-312.patch, support Python 3.12+
- Stop using greedy globs in %files
- Switch to autosetup and pyproject macros
- Remove Python 2 leftovers
- Enable running the tests again
-------------------------------------------------------------------
Fri Apr 21 12:30:41 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
-------------------------------------------------------------------
Thu Apr 13 22:43:39 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Make calling of %{sle15modernpython} optional.
-------------------------------------------------------------------
Fri Oct 28 20:09:29 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
- Update to Version: 1.5.7 - 2022-10-04
Enhancements
* #544: replace Travis with Github Actions for CI testing.
Bug fixes
* #481: fix [WinError 10038] an operation was attempted on something that is not a socket. (patch by Tailing Yuan)
* #578, [critical]: FTPS broke with PyOpenSSL version 22.1.0.
- Update to Version: 1.5.6 - 2020-02-16
Enhancements
* #467: added pre-fork concurrency model, spawn()ing worker processes to split load.
* #520: directory LISTing is now 3.7x times faster.
-------------------------------------------------------------------
Wed Jan 19 08:00:32 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Switch off the test suite, it just doesn't work reliably
(gh#giampaolo/pyftpdlib#540).
-------------------------------------------------------------------
Tue Oct 26 04:12:28 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>
- Regenerate new private key/x509 certificate for the test suite.
(thanks, Jason!)
-------------------------------------------------------------------
Fri May 7 23:13:10 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Skip masquerade tests failung because the newest Pythons don't
allow invalid addresses gh#giampaolo/pyftpdlib#550, bpo-43285
- Remove script interpreter lines for test files and _compyt.py
(fix rpmlint warnings)
-------------------------------------------------------------------
Fri Dec 18 16:29:52 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- add ignore _build directories to pytest args to fix builds for
multiple pytest flavors gh#openSUSE/python-rpm-macros#66
- fix tests failing locally because of gh#giampaolo/pyftpdlib#478
-------------------------------------------------------------------
Sun Aug 16 04:20:40 UTC 2020 - John Vandenberg <jayvdb@gmail.com>
- Re-activate test suite, replacing nose with pytest
-------------------------------------------------------------------
Wed May 20 07:26:27 UTC 2020 - Petr Gajdos <pgajdos@suse.com>
- %python3_only -> %python_alternative
-------------------------------------------------------------------
Mon Apr 20 10:41:55 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Fix build without python2
-------------------------------------------------------------------
Fri Mar 27 08:46:37 UTC 2020 - Antonio Larrosa <alarrosa@suse.com>
- Do not remove tests, other packages import them
-------------------------------------------------------------------
Wed Mar 18 09:21:28 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 1.5.6:
- #467: added pre-fork concurrency model, spawn()ing worker processes to split
load.
- #520: directory LISTing is now 3.7x times faster.
-------------------------------------------------------------------
Tue May 28 11:07:18 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Do not remove tests, other packages import them
-------------------------------------------------------------------
Sat May 25 09:29:17 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 1.5.5:
* Various minor fixes and documentation updates
-------------------------------------------------------------------
Tue Dec 4 12:52:12 UTC 2018 - Matej Cepl <mcepl@suse.com>
- Remove superfluous devel dependency for noarch package
-------------------------------------------------------------------
Wed May 9 00:57:35 UTC 2018 - toddrme2178@gmail.com
- Version update to 1.5.4
+ Enhancements
* #463: FTPServer class can now be used as a context manager.
+ Bug fixes
* #431: Ctrl-C doesn't exit `python -m pyftpdlib` on Windows.
* #436: ThreadedFTPServer.max_cons is evaluated threading.activeCount(). If
the user uses threads of its own it will consume the number of max_cons.
* #447: ThreadedFTPServer and MultiprocessFTPServer do not join() tasks which
are no longer consuming resources.
- Disable tests since they randomly fail.
See https://github.com/giampaolo/pyftpdlib/issues/386
-------------------------------------------------------------------
Wed May 2 10:27:38 UTC 2018 - tchvatal@suse.com
- Version update to 1.5.3:
* implemented SITE MFMT command which changes file modification time. (patch by Tahir Ijaz)
* add username and password command line options
* documentation moved to readthedocs: http://pyftpdlib.readthedocs.io
* fix duplicated output log. (path by PonyPC)
* Respond successfully to STOR only after closing file handle.
-------------------------------------------------------------------
Thu Jul 6 00:25:48 UTC 2017 - jengelh@inai.de
- Trim exaggeration from descriptions.
-------------------------------------------------------------------
Thu Jun 22 14:14:51 UTC 2017 - jmatejek@suse.com
- update to 1.5.2
* disables old SSL methods
* fixed some hangs/crashes
- fixes test failures in OBS
- drop patches that are no longer needed:
* pyftpdlib-disable-error-0-ssl-unwrap.diff
* pyftpdlib-disable-incomplete-file-received.diff
* pyftpdlib-handle-missing-SSLv3.diff
- convert to singlespec
-------------------------------------------------------------------
Mon May 9 14:58:36 UTC 2016 - hpj@urpla.net
- add patch to disable another failing test, related to icomplete
file receptions
-------------------------------------------------------------------
Mon May 9 13:14:32 UTC 2016 - hpj@urpla.net
- add patch to test SSLv3 only, if available
-------------------------------------------------------------------
Mon May 9 10:34:42 UTC 2016 - hpj@urpla.net
- add patch to disable a test, that triggers an error 0 in ssl
-------------------------------------------------------------------
Sun May 8 20:15:42 UTC 2016 - hpj@urpla.net
- version 1.5.1: initial build

115
python-pyftpdlib.spec Normal file
View File

@@ -0,0 +1,115 @@
#
# spec file for package python-pyftpdlib
#
# Copyright (c) 2025 SUSE LLC and contributors
# Copyright (c) 2016 LISA GmbH, Bingen, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?sle15_python_module_pythons}
Name: python-pyftpdlib
Version: 2.0.1
Release: 0
Summary: Asynchronous FTP server library for Python
License: MIT
URL: https://github.com/giampaolo/pyftpdlib/
Source: https://files.pythonhosted.org/packages/source/p/pyftpdlib/pyftpdlib-%{version}.tar.gz
Source1: keycert.pem
# PATCH-FIX-UPSTREAM https://github.com/giampaolo/pyftpdlib/pull/656 Avoid the multiprocessing forkserver method
Patch0: py314.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module psutil}
BuildRequires: %{python_module pyOpenSSL}
BuildRequires: %{python_module pyasynchat}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-pyOpenSSL
Requires: python-pyasynchat
Requires: python-pyasyncore
BuildArch: noarch
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
%python_subpackages
%description
The Python FTP server library provides a high-level interface to
write very asynchronous FTP servers with Python.
%prep
%autosetup -p1 -n pyftpdlib-%{version}
sed -i '1 {/env python/ d}' pyftpdlib/test/*.py
cp %{SOURCE1} pyftpdlib/test
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/ftpbench
%python_expand %fdupes %{buildroot}%{$python_sitelib}
# Note: Do not remove tests. Other packages import them
%check
export CIBUILDWHEEL=1
ignorebuild="--ignore build"
%{python_expand # expand to python flavor, not to the binary name, then strip the trailing _
builddir=_build.$python_
ignorebuild+=" --ignore ${builddir%%_}"
}
cat > pytest.ini <<EOF
[pytest]
addopts =
-rs -v
$ignorebuild
EOF
%{python_expand # pytest macro does not work. The tests parse CLI args and fail if there are any unknown program args
export PYTHONPATH=%%{buildroot}%%{$python_sitelib}
export PYTHONDONTWRITEBYTECODE=1
# gh#giampaolo/pyftpdlib#540
##export PYTEST_ADDOPTS="-k 'not (TestFtpListingCmdsTLSMixin or TestConfigurableOptions or TestFtpStoreDataTLSMixin)'"
# gh#giampaolo/pyftpdlib#478
export TZ=GMT+1
$python -m pytest
}
%post
%python_install_alternative ftpbench
%postun
%python_uninstall_alternative ftpbench
%pre
%python_libalternatives_reset_alternative ftpbench
%files %{python_files}
%license LICENSE
%doc README.rst
%python_alternative %{_bindir}/ftpbench
%{python_sitelib}/pyftpdlib
%{python_sitelib}/pyftpdlib-%{version}.dist-info
%changelog