Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix syntax error #4994

Merged
merged 1 commit into from Aug 29, 2015
Merged

Fix syntax error #4994

merged 1 commit into from Aug 29, 2015

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Aug 26, 2015

Using \u, even in a raw string, is a syntax error when unicode_literals is on.

Using \u, even in a raw string, is a syntax error when
unicode_literals is on.
@WeatherGod
Copy link
Member

When did this become a syntax error?

@mdboom
Copy link
Member Author

mdboom commented Aug 26, 2015

Since the introduction of from __future__ import unicode_literals (Python
2.6, I believe). It is not a syntax error on Python 3.

On Wed, Aug 26, 2015 at 1:12 PM Benjamin Root notifications@github.com
wrote:

When did this become a syntax error?


Reply to this email directly or view it on GitHub
#4994 (comment)
.

@mdboom
Copy link
Member Author

mdboom commented Aug 26, 2015

And I should clarify -- \u is only a syntax error if it isn't followed by 4 hexadecimal digits...

@WeatherGod
Copy link
Member

ok, I'll rephrase... why haven't we noticed this?

@mdboom
Copy link
Member Author

mdboom commented Aug 26, 2015

This file was introduced on 2015-08-10, and the only symptom is that the file doesn't get installed, along with this message flashing by:

byte-compiling build/bdist.linux-x86_64/egg/matplotlib/tests/test_texmanager.py to test_texmanager.pyc
  File "build/bdist.linux-x86_64/egg/matplotlib/tests/test_texmanager.py", line 17
    plt.rcParams['text.latex.preamble'] = [r'\usepackage{txfonts}']
SyntaxError: (unicode error) 'rawunicodeescape' codec can't decode bytes in position 0-1: truncated \uXXXX

It means this test has never actually run.

@tacaswell
Copy link
Member

This should also be added to the whitelist of tests in __init__.py

@tacaswell tacaswell added this to the next point release milestone Aug 27, 2015
@tacaswell tacaswell merged commit 54c19f5 into matplotlib:master Aug 29, 2015
tacaswell added a commit that referenced this pull request Aug 29, 2015
Added a commit to white-list `test_texmanager`
@tacaswell
Copy link
Member

Added the test and merged locally.

@mdboom mdboom deleted the syntax-error branch November 10, 2015 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants