Closed Bug 872503 Opened 13 years ago Closed 13 years ago

[B2G] UnicodeWarning when using mozdevice removeFile against Hamachi device

Categories

(Testing :: Mozbase, defect)

Other
Gonk (Firefox OS)
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: zcampbell, Assigned: wlach)

Details

Attachments

(1 file)

When the gaia-ui-tests suite uses mozdevice's removeFile method against the B2G Hamachi device an error message is shown. It still appears functional but the error message may hide some odd behaviour. In comparison this does not occur for other devices. The version of mozdevice in use is 0.25 ------- error message /home/zacdev/.virtualenvs/gaia-ui-27/local/lib/python2.7/site-packages/mozdevice/devicemanagerADB.py:237: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if (data[0].rstrip() == filepath):
What file is being removed?(In reply to Zac C (:zac) from comment #0) > When the gaia-ui-tests suite uses mozdevice's removeFile method against the > B2G Hamachi device an error message is shown. What is the name of the file being removed? A pointer to the line of code in gaia-ui-tests would also be helpful.
IIRC There were no files on the sdcard but I'll run this again this afternoon to confirm. (apologies the STR in this were a bit crap).
I found something on the SDCard with turkish characters (the SD card may have come from an Unagi devices). I wiped it and re-tried it and it seems fine. I also tried with a couple of other SD cards and they were fine too. Is there a bug or enhancement here in the handling of these scenarios? If not then just mark this as invalid. Thanks!
Flags: needinfo?(wlachance)
Ok, investigated this. I think the fileExists, etc. functions need to be changed to better support UTF-8. Patch is pretty trivial.
Flags: needinfo?(wlachance)
With this patch applied, the following program works as expected (both when the file does and does not exist): #!/usr/bin/env python # -*- coding: utf-8 -*- import mozdevice fname = u"/mnt/sdcard/¿Qué" d = mozdevice.DroidADB() print d.fileExists(fname)
Assignee: nobody → wlachance
Attachment #755026 - Flags: review?(ahalberstadt)
Comment on attachment 755026 [details] [diff] [review] Adjust devicemanagerADB's fileExists to support utf-8 encoded files Review of attachment 755026 [details] [diff] [review]: ----------------------------------------------------------------- Lgtm, thanks! I bet there are a lot of other places in devicemanager/mozbase that fall over on unicode. Might be a good topic for a mozbase work week if we end up having one.
Attachment #755026 - Flags: review?(ahalberstadt) → review+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: