This is an archive of the discontinued Mercurial Phabricator instance.

py3-discovery: using plain str in stats dict
ClosedPublic

Authored by gracinet on Oct 10 2019, 5:50 AM.

Details

Summary

rust-cpython converts automatically from Rust strings to
the appropriate str for the target Python version.

Insisting on discovery stats dict keys to be bytes hence breaks
the process (this is spotted by test-setdiscovery.t).

Now that byteify-strings has been run on the entire
codebase, and the import transformer is not there any more,
the simplest fix is to make the keys plain str again.

Another possible fix would be to forcefully convert to bytes in
rust-cpython code, but that feels less natural, and would probably
have to be reverted down the road.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

gracinet created this revision.Oct 10 2019, 5:50 AM
pulkit accepted this revision.Oct 10 2019, 9:21 AM
This revision is now accepted and ready to land.Oct 10 2019, 9:21 AM
This revision was automatically updated to reflect the committed changes.