Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switched to Python 3-compatible octal notation.

  • Loading branch information...
commit 324d48d0a7de895aeb7397cd3365ab03ac7f6724 1 parent 85cd458
Aymeric Augustin aaugustin authored
2  django/utils/daemonize.py
View
@@ -3,7 +3,7 @@
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:
6 tests/regressiontests/conditional_processing/models.py
View
@@ -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))
6 tests/regressiontests/file_storage/tests.py
View
@@ -424,7 +424,7 @@ def test_race_condition(self):
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 @@ def tearDown(self):
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):
6 tests/regressiontests/file_uploads/tests.py
View
@@ -362,16 +362,16 @@ def setUp(self):
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:
Please sign in to comment.
Something went wrong with that request. Please try again.