Merge branch 'fix-py37'
I tested this locally (on MacOS) against python3.7.0, and it now works. This will appear broken on travis/appveyor until those CI environments add support for py3.7 (but the failures should be ignored since py3.7 is in the 'allowed_failures' list). closes #306
This commit is contained in:
commit
5ccda71467
|
@ -18,6 +18,12 @@ environment:
|
||||||
- PYTHON: "C:\\Python35-x64"
|
- PYTHON: "C:\\Python35-x64"
|
||||||
- PYTHON: "C:\\Python36"
|
- PYTHON: "C:\\Python36"
|
||||||
- PYTHON: "C:\\Python36-x64"
|
- PYTHON: "C:\\Python36-x64"
|
||||||
|
- PYTHON: "C:\\Python37-x64"
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
allow_failures:
|
||||||
|
- PYTHON: "C:\\Python37-x64"
|
||||||
|
# appveyor does not yet install python-3.7
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- |
|
- |
|
||||||
|
|
|
@ -12,6 +12,7 @@ python:
|
||||||
- "3.4"
|
- "3.4"
|
||||||
- "3.5"
|
- "3.5"
|
||||||
- "3.6"
|
- "3.6"
|
||||||
|
- "3.7"
|
||||||
- "nightly"
|
- "nightly"
|
||||||
install:
|
install:
|
||||||
- pip install -U pip tox virtualenv codecov
|
- pip install -U pip tox virtualenv codecov
|
||||||
|
@ -27,4 +28,6 @@ after_success:
|
||||||
matrix:
|
matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- python: "3.3"
|
- python: "3.3"
|
||||||
|
# travis doesn't support py3.7 yet
|
||||||
|
- python: "3.7"
|
||||||
- python: "nightly"
|
- python: "nightly"
|
||||||
|
|
|
@ -331,7 +331,14 @@ class Receiver:
|
||||||
self._msg(u"%d files, %s (uncompressed)" %
|
self._msg(u"%d files, %s (uncompressed)" %
|
||||||
(file_data["numfiles"], naturalsize(file_data["numbytes"])))
|
(file_data["numfiles"], naturalsize(file_data["numbytes"])))
|
||||||
self._ask_permission()
|
self._ask_permission()
|
||||||
return tempfile.SpooledTemporaryFile()
|
f = tempfile.SpooledTemporaryFile()
|
||||||
|
# workaround for https://bugs.python.org/issue26175 (STF doesn't
|
||||||
|
# fully implement IOBase abstract class), which breaks the new
|
||||||
|
# zipfile in py3.7.0 that expects .seekable
|
||||||
|
if not hasattr(f, "seekable"):
|
||||||
|
# AFAICT all the filetypes that STF wraps can seek
|
||||||
|
f.seekable = lambda: True
|
||||||
|
return f
|
||||||
|
|
||||||
def _decide_destname(self, mode, destname):
|
def _decide_destname(self, mode, destname):
|
||||||
# the basename() is intended to protect us against
|
# the basename() is intended to protect us against
|
||||||
|
|
|
@ -314,6 +314,12 @@ class Sender:
|
||||||
# We're sending a directory. Create a zipfile in a tempdir and
|
# We're sending a directory. Create a zipfile in a tempdir and
|
||||||
# send that.
|
# send that.
|
||||||
fd_to_send = tempfile.SpooledTemporaryFile()
|
fd_to_send = tempfile.SpooledTemporaryFile()
|
||||||
|
# workaround for https://bugs.python.org/issue26175 (STF doesn't
|
||||||
|
# fully implement IOBase abstract class), which breaks the new
|
||||||
|
# zipfile in py3.7.0 that expects .seekable
|
||||||
|
if not hasattr(fd_to_send, "seekable"):
|
||||||
|
# AFAICT all the filetypes that STF wraps can seek
|
||||||
|
fd_to_send.seekable = lambda: True
|
||||||
num_files = 0
|
num_files = 0
|
||||||
num_bytes = 0
|
num_bytes = 0
|
||||||
tostrip = len(what.split(os.sep))
|
tostrip = len(what.split(os.sep))
|
||||||
|
|
2
tox.ini
2
tox.ini
|
@ -4,7 +4,7 @@
|
||||||
# and then run "tox" from this directory.
|
# and then run "tox" from this directory.
|
||||||
|
|
||||||
[tox]
|
[tox]
|
||||||
envlist = {py27,py34,py35,py36,pypy,flake8}
|
envlist = {py27,py34,py35,py36,py37,pypy,flake8}
|
||||||
skip_missing_interpreters = True
|
skip_missing_interpreters = True
|
||||||
minversion = 2.4.0
|
minversion = 2.4.0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user