Compare commits

...

4 Commits

Author SHA1 Message Date
Sebastian Lohff 2a19a29aa1 Release 0.5.4 2023-01-23 21:50:44 +01:00
Sebastian Lohff 1d12ee4704 Drop python3.6 support
servefile still works with python3.6, we just no longer test this.
2023-01-23 21:50:42 +01:00
Sebastian Lohff 876d190703 Ignore python3.11 cgi deprecation warning
The cgi module is marked as deprecated and will be removed in
python3.13. servefile uses the module for its FieldStorage class used in
the upload functionality. For now I will just ignore this, so servefile
doesn't print out the warning each time it is run, but soon this will
require either a rewrite of FieldStorage or an external library.

With this commit we also now officially support python3.10 and
python3.11.
2023-01-23 21:50:11 +01:00
Sebastian Lohff d334a52e50 Code formatting
* removed weird linebreaks for for-loop
 * no () for del statement
2023-01-23 20:43:42 +01:00
7 changed files with 27 additions and 13 deletions

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [2.7, 3.6, 3.7, 3.8, 3.9]
python: [2.7, 3.7, 3.8, 3.9, "3.10", 3.11]
steps:
- uses: actions/checkout@v2

View File

@ -1,6 +1,17 @@
servefile changelog
===================
2023-01-23 v0.5.4
-----------------
0.5.4 released
* code reformatting for better maintainability
* upload to uploaddir instead of /tmp for large files
* add python3.10 / python3.11 support
* drop python3.6 support
2021-11-18 v0.5.3
-----------------

View File

@ -1,4 +1,4 @@
.TH SERVEFILE 1 "November 2021" "servefile 0.5.3" "User Commands"
.TH SERVEFILE 1 "January 2023" "servefile 0.5.4" "User Commands"
.SH NAME
servefile \- small HTTP-Server for temporary file transfer

View File

@ -7,11 +7,10 @@
from __future__ import print_function
__version__ = '0.5.3'
__version__ = '0.5.4'
import argparse
import base64
import cgi
import datetime
import io
import mimetypes
@ -23,6 +22,7 @@ from subprocess import Popen, PIPE
import sys
import tempfile
import time
import warnings
# fix imports for python2/python3
try:
@ -43,6 +43,11 @@ try:
except ImportError:
pass
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
# scheduled for removal in python3.13, used for FieldStorage
import cgi
def getDateStrNow():
""" Get the current time formatted for HTTP header """
@ -527,10 +532,7 @@ class DirListingHandler(FileBaseHandler):
target_items.append((item, itemPath, stat))
# Directories first, then files
for (tuple_list, is_dir) in (
(dir_items, True),
(file_items, False),
):
for (tuple_list, is_dir) in ((dir_items, True), (file_items, False)):
for (item, itemPath, stat) in tuple_list:
self._appendToListing(content, item, itemPath, stat, is_dir=is_dir)
@ -874,7 +876,7 @@ class ServeFile():
if oldLang:
os.environ['LC_ALL'] = oldLang
else:
del(os.environ['LC_ALL'])
del os.environ['LC_ALL']
if proc.wait() != 0:
# we couldn't find any ip address
proc = None

View File

@ -11,7 +11,7 @@ setup(
long_description=long_description,
long_description_content_type='text/markdown',
platforms='posix',
version='0.5.3',
version='0.5.4',
license='GPLv3 or later',
url='https://github.com/sebageek/servefile/',
author='Sebastian Lohff',
@ -38,10 +38,11 @@ setup(
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Communications',
'Topic :: Communications :: File Sharing',
'Topic :: Internet',

View File

@ -146,7 +146,7 @@ def _test_version(run_servefile, standalone):
version = s.stdout.readline().decode().strip()
# hardcode version as string until servefile is a module
assert version == 'servefile 0.5.3'
assert version == 'servefile 0.5.4'
def test_version(run_servefile):

View File

@ -1,5 +1,5 @@
[tox]
envlist = py27,py36,py37,py38,py39,pep8
envlist = py27,py37,py38,py39,py310,py311,pep8
[testenv]
deps =