Open Bug 1885707 Opened 1 year ago Updated 1 year ago

UnicodeEncodeError: 'ascii' codec can't encode character '\xe5' in position 27: ordinal not in range(128)

Categories

(Testing :: mozregression, defect, P3)

defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: s.mikael.hkansson, Assigned: zeid)

References

Details

Attachments

(1 file)

50 bytes, text/x-github-pull-request
Details | Review

Steps to reproduce:

  1. Install mozregression-gui-signed.exe
  2. Run program

Actual results:

Crash Dialog

platform: Windows-10-10.0.22631-SP0
python: 3.10.11 FROZEN (64bit)
mozregression: 6.0.2
message: UnicodeEncodeError: 'ascii' codec can't encode character '\xe5' in position 27: ordinal not in range(128)
traceback: File "mozregression-gui.py", line 6, in <module>
File "mozregui\main.py", line 35, in main
File "mozregui\global_prefs.py", line 66, in set_default_prefs
File "mozregui\global_prefs.py", line 57, in save_prefs
File "configobj_init_.py", line 2117, in write

Expected results:

No crash.

The severity field is not set for this bug.
:zeid, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(zeid)

I believe this is most likely due to your home directory path containing a unicode character (possibly å), and most likely the default "persist" directory is based on that directory and is stored in the conf file. One possible workaround is to manually set the persist directory to something else in that file (it should be in ~/.mozilla/mozregression/mozregression.cfg and is the persist value).

Severity: -- → S3
Flags: needinfo?(zeid)
Priority: -- → P3

Mikael -- can you try the workaround to see if it helps? If the file does not exist, you can create it and add a specific path to the persist value, e.g.

persist = C:\tmp\mozregression_persist
Flags: needinfo?(s.mikael.hkansson)

Yes, there's an å in the account name, and the workaround works.

Now I can get back to bug hunting, thanks.

Flags: needinfo?(s.mikael.hkansson)

After the workaround it's possible to change the persist back into the account folder with the å without problems.

(In reply to Mikael Håkansson from comment #5)

After the workaround it's possible to change the persist back into the account folder with the å without problems.

Thanks for that bit of additional info.

It might pop back up when something else has to be changed or rewritten in the config file, I think there is a fix for this by changing the way that the ConfigObj object is instantiated. Will look into it later for a more permanent fix.

Attached file GitHub Pull Request
Assignee: nobody → zeid
Duplicate of this bug: 1904276

I tested 6.2.2 with the comment 7 changeset applied, but this problem still reproduced on Win11 x86_64.

Takanori -- I am curious if deleting the "persist" line in the config file (see comment 2) and retrying helps with this?

Flags: needinfo?(t.matsuu)

I am using the home directory of "C:\Users\(My Name which have four Japanese kanji characters and no ascii characters)" such as C:\Users\火狐火狐.

Steps to reproduce 1:

  1. Remove the ~/.mozilla/mozregression directory
  2. Uninstall mozregression using the uninstaller
  3. Reinstall mozregression
  4. Run mozregression

Actual result 1:
mozregression does not start with the above error message.

Steps to reproduce 2:

  1. Add a persist line to the file ~/.mozilla/mozregression/mozregression.cfg that contains the directory name including UTF-8.
  2. Run mozregression

Actual result 2:
mozregression starts properly.

Steps to reproduce 3:

  1. Add a persist line to the file ~/.mozilla/mozregression/mozregression.cfg that contains the directory name including UTF-8.
  2. Run mozregression
  3. "File -> Preferences"
  4. Click "OK"

Actual result 3:
mozregression failed to write config with the above error message.

So I suppose we should fix not write_config in config.py but save_prefs in global_prefs.py.

Flags: needinfo?(t.matsuu)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: