summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-07-20 13:28:36 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-07-20 13:28:36 +0200
commit324d48d0a7de895aeb7397cd3365ab03ac7f6724 (patch)
tree80f4bac8b5d92fe7d8d3cba805ffc5bae509f456
parent85cd458944c16769a707921619e94ccc3dfbf7bd (diff)
Switched to Python 3-compatible octal notation.
-rw-r--r--django/utils/daemonize.py2
-rw-r--r--tests/regressiontests/conditional_processing/models.py6
-rw-r--r--tests/regressiontests/file_storage/tests.py6
-rw-r--r--tests/regressiontests/file_uploads/tests.py6
4 files changed, 10 insertions, 10 deletions
diff --git a/django/utils/daemonize.py b/django/utils/daemonize.py
index a9d5128b33..ecd72aad52 100644
--- a/django/utils/daemonize.py
+++ b/django/utils/daemonize.py
@@ -3,7 +3,7 @@ import sys
if os.name == 'posix':
def become_daemon(our_home_dir='.', out_log='/dev/null',
- err_log='/dev/null', umask=022):
+ err_log='/dev/null', umask=0o022):
"Robustly turn into a UNIX daemon, running in our_home_dir."
# First fork
try:
diff --git a/tests/regressiontests/conditional_processing/models.py b/tests/regressiontests/conditional_processing/models.py
index 97aeff5eaa..d1a8ac605b 100644
--- a/tests/regressiontests/conditional_processing/models.py
+++ b/tests/regressiontests/conditional_processing/models.py
@@ -143,14 +143,14 @@ class HttpDateProcessing(unittest.TestCase):
def testParsingRfc1123(self):
parsed = parse_http_date('Sun, 06 Nov 1994 08:49:37 GMT')
self.assertEqual(datetime.utcfromtimestamp(parsed),
- datetime(1994, 11, 06, 8, 49, 37))
+ datetime(1994, 11, 6, 8, 49, 37))
def testParsingRfc850(self):
parsed = parse_http_date('Sunday, 06-Nov-94 08:49:37 GMT')
self.assertEqual(datetime.utcfromtimestamp(parsed),
- datetime(1994, 11, 06, 8, 49, 37))
+ datetime(1994, 11, 6, 8, 49, 37))
def testParsingAsctime(self):
parsed = parse_http_date('Sun Nov 6 08:49:37 1994')
self.assertEqual(datetime.utcfromtimestamp(parsed),
- datetime(1994, 11, 06, 8, 49, 37))
+ datetime(1994, 11, 6, 8, 49, 37))
diff --git a/tests/regressiontests/file_storage/tests.py b/tests/regressiontests/file_storage/tests.py
index 51b2207867..31e33d915c 100644
--- a/tests/regressiontests/file_storage/tests.py
+++ b/tests/regressiontests/file_storage/tests.py
@@ -424,7 +424,7 @@ class FileSaveRaceConditionTest(unittest.TestCase):
class FileStoragePermissions(unittest.TestCase):
def setUp(self):
self.old_perms = settings.FILE_UPLOAD_PERMISSIONS
- settings.FILE_UPLOAD_PERMISSIONS = 0666
+ settings.FILE_UPLOAD_PERMISSIONS = 0o666
self.storage_dir = tempfile.mkdtemp()
self.storage = FileSystemStorage(self.storage_dir)
@@ -434,8 +434,8 @@ class FileStoragePermissions(unittest.TestCase):
def test_file_upload_permissions(self):
name = self.storage.save("the_file", ContentFile(b"data"))
- actual_mode = os.stat(self.storage.path(name))[0] & 0777
- self.assertEqual(actual_mode, 0666)
+ actual_mode = os.stat(self.storage.path(name))[0] & 0o777
+ self.assertEqual(actual_mode, 0o666)
class FileStoragePathParsing(unittest.TestCase):
diff --git a/tests/regressiontests/file_uploads/tests.py b/tests/regressiontests/file_uploads/tests.py
index a7424639b4..9fe3ca15a7 100644
--- a/tests/regressiontests/file_uploads/tests.py
+++ b/tests/regressiontests/file_uploads/tests.py
@@ -362,16 +362,16 @@ class DirectoryCreationTests(unittest.TestCase):
if not os.path.isdir(temp_storage.location):
os.makedirs(temp_storage.location)
if os.path.isdir(UPLOAD_TO):
- os.chmod(UPLOAD_TO, 0700)
+ os.chmod(UPLOAD_TO, 0o700)
shutil.rmtree(UPLOAD_TO)
def tearDown(self):
- os.chmod(temp_storage.location, 0700)
+ os.chmod(temp_storage.location, 0o700)
shutil.rmtree(temp_storage.location)
def test_readonly_root(self):
"""Permission errors are not swallowed"""
- os.chmod(temp_storage.location, 0500)
+ os.chmod(temp_storage.location, 0o500)
try:
self.obj.testfile.save('foo.txt', SimpleUploadedFile('foo.txt', b'x'))
except OSError as err: