From 4feaccf0145a908d7b93e73f9d97d3cf0400f9e4 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 27 Aug 2015 00:56:08 +0200 Subject: [PATCH] Input validation must not depend on the locale storage_policy.py: replace string.letters with string.ascii_letters. This change does not change the behaviour on Python 2. It is only needed for Python 3 because string.letters was removed. On Python 2, string.letters is modified when locale.setlocale() is called. Hopefully, Swift doesn't call setlocale() and so it's safe to replace it. Change-Id: Ifbf9332ae739b1bfc9e6d2831f4e7581e69f233d --- swift/common/storage_policy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/common/storage_policy.py b/swift/common/storage_policy.py index b3b46065..df0672fa 100644 --- a/swift/common/storage_policy.py +++ b/swift/common/storage_policy.py @@ -27,7 +27,7 @@ from swift.common.exceptions import RingValidationError from pyeclib.ec_iface import ECDriver, ECDriverError, VALID_EC_TYPES LEGACY_POLICY_NAME = 'Policy-0' -VALID_CHARS = '-' + string.letters + string.digits +VALID_CHARS = '-' + string.ascii_letters + string.digits DEFAULT_POLICY_TYPE = REPL_POLICY = 'replication' EC_POLICY = 'erasure_coding'