GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-23894: Make rb'' strings work in lib2to3 by ambv · Pull Request #1724 · python/cpython

Conversation

@ambv

@ambv ambv commented May 22, 2017

Copy link
Copy Markdown
Contributor

This partially solves bpo-23894. A separate PR coming later to support f-strings.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ambv ambv added type-bug An unexpected behavior, bug, or error needs backport to 3.6 labels May 22, 2017
@ambv
ambv requested a review from ned-deily May 22, 2017 18:46
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label May 22, 2017
@ambv ambv changed the title Make rb'' strings work in lib2to3 bpo-23894: Make rb'' strings work in lib2to3 May 22, 2017
@ambv
ambv force-pushed the bpo-23894-rb branch 2 times, most recently from 76b0e9d to d330004 Compare May 22, 2017 19:04
ambv
ambv commented May 22, 2017
View reviewed changes
Comment thread Lib/lib2to3/pgen2/tokenize.py Outdated

@ambv ambv May 22, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"String" didn't previously include b but this is suspicious to me. Why wouldn't it? That way b'' literals were only PseudoTokens (via ContStr), not actual Tokens (via String).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@gvanrossum gvanrossum May 22, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ned-deily
ned-deily approved these changes May 22, 2017
View reviewed changes

@ned-deily ned-deily left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the test: LGTM. As far as the tokenizer changes, I'm not familiar enough with lib2to3 to provide a useful review. Assuming other reviewers have no objections, I'm fine for this going into 3.6.2rc.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ambv

ambv commented May 22, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Tests are failing because I used an f-string in the test and lib2to3 is parsing that test file as part of fixers. f-strings are not supported yet in lib2to3. Switching to using a classic str.format fixes it. I'm updating the PR now.

UPDATE: as expected, tests pass now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Lukasz Langa
Make rb'' strings work in lib2to3
006c88d
This partially solves bpo-23894.
@ambv
ambv force-pushed the bpo-23894-rb branch from d330004 to 006c88d Compare May 22, 2017 19:41
@ambv
ambv requested review from gvanrossum and vstinner May 22, 2017 19:42
@ambv
ambv merged commit 0c4aca5 into python:master May 22, 2017
ambv added a commit to ambv/cpython that referenced this pull request May 22, 2017
@ambv Lukasz Langa
[3.6] Make rb'' strings work in lib2to3 (pythonGH-1724)
b2c5e99
This partially solves bpo-23894.
(cherry picked from commit 0c4aca5)
ambv added a commit that referenced this pull request May 22, 2017
@ambv
[3.6] Make rb'' strings work in lib2to3 (GH-1724) (#1730)
1398b1b
This partially solves bpo-23894.
(cherry picked from commit 0c4aca5)
@vstinner

vstinner commented May 23, 2017

Copy link
Copy Markdown
Member

I was requested for a review, but after I completed my review, I see that the change was already merged :-D It's fine, don't worry. I just want to give my post-commit LGTM! Nice change. Thanks @ambv for taking care of 2to3 ;-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Mariatta Mariatta removed the needs backport to 3.6 label May 30, 2017
@jstasiak jstasiak mentioned this pull request Jul 17, 2017
bpo-27494: Fix a 2to3 parser bug (trailing comma) #60
Closed
@ambv
ambv deleted the bpo-23894-rb branch July 12, 2021 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ned-deily ned-deily ned-deily approved these changes
@vstinner vstinner Awaiting requested review from vstinner
@gvanrossum gvanrossum Awaiting requested review from gvanrossum

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@ambv @vstinner @gvanrossum @ned-deily @Mariatta @the-knights-who-say-ni
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.