Hello community,
here is the log from the commit of package python-PyWebDAV3 for
openSUSE:Factory checked in at 2019-03-19 09:57:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-PyWebDAV3 (Old)
and /work/SRC/openSUSE:Factory/.python-PyWebDAV3.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-PyWebDAV3"
Tue Mar 19 09:57:53 2019 rev:2 rq:682065 version:0.9.12
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-PyWebDAV3/python-PyWebDAV3.changes
2017-10-01 17:01:21.498560501 +0200
+++
/work/SRC/openSUSE:Factory/.python-PyWebDAV3.new.28833/python-PyWebDAV3.changes
2019-03-19 09:57:55.608114182 +0100
@@ -1,0 +2,19 @@
+Wed Mar 6 09:27:27 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Add patch to work properly with py2:
+ * python2.patch
+
+-------------------------------------------------------------------
+Wed Mar 6 09:25:04 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 0.9.12:
+ * No upstream chagelog provided
+- Remove merged fix_python2_urllib.patch
+- Sort with spec-cleaner
+
+-------------------------------------------------------------------
+Tue Dec 4 12:53:22 UTC 2018 - Matej Cepl <[email protected]>
+
+- Remove superfluous devel dependency for noarch package
+
+-------------------------------------------------------------------
Old:
----
PyWebDAV3-0.9.11.tar.gz
fix_python2_urllib.patch
New:
----
PyWebDAV3-0.9.12.tar.gz
python2.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-PyWebDAV3.spec ++++++
--- /var/tmp/diff_new_pack.kgaoJn/_old 2019-03-19 09:57:56.800113703 +0100
+++ /var/tmp/diff_new_pack.kgaoJn/_new 2019-03-19 09:57:56.808113700 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-PyWebDAV3
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,43 +12,37 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
-%bcond_without test
-Name: python-PyWebDAV3
-Version: 0.9.11
%define ltmsver 0.13
+Name: python-PyWebDAV3
+Version: 0.9.12
Release: 0
Summary: WebDAV library including a standalone server for python2 and
python3
-License: LGPL-2.0
+License: LGPL-2.0-only
Group: Development/Languages/Python
-Url: https://github.com/andrewleech/PyWebDAV3
+URL: https://github.com/andrewleech/PyWebDAV3
Source0:
https://files.pythonhosted.org/packages/source/P/PyWebDAV3/PyWebDAV3-%{version}.tar.gz
# Only used in %check for testing purposes
Source1: http://www.webdav.org/neon/litmus/litmus-%{ltmsver}.tar.gz
-# PATCH-FIX-UPSTREAM fix_python2_urllib.patch
https://github.com/andrewleech/PyWebDAV3/commit/62e67e5523b6f8a3d47e1406d045c9e2abb9e8ba
and
https://github.com/andrewleech/PyWebDAV3/commit/eb4017d8894242ab4453cc1c2d432ebd299c13a0
-Patch1: fix_python2_urllib.patch
-BuildRequires: %{python_module devel}
+Patch0: python2.patch
+BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
+BuildRequires: %{python_module six}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
-%if %{with test}
-BuildRequires: %{python_module pytest}
-BuildRequires: %{python_module six}
-%endif
Requires: python-six
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
BuildArch: noarch
%ifpython2
Obsoletes: %{oldpython}-PyWebDAV < %{version}
Provides: %{oldpython}-PyWebDAV = %{version}
%endif
-Requires(post): update-alternatives
-Requires(postun): update-alternatives
-
%python_subpackages
%description
@@ -57,25 +51,12 @@
Consists of a server that is ready to run Serve and the DAV package
that provides WebDAV server functionality.
-Currently supports
-
- * WebDAV level 1
- * Level 2 (LOCK, UNLOCK)
- * Experimental iterator support
-
-It plays nice with
-
- * Mac OS X Finder
- * Windows Explorer
- * iCal
- * cadaver
- * Nautilus
-
This package does not provide client functionality.
%prep
%setup -q -n PyWebDAV3-%{version}
-%patch1 -p1
+%patch0 -p1
+cp %{SOURCE1} test/
%build
%python_build
@@ -84,7 +65,7 @@
%python_install
%{python_expand chmod a+x
%{buildroot}%{$python_sitelib}/pywebdav/server/server.py
-sed -i "s|^#!/usr/bin/env python$|#!%{__$python}|"
%{buildroot}%{$python_sitelib}/pywebdav/server/server.py
+sed -i "s|^#!%{_bindir}/env python$|#!%{__$python}|"
%{buildroot}%{$python_sitelib}/pywebdav/server/server.py
%fdupes %{buildroot}%{$python_sitelib}
$python -m compileall -d %{$python_sitelib}
%{buildroot}%{$python_sitelib}/pywebdav/server/
$python -O -m compileall -d %{$python_sitelib}
%{buildroot}%{$python_sitelib}/pywebdav/server/
@@ -93,12 +74,9 @@
%python_clone -a %{buildroot}%{_bindir}/davserver
-%if %{with test}
%check
-cp %{SOURCE1} test/
-%python_expand py.test-%{$python_bin_suffix}
+%python_expand py.test-%{$python_bin_suffix} -v
rm test/litmus-%{ltmsver}.tar.gz
-%endif
%post
%python_install_alternative davserver
@@ -107,8 +85,8 @@
%python_uninstall_alternative davserver
%files %{python_files}
-%defattr(-,root,root,-)
-%doc README doc/Changes doc/LICENSE doc/TODO
+%license doc/LICENSE
+%doc README doc/Changes doc/TODO
%python_alternative %{_bindir}/davserver
%{python_sitelib}/*
++++++ PyWebDAV3-0.9.11.tar.gz -> PyWebDAV3-0.9.12.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/.gitignore
new/PyWebDAV3-0.9.12/.gitignore
--- old/PyWebDAV3-0.9.11/.gitignore 1970-01-01 01:00:00.000000000 +0100
+++ new/PyWebDAV3-0.9.12/.gitignore 2017-10-29 11:51:14.000000000 +0100
@@ -0,0 +1,64 @@
+# IntelliJ project files
+.idea
+*.iml
+out
+gen### Python template
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+*.py.bak
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+.hypothesis/
+
+# Translations
+*.mo
+*.pot
+
+# dotenv
+.env
+
+# virtualenv
+venv/
+ENV/
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/.travis.yml
new/PyWebDAV3-0.9.12/.travis.yml
--- old/PyWebDAV3-0.9.11/.travis.yml 1970-01-01 01:00:00.000000000 +0100
+++ new/PyWebDAV3-0.9.12/.travis.yml 2017-10-29 11:51:14.000000000 +0100
@@ -0,0 +1,9 @@
+language: python
+python:
+ - "2.7"
+ - "3.4"
+ - "3.5"
+# install dependencies
+install: "pip install ."
+# run tests
+script: py.test -v
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/MANIFEST.in
new/PyWebDAV3-0.9.12/MANIFEST.in
--- old/PyWebDAV3-0.9.11/MANIFEST.in 2016-08-03 14:04:47.000000000 +0200
+++ new/PyWebDAV3-0.9.12/MANIFEST.in 2017-10-29 11:51:14.000000000 +0100
@@ -1,3 +1,3 @@
-include setup.py README VERSION
+include setup.py README
include doc/*
include pywebdav/lib/*.py pywebdav/server/*.ini
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/PKG-INFO
new/PyWebDAV3-0.9.12/PKG-INFO
--- old/PyWebDAV3-0.9.11/PKG-INFO 2016-08-03 14:04:51.000000000 +0200
+++ new/PyWebDAV3-0.9.12/PKG-INFO 2017-10-29 11:58:51.000000000 +0100
@@ -1,11 +1,12 @@
Metadata-Version: 1.1
Name: PyWebDAV3
-Version: 0.9.11
-Summary: WebDAV library including a standalone server for python3
+Version: 0.9.12
+Summary: WebDAV library including a standalone server for python 3
Home-page: https://github.com/andrewleech/PyWebDAV3
-Author: Andrew Leech
+Author: Andrew Leech (previously Simon Pamies)
Author-email: [email protected]
License: LGPL v2
+Description-Content-Type: UNKNOWN
Description:
WebDAV library for python3.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/PyWebDAV3.egg-info/PKG-INFO
new/PyWebDAV3-0.9.12/PyWebDAV3.egg-info/PKG-INFO
--- old/PyWebDAV3-0.9.11/PyWebDAV3.egg-info/PKG-INFO 2016-08-03
14:04:50.000000000 +0200
+++ new/PyWebDAV3-0.9.12/PyWebDAV3.egg-info/PKG-INFO 2017-10-29
11:58:51.000000000 +0100
@@ -1,11 +1,12 @@
Metadata-Version: 1.1
Name: PyWebDAV3
-Version: 0.9.11
-Summary: WebDAV library including a standalone server for python3
+Version: 0.9.12
+Summary: WebDAV library including a standalone server for python 3
Home-page: https://github.com/andrewleech/PyWebDAV3
-Author: Andrew Leech
+Author: Andrew Leech (previously Simon Pamies)
Author-email: [email protected]
License: LGPL v2
+Description-Content-Type: UNKNOWN
Description:
WebDAV library for python3.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/PyWebDAV3.egg-info/SOURCES.txt
new/PyWebDAV3-0.9.12/PyWebDAV3.egg-info/SOURCES.txt
--- old/PyWebDAV3-0.9.11/PyWebDAV3.egg-info/SOURCES.txt 2016-08-03
14:04:50.000000000 +0200
+++ new/PyWebDAV3-0.9.12/PyWebDAV3.egg-info/SOURCES.txt 2017-10-29
11:58:51.000000000 +0100
@@ -1,3 +1,5 @@
+.gitignore
+.travis.yml
MANIFEST.in
README
VERSION
@@ -18,6 +20,7 @@
doc/interface_class
doc/walker
pywebdav/__init__.py
+pywebdav/__main__.py
pywebdav/lib/AuthServer.py
pywebdav/lib/INI_Parse.py
pywebdav/lib/WebDAVServer.py
@@ -42,4 +45,6 @@
pywebdav/server/fshandler.py
pywebdav/server/mysqlauth.py
pywebdav/server/server.py
+test/.gitignore
+test/litmus-0.13.tar.gz
test/test_litmus.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/VERSION new/PyWebDAV3-0.9.12/VERSION
--- old/PyWebDAV3-0.9.11/VERSION 2016-08-03 14:04:47.000000000 +0200
+++ new/PyWebDAV3-0.9.12/VERSION 2017-10-29 11:55:28.000000000 +0100
@@ -1 +1 @@
-0.9.11
+0.9.12
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/pywebdav/__init__.py
new/PyWebDAV3-0.9.12/pywebdav/__init__.py
--- old/PyWebDAV3-0.9.11/pywebdav/__init__.py 2016-08-03 14:04:47.000000000
+0200
+++ new/PyWebDAV3-0.9.12/pywebdav/__init__.py 2017-10-29 11:58:34.000000000
+0100
@@ -0,0 +1,5 @@
+"""WebDAV library including a standalone server for python 3"""
+__version__ = '0.9.12'
+__author__ = 'Andrew Leech (previously Simon Pamies)'
+__email__ = '[email protected]'
+__license__ = 'LGPL v2'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/pywebdav/__main__.py
new/PyWebDAV3-0.9.12/pywebdav/__main__.py
--- old/PyWebDAV3-0.9.11/pywebdav/__main__.py 1970-01-01 01:00:00.000000000
+0100
+++ new/PyWebDAV3-0.9.12/pywebdav/__main__.py 2017-10-29 11:52:57.000000000
+0100
@@ -0,0 +1,2 @@
+from pywebdav.server import server
+server.run()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/pywebdav/lib/WebDAVServer.py
new/PyWebDAV3-0.9.12/pywebdav/lib/WebDAVServer.py
--- old/PyWebDAV3-0.9.11/pywebdav/lib/WebDAVServer.py 2016-08-03
14:04:47.000000000 +0200
+++ new/PyWebDAV3-0.9.12/pywebdav/lib/WebDAVServer.py 2017-10-29
11:51:14.000000000 +0100
@@ -22,7 +22,7 @@
import gzip
import io
-from pywebdav.lib import VERSION
+from pywebdav import __version__
from xml.parsers.expat import ExpatError
import six
@@ -53,7 +53,7 @@
"""
- server_version = "DAV/" + VERSION
+ server_version = "DAV/" + __version__
encode_threshold = 1400 # common MTU
def send_body(self, DATA, code=None, msg=None, desc=None,
@@ -75,7 +75,7 @@
if DATA:
if 'gzip' in self.headers.get('Accept-Encoding', '').split(',') \
and len(DATA) > self.encode_threshold:
- buffer = io.StringIO()
+ buffer = io.BytesIO()
output = gzip.GzipFile(mode='wb', fileobj=buffer)
if isinstance(DATA, str) or isinstance(DATA, six.text_type):
output.write(DATA)
@@ -134,19 +134,21 @@
for a, v in headers.items():
self.send_header(a, v)
+ GZDATA = None
if DATA:
if ('gzip' in self.headers.get('Accept-Encoding', '').split(',')
and len(DATA) > self.encode_threshold):
- buffer = io.StringIO()
+ buffer = io.BytesIO()
output = gzip.GzipFile(mode='wb', fileobj=buffer)
- if isinstance(DATA, str):
+ if isinstance(DATA, bytes):
output.write(DATA)
else:
for buf in DATA:
+ buf = buf.encode() if isinstance(buf, six.text_type)
else buf
output.write(buf)
output.close()
buffer.seek(0)
- DATA = buffer.getvalue()
+ GZDATA = buffer.getvalue()
self.send_header('Content-Encoding', 'gzip')
self.send_header('Content-Length', len(DATA))
@@ -157,7 +159,10 @@
self.end_headers()
- if DATA:
+ if GZDATA:
+ self.wfile.write(GZDATA)
+
+ elif DATA:
DATA = DATA.encode() if isinstance(DATA, six.text_type) else DATA
if isinstance(DATA, six.binary_type):
self.wfile.write(b"%s\r\n" % hex(len(DATA))[2:].encode())
@@ -232,7 +237,12 @@
# get the content type
try:
- content_type = dc.get_prop(uri, "DAV:", "getcontenttype")
+ if uri.endswith(b'/'):
+ # we could do away with this very non-local workaround for
+ # _get_listing if the data could have a type attached
+ content_type = 'text/html;charset=utf-8'
+ else:
+ content_type = dc.get_prop(uri, "DAV:", "getcontenttype")
except DAV_NotFound:
content_type = "application/octet-stream"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/pywebdav/lib/__init__.py
new/PyWebDAV3-0.9.12/pywebdav/lib/__init__.py
--- old/PyWebDAV3-0.9.11/pywebdav/lib/__init__.py 2016-08-03
14:04:47.000000000 +0200
+++ new/PyWebDAV3-0.9.12/pywebdav/lib/__init__.py 2017-10-29
11:51:14.000000000 +0100
@@ -1,14 +0,0 @@
-
-from __future__ import absolute_import
-import pkg_resources
-
-# try to get version from package (if installed)
-try:
- package = pkg_resources.require('PyWebDAV3')[0]
- VERSION = package.version
-except pkg_resources.DistributionNotFound:
- # Not running from installed version
- VERSION = "DEVELOPMENT"
-
-# author hardcoded here
-AUTHOR = 'Andrew Leech <[email protected]>, Simon Pamies <[email protected]>'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/pywebdav/lib/davcopy.py
new/PyWebDAV3-0.9.12/pywebdav/lib/davcopy.py
--- old/PyWebDAV3-0.9.11/pywebdav/lib/davcopy.py 2016-08-03
14:04:47.000000000 +0200
+++ new/PyWebDAV3-0.9.12/pywebdav/lib/davcopy.py 2017-10-29
11:51:14.000000000 +0100
@@ -5,7 +5,6 @@
import sys
import string
from six.moves import urllib
-import urllib.parse
from io import StringIO
from . import utils
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/pywebdav/lib/davmove.py
new/PyWebDAV3-0.9.12/pywebdav/lib/davmove.py
--- old/PyWebDAV3-0.9.11/pywebdav/lib/davmove.py 2016-08-03
14:04:47.000000000 +0200
+++ new/PyWebDAV3-0.9.12/pywebdav/lib/davmove.py 2017-10-29
11:51:14.000000000 +0100
@@ -1,6 +1,5 @@
from __future__ import absolute_import
from six.moves import urllib
-import urllib.parse
from . import utils
from .constants import COLLECTION, OBJECT, DAV_PROPS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/pywebdav/lib/locks.py
new/PyWebDAV3-0.9.12/pywebdav/lib/locks.py
--- old/PyWebDAV3-0.9.11/pywebdav/lib/locks.py 2016-08-03 14:04:47.000000000
+0200
+++ new/PyWebDAV3-0.9.12/pywebdav/lib/locks.py 2017-10-29 11:51:14.000000000
+0100
@@ -1,7 +1,6 @@
from __future__ import absolute_import
import time
from six.moves import urllib
-import urllib.parse
import random
import logging
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/pywebdav/lib/propfind.py
new/PyWebDAV3-0.9.12/pywebdav/lib/propfind.py
--- old/PyWebDAV3-0.9.11/pywebdav/lib/propfind.py 2016-08-03
14:04:47.000000000 +0200
+++ new/PyWebDAV3-0.9.12/pywebdav/lib/propfind.py 2017-10-29
11:51:14.000000000 +0100
@@ -4,7 +4,6 @@
import logging
from six.moves import urllib
-import urllib.parse
from . import utils
from .constants import RT_ALLPROP, RT_PROPNAME, RT_PROP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/pywebdav/lib/utils.py
new/PyWebDAV3-0.9.12/pywebdav/lib/utils.py
--- old/PyWebDAV3-0.9.11/pywebdav/lib/utils.py 2016-08-03 14:04:47.000000000
+0200
+++ new/PyWebDAV3-0.9.12/pywebdav/lib/utils.py 2017-10-29 11:51:14.000000000
+0100
@@ -3,10 +3,7 @@
import re
from xml.dom import minidom
-
from six.moves import urllib
-import urllib.parse
-
from .constants import RT_ALLPROP, RT_PROPNAME, RT_PROP
from six.moves.BaseHTTPServer import BaseHTTPRequestHandler
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/pywebdav/server/fshandler.py
new/PyWebDAV3-0.9.12/pywebdav/server/fshandler.py
--- old/PyWebDAV3-0.9.11/pywebdav/server/fshandler.py 2016-08-03
14:04:47.000000000 +0200
+++ new/PyWebDAV3-0.9.12/pywebdav/server/fshandler.py 2017-10-29
11:51:14.000000000 +0100
@@ -1,5 +1,7 @@
from __future__ import absolute_import
import os
+import html
+import textwrap
import six
import logging
import types
@@ -124,6 +126,27 @@
return filelist
+ def _get_listing(self, path):
+ """Return a directory listing similar to http.server's"""
+
+ template = textwrap.dedent("""
+ <html>
+ <head><title>Directory listing for {path}</title></head>
+ <body>
+ <h1>Directory listing for {path}</h1>
+ <hr>
+ <ul>
+ {items}
+ </ul>
+ <hr>
+ </body>
+ </html>
+ """)
+ escapeditems = (html.escape(i) + ('/' if
os.path.isdir(os.path.join(path, i)) else '') for i in os.listdir(path) if not
i.startswith('.'))
+ htmlitems = "\n".join('<li><a href="{i}">{i}</a></li>'.format(i=i) for
i in escapeditems)
+
+ return template.format(items=htmlitems, path=path)
+
def get_data(self,uri, range = None):
""" return the content of an object """
@@ -132,7 +155,7 @@
if os.path.isfile(path):
file_size = os.path.getsize(path)
if range is None:
- fp=open(path,"r")
+ fp=open(path,"rb")
log.info('Serving content of %s' % uri)
return Resource(fp, file_size)
else:
@@ -152,13 +175,12 @@
if range[1] > file_size:
range[1] = file_size
- fp=open(path,"r")
+ fp=open(path,"rb")
fp.seek(range[0])
log.info('Serving range %s -> %s content of %s' %
(range[0], range[1], uri))
return Resource(fp, range[1] - range[0])
elif os.path.isdir(path):
- # GET for collections is defined as 'return s/th meaningful'
:-)
- msg = 'Directory at %s' % uri
+ msg = self._get_listing(path)
return Resource(StringIO(msg), len(msg))
else:
# also raise an error for collections
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/pywebdav/server/server.py
new/PyWebDAV3-0.9.12/pywebdav/server/server.py
--- old/PyWebDAV3-0.9.11/pywebdav/server/server.py 2016-08-03
14:04:47.000000000 +0200
+++ new/PyWebDAV3-0.9.12/pywebdav/server/server.py 2017-10-29
11:51:14.000000000 +0100
@@ -31,7 +31,7 @@
from pywebdav.server.daemonize import startstop
from pywebdav.lib.INI_Parse import Configuration
-from pywebdav.lib import VERSION, AUTHOR
+from pywebdav import __version__, __author__
LEVELS = {'debug': logging.DEBUG,
'info': logging.INFO,
@@ -157,7 +157,7 @@
-h, --help Show this screen
Please send bug reports and feature requests to %s
-""" % (VERSION, AUTHOR)
+""" % (__version__, __author__)
def setupDummyConfig(**kw):
@@ -329,9 +329,9 @@
sys.exit(3)
if daemonaction != 'stop':
- log.info('Starting up PyWebDAV server (version %s)' % VERSION)
+ log.info('Starting up PyWebDAV server (version %s)' % __version__)
else:
- log.info('Stopping PyWebDAV server (version %s)' % VERSION)
+ log.info('Stopping PyWebDAV server (version %s)' % __version__)
if not noauth and daemonaction not in ['status', 'stop']:
if not user:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/setup.py
new/PyWebDAV3-0.9.12/setup.py
--- old/PyWebDAV3-0.9.11/setup.py 2016-08-03 14:04:47.000000000 +0200
+++ new/PyWebDAV3-0.9.12/setup.py 2017-10-29 11:51:14.000000000 +0100
@@ -3,11 +3,11 @@
from __future__ import absolute_import
from setuptools import setup, find_packages
from io import open
+import os
-VERSION = open('VERSION', 'r', encoding='utf-8').read()
-VERSION = VERSION.replace('\n', '')
+import pywebdav
-CHANGES = open('doc/Changes', 'r', encoding='utf-8').read()
+CHANGES = open(os.path.join(os.path.dirname(__file__), 'doc/Changes'), 'r',
encoding='utf-8').read()
DOC = """
WebDAV library for python3.
@@ -62,15 +62,15 @@
""" % CHANGES
setup(name='PyWebDAV3',
- description='WebDAV library including a standalone server for python3',
- author='Simon Pamies (porting to 3 by Andrew Leech)',
- author_email='[email protected] ([email protected])',
- maintainer='Andrew Leech',
- maintainer_email='[email protected]',
+ description=pywebdav.__doc__,
+ author=pywebdav.__author__,
+ author_email=pywebdav.__email__,
+ maintainer=pywebdav.__author__,
+ maintainer_email=pywebdav.__email__,
url='https://github.com/andrewleech/PyWebDAV3',
platforms=['Unix', 'Windows'],
- license='LGPL v2',
- version=VERSION,
+ license=pywebdav.__license__,
+ version=pywebdav.__version__,
long_description=DOC,
classifiers=[
'Development Status :: 5 - Production/Stable',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyWebDAV3-0.9.11/test/.gitignore
new/PyWebDAV3-0.9.12/test/.gitignore
--- old/PyWebDAV3-0.9.11/test/.gitignore 1970-01-01 01:00:00.000000000
+0100
+++ new/PyWebDAV3-0.9.12/test/.gitignore 2017-10-29 11:51:14.000000000
+0100
@@ -0,0 +1 @@
+/litmus-0.13/
Binary files old/PyWebDAV3-0.9.11/test/litmus-0.13.tar.gz and
new/PyWebDAV3-0.9.12/test/litmus-0.13.tar.gz differ
++++++ python2.patch ++++++
>From 5d7d16a4e417c9483d8ff529835498f336c6cc37 Mon Sep 17 00:00:00 2001
From: Andrew Leech <[email protected]>
Date: Mon, 23 Apr 2018 10:12:16 +1000
Subject: [PATCH] Fix python2 support
---
pywebdav/server/fshandler.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/pywebdav/server/fshandler.py b/pywebdav/server/fshandler.py
index 84bb333..7b9b0a6 100644
--- a/pywebdav/server/fshandler.py
+++ b/pywebdav/server/fshandler.py
@@ -1,6 +1,5 @@
from __future__ import absolute_import
import os
-import html
import textwrap
import six
import logging
@@ -12,6 +11,10 @@
from pywebdav.lib.errors import *
from pywebdav.lib.iface import *
from pywebdav.lib.davcmd import copyone, copytree, moveone, movetree, delone,
deltree
+if six.PY2:
+ from cgi import escape
+else:
+ from html import escape
log = logging.getLogger(__name__)
@@ -142,7 +145,7 @@ def _get_listing(self, path):
</body>
</html>
""")
- escapeditems = (html.escape(i) + ('/' if
os.path.isdir(os.path.join(path, i)) else '') for i in os.listdir(path) if not
i.startswith('.'))
+ escapeditems = (escape(i) + ('/' if os.path.isdir(os.path.join(path,
i)) else '') for i in os.listdir(path) if not i.startswith('.'))
htmlitems = "\n".join('<li><a href="{i}">{i}</a></li>'.format(i=i) for
i in escapeditems)
return template.format(items=htmlitems, path=path)