Closed
Bug 872503
Opened 13 years ago
Closed 13 years ago
[B2G] UnicodeWarning when using mozdevice removeFile against Hamachi device
Categories
(Testing :: Mozbase, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: zcampbell, Assigned: wlach)
Details
Attachments
(1 file)
|
1.00 KB,
patch
|
ahal
:
review+
|
Details | Diff | Splinter Review |
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):
| Assignee | ||
Comment 1•13 years ago
|
||
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.
| Reporter | ||
Comment 2•13 years ago
|
||
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).
| Reporter | ||
Comment 3•13 years ago
|
||
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)
| Assignee | ||
Comment 4•13 years ago
|
||
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)
| Assignee | ||
Comment 5•13 years ago
|
||
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 6•13 years ago
|
||
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+
| Assignee | ||
Comment 7•13 years ago
|
||
This landed yesterday:
https://github.com/mozilla/mozbase/commit/f4f1a4d90fdbb8105c5a873566649637be3beea1
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.
Description
•