Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Fix UnicodeDecodeError for user names with non-ascii characters #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python/tk_multi_workfiles/file_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def format_published_by_details(self):
details_str += "Published on: <i>Unknown</i>"
details_str += "<br>"
if self.published_by and "name" in self.published_by:
details_str += ("Published by %s" % self.published_by["name"])
details_str += ("Published by %s" % self.published_by["name"].decode("utf-8"))
else:
details_str += "Published by: <i>Unknown</i>"
return details_str
Expand All @@ -184,7 +184,7 @@ def format_modified_by_details(self):
details_str += "Last updated: <i>Unknown</i>"
details_str += "<br>"
if self.modified_by and "name" in self.modified_by:
details_str += ("Updated by %s" % self.modified_by["name"])
details_str += ("Updated by %s" % self.modified_by["name"].decode("utf-8"))
else:
details_str += "Updated by: <i>Unknown</i>"
return details_str
Expand All @@ -195,7 +195,7 @@ def format_publish_description(self):
in UI elements
"""
if self.publish_description:
return ("%s" % self.publish_description)
return ("%s" % self.publish_description.decode("utf-8"))
else:
return "<i>No description was entered for this publish</i>"

Expand Down
9 changes: 9 additions & 0 deletions python/tk_multi_workfiles/versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ def _show_change_version_dlg(self):
if not work_path or not self._work_template.validate(work_path):
msg = ("Unable to Change Version!\n\nPlease save the scene as a valid work file before continuing")
QtGui.QMessageBox.information(None, "Unable To Change Version!", msg)
# current scene path must match work template and contain version:

# try to launch "Shotgun Save As" command if we have it:
save_as_cmd = tank.platform.current_engine().commands.get("Shotgun Save As...")
if not save_as_cmd:
# try old name, just in case
save_as_cmd = tank.platform.current_engine().commands.get("Tank Save As...")
if save_as_cmd:
save_as_cmd["callback"]()
return

if not "version" in self._work_template.keys:
Expand Down