s3cmd: update to 2.0.1.

This commit is contained in:
Duncaen 2017-10-22 20:42:05 +02:00
parent 3fedc49bfd
commit 615628b097
2 changed files with 2 additions and 54 deletions

View File

@ -1,52 +0,0 @@
From 58dbe1e727573ffb2eb95cc811bce7f56e3b0a25 Mon Sep 17 00:00:00 2001
From: Florent Viard <fviard@lacie.com>
Date: Mon, 24 Jul 2017 11:44:49 +0200
Subject: [PATCH] Fixes #895 - Refactored py3 source to be byte-compilable with
py2 to fix warnings during "setup.py install"
---
S3/Custom_httplib3x.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/S3/Custom_httplib3x.py b/S3/Custom_httplib3x.py
index 50448a0f..42d84228 100644
--- S3/Custom_httplib3x.py
+++ S3/Custom_httplib3x.py
@@ -1,6 +1,7 @@
from __future__ import absolute_import, print_function
import os
+import sys
import http.client as httplib
from http.client import (_CS_REQ_SENT, _CS_REQ_STARTED, CONTINUE, UnknownProtocol,
@@ -23,14 +24,18 @@ def _encode(data, name='data'):
try:
return data.encode("latin-1")
except UnicodeEncodeError as err:
- raise UnicodeEncodeError(
+ # The following is equivalent to raise Exception() from None
+ # but is still byte-compilable compatible with python 2.
+ exc = UnicodeEncodeError(
err.encoding,
err.object,
err.start,
err.end,
"%s (%.20r) is not valid Latin-1. Use %s.encode('utf-8') "
"if you want to send it encoded in UTF-8." %
- (name.title(), data[err.start:err.end], name)) from None
+ (name.title(), data[err.start:err.end], name))
+ exc.__cause__ = None
+ raise exc
def httpresponse_patched_begin(self):
""" Re-implemented httplib begin function
@@ -204,7 +209,7 @@ def httpconnection_patched_send_request(self, method, url, body, headers,
elif resp.status == CONTINUE:
self.wrapper_send_body(body, encode_chunked)
-def httpconnection_patched_endheaders(self, message_body=None, *, encode_chunked=False):
+def httpconnection_patched_endheaders(self, message_body=None, encode_chunked=False):
"""REIMPLEMENTED because new argument encode_chunked added after py 3.4"""
"""Indicate that the last header line has been sent to the server.

View File

@ -1,6 +1,6 @@
# Template file for 's3cmd'
pkgname=s3cmd
version=2.0.0
version=2.0.1
revision=1
noarch=yes
build_style=python2-module
@ -12,7 +12,7 @@ maintainer="Duncaen <duncaen@voidlinux.eu>"
license="GPL-2"
homepage="http://s3tools.org/s3cmd"
distfiles="https://github.com/s3tools/${pkgname}/archive/v${version}.tar.gz"
checksum=12698c115a52e4a705cf3dae67a84da3ccd9516c116bbc9717922d359fb8b18f
checksum=92d2582a5a3771e9bb3a552b5bdc00b4a1cc6e8b735abac225f1c97a86f6d3b7
pre_install() {
export S3CMD_INSTPATH_DOC="share/doc"