Closed Bug 1575135 Opened 2 years ago Closed 2 years ago

Only allow Unicode strings out of the python configure sandbox


(Firefox Build System :: General, task)

Not set


(firefox70 fixed)

Tracking Status
firefox70 --- fixed


(Reporter: glandium, Assigned: glandium)




(8 files, 1 obsolete file)

No description provided.

It only happens when things go badly, which is why it doesn't cause
problems, but when moving things around, triggering the error, we
currently get a formatting error rather than the actual error.

Because most calling places in python configure don't actually want to
deal with encodings, although in practical terms they should, make
get_cmd_output handle it itself.

Places that explicitly do want bytes can keep using subprocess directly.

As a consequence, we can replace the encoded_open function that did the
same in an opt-in manner.

Make it a hard error when the sandbox returns non-unicode strings.
This should help quickly catch any remaining non-unicode string that
are not caught by automation.

The configure sandbox has wrapped subprocess methods to do it since
bug 1520394.

Blocks: 844509
Attachment #9086596 - Attachment description: Bug 1575135 - Don't encode environment in get_cmd_output. → Bug 1575135 - Don't encode environment in get_cmd_output and old_configure.
Attachment #9086596 - Attachment is obsolete: true
Pushed by
Remove unused subprocess imports. r=nalexander
Define whether the system encoding is mbcs or utf-8 once. r=nalexander
Fix mock_pkg_config failure case. r=nalexander
Use functions from util.configure instead of subprocess.*. r=nalexander
Change get_cmd_output to emit unicode strings. r=nalexander
Make configure sandbox open() look more like python 3's. r=nalexander
Return an unicode path for nodejs. r=nalexander
Make configure complain on non-unicode strings. r=nalexander
Regressions: 1575804
Regressions: 1580533
Regressions: 1595995
You need to log in before you can comment on or make changes to this bug.