Bytes b"" prefix for string literals not preserved in round trip

brianm avatarbrianm created an issue

When translating a byte object literal (ie b"some string"), it is becoming a plain string literal with no prefix ("some string"). While this is equivalent in python2, it loses information in a round-trip, becoming a unicode string if translated back with 2to3.

Comments (1)

  1. Joe Amenta

    Thanks for the bug report, but I'm going to have to mark this one "wontfix".

    The round-trip journey, while fun to play with in Translation Party, is not an intended use of 3to2. Rather, 3to2 is just supposed to generate throwaway Python2 code that works after one conversion, but shouldn't really be modified afterwards. Otherwise, "simple" fixes like this one would have to be much more complicated, perhaps storing metadata along with the generated code. It's just a coincidence that in most cases, the code is ready to make another journey through after being 2to3-ified.

    Again, thanks for the bug report, and please don't let this discourage future ones!

    --Joe

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.