Skip to content

Commit

Permalink
More smart_text
Browse files Browse the repository at this point in the history
  • Loading branch information
palewire committed Dec 27, 2017
1 parent 6d80426 commit 7203e0b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bakery/management/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def build_static(self, *args, **options):
self.build_dir,
settings.STATIC_URL.lstrip('/')
)
target_dir = smart_text(target_dir)

if os.path.exists(self.static_root) and settings.STATIC_URL:
if getattr(settings, 'BAKERY_GZIP', False):
Expand Down Expand Up @@ -219,7 +220,7 @@ def build_media(self):
if os.path.exists(self.media_root) and settings.MEDIA_URL:
target_dir = path.join(self.fs_name, self.build_dir, settings.MEDIA_URL.lstrip('/'))
logger.debug("Copying {}{} to {}{}".format("osfs://", self.media_root, self.fs_name, target_dir))
copy.copy_dir("osfs:///", self.media_root, self.fs, target_dir)
copy.copy_dir("osfs:///", smart_text(self.media_root), self.fs, smart_text(target_dir))

def get_view_instance(self, view):
"""
Expand Down Expand Up @@ -304,7 +305,7 @@ def copyfile_and_gzip(self, source_path, target_path):
self.fs_name,
target_path
))
copy.copy_file("osfs:///", source_path, self.fs, target_path)
copy.copy_file("osfs:///", smart_text(source_path), self.fs, smart_text(target_path))

# # if the file is already gzipped
elif encoding == 'gzip':
Expand All @@ -314,7 +315,7 @@ def copyfile_and_gzip(self, source_path, target_path):
self.fs_name,
target_path
))
copy.copy_file("osfs:///", source_path, self.fs, target_path)
copy.copy_file("osfs:///", smart_text(source_path), self.fs, smart_text(target_path))

# If it is one we want to gzip...
else:
Expand Down

0 comments on commit 7203e0b

Please sign in to comment.