Closed Bug 1027501 Opened 10 years ago Closed 10 years ago

print-manifest-dirs.py run-time error: UnboundLocalError: local variable 'testURLs' referenced before assignment

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1027215

People

(Reporter: u459114, Assigned: u459114)

Details

Attachments

(1 file, 4 obsolete files)

Refer to error log:
https://tbpl.mozilla.org/php/getParsedLog.php?id=42022083&tree=Try&full=1#error0
  UnboundLocalError: local variable 'testURLs' referenced before assignment

Source code:
http://dxr.mozilla.org/mozilla-central/source/layout/tools/reftest/print-manifest-dirs.py
If all the conditions between #41~#51 do not match, using testURLs at #53 issues an UnboundLocalError error.

PS
Not quite sure whether this bug belongs to gfx, but since I found it while debugging a gfx issue, assign this as Graphic bug first.
According to bug 1000722 comment 35, we may improve error handling in parseManifest here.
"<<<<<<< local" is a string that parseManifest does not expect.
Assignee: nobody → cku
We might add an "else" statement before "for u in testURLs:", and raise an customized exception such as ManifestParseError to print file name, line number, and the content of that line.
Attached patch bug_1027501 (obsolete) — Splinter Review
Comment on attachment 8442701 [details] [diff] [review]
bug_1027501

Review of attachment 8442701 [details] [diff] [review]:
-----------------------------------------------------------------

Hi TY,
How about this one?
Attachment #8442701 - Flags: feedback?(tlin)
Comment on attachment 8442701 [details] [diff] [review]
bug_1027501

Review of attachment 8442701 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/tools/reftest/print-manifest-dirs.py
@@ +49,5 @@
>      elif items[0] == "load" or items[0] == "script":
>        testURLs = [items[1]]
>      elif items[0] == "==" or items[0] == "!=":
>        testURLs = items[1:3]
> +    else

Syntax error. It should be "else:"
Attachment #8442701 - Flags: feedback?(tlin) → feedback-
Attached patch bug_1027501 (obsolete) — Splinter Review
Oops...grammar error
Attachment #8442701 - Attachment is obsolete: true
Attachment #8442719 - Flags: feedback?(tlin)
Attachment #8442719 - Attachment is patch: true
Attached patch bug_1027501 (obsolete) — Splinter Review
Attachment #8442719 - Attachment is obsolete: true
Attachment #8442719 - Flags: feedback?(tlin)
Attachment #8442723 - Flags: feedback?(tlin)
Comment on attachment 8442723 [details] [diff] [review]
bug_1027501

Review of attachment 8442723 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me. However, the patch does not have a e-mail address.
Attachment #8442723 - Flags: feedback?(tlin) → feedback+
Attachment #8442723 - Attachment is obsolete: true
Attachment #8442727 - Attachment is obsolete: true
Comment on attachment 8442728 [details] [diff] [review]
Print error message while input string syntax is not right

Hi dbaron,
Please help to review this patch, thanks
Attachment #8442728 - Flags: review?(dbaron)
Attachment #8442728 - Flags: review?(dbaron) → review?(ted)
It seems gps is going to rewrite print-manifest-dirs.py in bug 1027215. I hope the new version will have better error handling.
Yes, I saw you comment in attachment 8442961 [details] [diff] [review]. Close this one
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: