Skip to content

Conversation

@dancinglightning
Copy link

@dancinglightning dancinglightning commented Aug 25, 2021

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@dancinglightning

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!


Another is to add a blank character before the quote and then remove it::

>>> fn = r'C:\this\will\work\ '.strip()
Copy link

@Julian Julian Aug 25, 2021

Choose a reason for hiding this comment

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

Personally I wouldn't mention this one -- it adds a runtime cost if it's inside some loop or function call, which on its own isn't a huge deal, but it also means you get unexpected behavior if you don't fully realize what this does and try it on r' foo bar \ baz quux\ .

I'd personally leave things with the last workaround (and not mention there are multiple), but if another workaround is desired, using two string literals with the terminal slash in a second one implicitly concatenated is the next-best-one to me:

fn = r'C:\this\will\work' '\\'

Copy link
Author

@dancinglightning dancinglightning Aug 25, 2021

Choose a reason for hiding this comment

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

Yeah, I do agree it adds to the runtime but I am pretty sure that this piece of information can be invaluable and many times go unnoticed. I too faced difficulty in comprehending the issue when I got stuck with it. I was able to resolve it later by reading various discussions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants