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

Add # -*- coding: utf-8 -*- to the top of all SageNB .py files #8000

Closed
qed777 mannequin opened this issue Jan 19, 2010 · 16 comments
Closed

Add # -*- coding: utf-8 -*- to the top of all SageNB .py files #8000

qed777 mannequin opened this issue Jan 19, 2010 · 16 comments

Comments

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 19, 2010

Adding the pragma now to all Python files in SageNB may prevent some of the increasingly common docbuild errors raised when we build the reference manual.

CC: @TimDumol @sagetrac-mvngu

Component: notebook

Author: Tim Dumol

Reviewer: Mitesh Patel

Merged: sagenb-0.7

Issue created by migration from https://trac.sagemath.org/ticket/8000

@qed777 qed777 mannequin added this to the sage-4.3.2 milestone Jan 19, 2010
@qed777 qed777 mannequin added c: user interface labels Jan 19, 2010
@qed777 qed777 mannequin assigned williamstein Jan 19, 2010
@qed777
Copy link
Mannequin Author

qed777 mannequin commented Jan 19, 2010

comment:1

Minh -- Is this OK? Shall we make another ticket to update the whole Sage library?

@qed777
Copy link
Mannequin Author

qed777 mannequin commented Jan 19, 2010

comment:2

Replying to @qed777:

Minh -- Is this OK? Shall we make another ticket to update the whole Sage library?

In particular, post-#7249, we've got non-ASCII Unicode characters in doctests.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jan 19, 2010

comment:3

Replying to @qed777:

Minh -- Is this OK? Shall we make another ticket to update the whole Sage library?

I'm not sure about this, although I can clearly see the benefit of it. On the one hand, this could be further discouragement to people who want to start with Sage development. Could you send an email to sage-devel polling people about this issue? I mean something along the line of, "Should each source file have the character encoding preamble # -- coding: utf-8 -- ?". Also see #7999 relating to one file in the Sage library.

@qed777

This comment has been minimized.

@qed777
Copy link
Mannequin Author

qed777 mannequin commented Jan 19, 2010

comment:4

Actually, it seems that # -*- coding: utf-8 -*- was already at the top of worksheet.py.

@qed777
Copy link
Mannequin Author

qed777 mannequin commented Jan 19, 2010

comment:5

Perhaps a different coding slipped in?

@qed777
Copy link
Mannequin Author

qed777 mannequin commented Jan 19, 2010

comment:6

Replying to @qed777:

Perhaps a different coding slipped in?

It turns out that we could fix this problem (cf. #7249) by making the docstring a unicode or raw string (e.g., """ --> u""" or r""").

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jan 19, 2010

This adds the coding directive

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jan 19, 2010

comment:7

Attachment: trac_8000-utf-8-coding-directive.patch.gz

This patch should do the trick.

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jan 19, 2010

Author: Tim Dumol

@TimDumol TimDumol mannequin added the s: needs review label Jan 19, 2010
@qed777
Copy link
Mannequin Author

qed777 mannequin commented Jan 20, 2010

comment:8

Replying to @TimDumol:

This patch should do the trick.

It does, indeed. V2 also fixes a failed doctest in sagenb.misc.sageinspect.

@qed777
Copy link
Mannequin Author

qed777 mannequin commented Jan 20, 2010

Reviewer: Mitesh Patel

@qed777
Copy link
Mannequin Author

qed777 mannequin commented Jan 20, 2010

Fix failed doctest. Replaces previous. sagenb repo.

@qed777
Copy link
Mannequin Author

qed777 mannequin commented Jan 25, 2010

Attachment: trac_8000-utf-8-coding-directive.2.patch.gz

Attachment: trac_8000-utf-8-coding-directive.3.patch.gz

Rebased for SageNB 0.6 + queue in comment. Replaces previous.

@qed777
Copy link
Mannequin Author

qed777 mannequin commented Jan 25, 2010

comment:9

V3 is rebased for this queue (patch version numbers may be off by one):

sagenb-0.6
trac_7249-jinja2_v9.5.patch
trac_7962-link-worksheets-zip-file.patch
trac_7969-escaped-backslash.patch
trac_4217-html-system-formatting.3.patch
trac_3083-print-documentation.5.patch
trac_6182-double-quotes-ws.2.patch
trac_5263-publish-url.patch
trac_7631-republish-name.patch
trac_6353-cookies-diff-ports.patch
trac_7207-sagenb-future-import.3.patch
trac_8000-utf-8-coding-directive.2.patch

@qed777
Copy link
Mannequin Author

qed777 mannequin commented Jan 25, 2010

Merged: sagenb-0.7

@qed777 qed777 mannequin removed the s: positive review label Jan 25, 2010
@qed777 qed777 mannequin closed this as completed Jan 25, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant