Closed Bug 1660288 Opened 4 years ago Closed 4 years ago

Lint hook broken after python updates

Categories

(Developer Infrastructure :: Lint and Formatting, defect, P2)

Tracking

(firefox81 fixed)

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: Gijs, Assigned: Gijs)

Details

Attachments

(1 file)

Commit produces:

  File "path/to/tools/lint/hooks.py", line 50, in hg
    return run_mozlint(hooktype, kwargs.get("pats", []))
  File "path/to/tools/lint/hooks.py", line 37, in run_mozlint
    if "commit" in hooktype:
TypeError: a bytes-like object is required, not 'str'

Mark or :ahal, do you know what this is about? I've had to disable the lint hook so I can commit...

Flags: needinfo?(standard8)
Flags: needinfo?(ahal)

Ah, likely you upgraded Mercurial to a version that uses Python 3 by default.

For context, Mercurial uses byte strings internally, which is the default string type with Python 2, but is incompatible with the default type in Python 3. I'm surprised it took this long for a bug be filed..

I'll add this to my queue (though I'm a bit swamped with the layoffs atm).

Severity: -- → S2
Flags: needinfo?(standard8)
Flags: needinfo?(ahal)
Priority: -- → P2
Assignee: nobody → ahal
Status: NEW → ASSIGNED

comment #1 is enough context that I think I can just fix this - thanks! I'll steal this and you can steal it back if my patch is rubbish. :-)

Assignee: ahal → gijskruitbosch+bugs
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/5f006849e5c5
fix python3 errors in the linter's hooks.py tripped when using python3-based mercurial, r=ahal
Pushed by rmaries@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/662ab7cde7da
Fixing the lint failure. CLOSED TREE
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: