Fix FileNotFoundError when comparing existing profile image (LP: #1771629)

This commit is contained in:
Sean Davis 2018-08-06 06:39:02 -04:00
parent 051a20fb4e
commit b6feef0e1e
2 changed files with 18 additions and 15 deletions

View File

@ -257,9 +257,12 @@ class MugshotWindow(Window):
logger.debug('Found profile image: %s' % str(image)) logger.debug('Found profile image: %s' % str(image))
if os.path.isfile(face): if os.path.isfile(face):
if os.path.samefile(image, face): try:
self.updated_image = face if os.path.samefile(image, face):
else: self.updated_image = face
else:
self.updated_image = None
except FileNotFoundError:
self.updated_image = None self.updated_image = None
self.set_user_image(face) self.set_user_image(face)
elif os.path.isfile(image): elif os.path.isfile(image):

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-06 06:10-0400\n" "POT-Creation-Date: 2018-08-06 06:37-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -61,7 +61,7 @@ msgstr ""
msgid "Browse…" msgid "Browse…"
msgstr "" msgstr ""
#: ../data/ui/MugshotWindow.ui.h:9 ../mugshot/MugshotWindow.py:566 #: ../data/ui/MugshotWindow.ui.h:9 ../mugshot/MugshotWindow.py:569
msgid "Mugshot" msgid "Mugshot"
msgstr "" msgstr ""
@ -107,45 +107,45 @@ msgstr ""
msgid "Retry" msgid "Retry"
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:343 #: ../mugshot/MugshotWindow.py:346
msgid "Authentication cancelled." msgid "Authentication cancelled."
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:346 #: ../mugshot/MugshotWindow.py:349
msgid "Authentication failed." msgid "Authentication failed."
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:349 #: ../mugshot/MugshotWindow.py:352
msgid "An error occurred when saving changes." msgid "An error occurred when saving changes."
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:351 #: ../mugshot/MugshotWindow.py:354
msgid "User details were not updated." msgid "User details were not updated."
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:453 #: ../mugshot/MugshotWindow.py:456
msgid "Update Pidgin buddy icon?" msgid "Update Pidgin buddy icon?"
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:454 #: ../mugshot/MugshotWindow.py:457
msgid "Would you also like to update your Pidgin buddy icon?" msgid "Would you also like to update your Pidgin buddy icon?"
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:567 #: ../mugshot/MugshotWindow.py:570
msgid "Enter your password to change user details." msgid "Enter your password to change user details."
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:569 #: ../mugshot/MugshotWindow.py:572
msgid "" msgid ""
"This is a security measure to prevent unwanted updates\n" "This is a security measure to prevent unwanted updates\n"
"to your personal information." "to your personal information."
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:829 #: ../mugshot/MugshotWindow.py:832
msgid "Update LibreOffice user details?" msgid "Update LibreOffice user details?"
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:830 #: ../mugshot/MugshotWindow.py:833
msgid "Would you also like to update your user details in LibreOffice?" msgid "Would you also like to update your user details in LibreOffice?"
msgstr "" msgstr ""