Skip to content

Commit fd31d6a

Browse files
claudeandrewleech
authored andcommitted
Complete removal of six compatibility library
This completes the migration started in PR #47 by removing all remaining references to the six library and replacing them with native Python 3 standard library imports. Changes: - Replace six.moves.BaseHTTPServer with http.server - Replace six.moves.socketserver with socketserver - Remove six from setup.py install_requires Files modified: - pywebdav/lib/utils.py: Import BaseHTTPRequestHandler from http.server - pywebdav/server/server.py: Import HTTPServer and ThreadingMixIn from stdlib - pywebdav/lib/AuthServer.py: Replace all six.moves.BaseHTTPServer references - setup.py: Remove six dependency All imports verified to work correctly with Python 3.
1 parent 0991320 commit fd31d6a

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

pywebdav/lib/AuthServer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import base64
88
import binascii
9-
import six.moves.BaseHTTPServer
9+
from http.server import BaseHTTPRequestHandler
1010

1111

1212
DEFAULT_AUTH_ERROR_MESSAGE = """
@@ -28,7 +28,7 @@ def _quote_html(html):
2828
return html.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
2929

3030

31-
class AuthRequestHandler(six.moves.BaseHTTPServer.BaseHTTPRequestHandler):
31+
class AuthRequestHandler(BaseHTTPRequestHandler):
3232
"""
3333
Simple handler that can check for auth headers
3434
@@ -41,7 +41,7 @@ class AuthRequestHandler(six.moves.BaseHTTPServer.BaseHTTPRequestHandler):
4141
DO_AUTH = 1
4242

4343
def parse_request(self):
44-
if not six.moves.BaseHTTPServer.BaseHTTPRequestHandler.parse_request(self):
44+
if not BaseHTTPRequestHandler.parse_request(self):
4545
return False
4646

4747
if self.DO_AUTH:

pywebdav/lib/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import urllib.parse
77

88
from .constants import RT_ALLPROP, RT_PROPNAME, RT_PROP
9-
from six.moves.BaseHTTPServer import BaseHTTPRequestHandler
9+
from http.server import BaseHTTPRequestHandler
1010

1111
def gen_estring(ecode):
1212
""" generate an error string from the given code """

pywebdav/server/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
logging.basicConfig(level=logging.WARNING)
1414
log = logging.getLogger('pywebdav')
1515

16-
from six.moves.BaseHTTPServer import HTTPServer
17-
from six.moves.socketserver import ThreadingMixIn
16+
from http.server import HTTPServer
17+
from socketserver import ThreadingMixIn
1818

1919
try:
2020
import pywebdav.lib

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@
4646
entry_points={
4747
'console_scripts': ['davserver = pywebdav.server.server:run']
4848
},
49-
install_requires = ['six'],
49+
install_requires = [],
5050
setup_requires=['git-versioner'],
5151
)

0 commit comments

Comments
 (0)