Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1217610 - UnicodeDecodeError when entering encryption passphrase in language other than English on live install
Summary: UnicodeDecodeError when entering encryption passphrase in language other than...
Keywords:
Status: CLOSED DUPLICATE of bug 1217504
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 22
Hardware: All
OS: All
unspecified
urgent
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedBlocker
Depends On:
Blocks: F22FinalBlocker
TreeView+ depends on / blocked
 
Reported: 2015-04-30 19:38 UTC by Adam Williamson (Fedora)
Modified: 2015-05-06 14:21 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-05-06 14:21:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1169019 0 unspecified CLOSED UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 11: ordinal not in range(128) 2022-05-16 11:32:56 UTC

Internal Links: 1169019

Description Adam Williamson (Fedora) 2015-04-30 19:38:17 UTC
To reproduce: install in any language other than English (I tested with French but I think it affects all cases where translation kicks in) and choose to encrypt the install. Once the encryption passphrase dialog pops up, start typing. Cue crash. Traceback:

Traceback (most recent call first):
  File "/usr/lib64/python2.7/site-packages/pyanaconda/ui/gui/spokes/lib/passphrase.py", line 171, in _checkStrength
    return ("dialog-error", _(ERROR_WEAK) % self._pwq_error)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/ui/helpers.py", line 250, in update_check_status
    new_check_status = self._run_check(self)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/ui/gui/helpers.py", line 42, in _update_check_status
    inputcheck.update_check_status()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 42: ordinal not in range(128)

This is related to the infamous https://bugzilla.redhat.com/show_bug.cgi?id=1169019 and https://bugzilla.redhat.com/show_bug.cgi?id=1209563 (fun with locales and encodings in the live environment).

Proposing as a Final blocker: "The installer must correctly display all sufficiently complete translations available for use." , https://fedoraproject.org/wiki/Fedora_22_Final_Release_Criteria#Installer_translations (alternatively, any of the 'complete an install' criteria in the case that the install is live and in something other than English).

Comment 1 Adam Williamson (Fedora) 2015-04-30 20:40:08 UTC
We've tested that this fixes it:

[adamw@adam anaconda (f22-branch %)]$ git diff
diff --git a/pyanaconda/ui/gui/spokes/lib/passphrase.py b/pyanaconda/ui/gui/spokes/lib/passphrase.py
index c104194..2f49fcd 100644
--- a/pyanaconda/ui/gui/spokes/lib/passphrase.py
+++ b/pyanaconda/ui/gui/spokes/lib/passphrase.py
@@ -168,7 +168,7 @@ class PassphraseDialog(GUIObject, GUIInputCheckHandler):
 
     def _checkStrength(self, inputcheck):
         if self._pwq_error:
-            return ("dialog-error", _(ERROR_WEAK) % self._pwq_error)
+            return ("dialog-error", _(ERROR_WEAK).encode('utf-8') % self._pwq_error)
         else:
             return InputCheck.CHECK_OK
 

there are likely other cases, though. I would think that any time we use a %s substitution into a translated string and the translation has non-ASCII characters in it would fail, but that doesn't actually seem to be the case: I tested a few others (like "error = _("%s cannot be encrypted") % mountpoint" in custom.py and "return _(PASSWORD_WEAK_WITH_ERROR) % (self._pwq_error, done_msg)" in password.py) and they didn't cause crashes. IIRC there's some kind of wrinkle involved where Python *does* somehow know to use utf-8 in some cases but not others, but I'm not sure we ever fully traced that out.

Comment 2 Adam Williamson (Fedora) 2015-04-30 20:48:41 UTC
See also https://bugs.python.org/issue9196 - apparently the behaviour of %s as it relates to unicode objects is...unclear (and I'm not sure why it fails in this case, given the information from that bug - perhaps something odd about pwquality.PWQError objects?)

Comment 3 Dan Mossor [danofsatx] 2015-05-04 16:39:40 UTC
Discussed at the 2015-05-04 blocker review meeting.[0] Voted as AcceptedBlocker based on different criteria as cited in Comment #1.

AcceptedBlocker - violates "When using the guided partitioning flow, the installer must be able to:  ...  Complete an installation using any combination of disk configuration options it allows the user to select" for live, non-English installs

[0] http://meetbot.fedoraproject.org/meetbot/fedora-blocker-review/2015-05-04/f22-blocker-review.2015-05-04-16.00.log.txt

Comment 4 David Shea 2015-05-06 14:21:04 UTC

*** This bug has been marked as a duplicate of bug 1217504 ***


Note You need to log in before you can comment on or make changes to this bug.