Opened 10 years ago

Closed 10 years ago

#8000 closed defect (fixed)

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

Reported by: mpatel Owned by: was
Priority: major Milestone: sage-4.3.2
Component: notebook Keywords:
Cc: timdumol, mvngu Merged in: sagenb-0.7
Authors: Tim Dumol Reviewers: Mitesh Patel
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by mpatel)

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.

Attachments (3)

trac_8000-utf-8-coding-directive.patch (17.7 KB) - added by timdumol 10 years ago.
This adds the coding directive
trac_8000-utf-8-coding-directive.2.patch (15.7 KB) - added by mpatel 10 years ago.
Fix failed doctest. Replaces previous. sagenb repo.
trac_8000-utf-8-coding-directive.3.patch (15.8 KB) - added by mpatel 10 years ago.
Rebased for SageNB 0.6 + queue in comment. Replaces previous.

Download all attachments as: .zip

Change History (13)

comment:1 follow-ups: Changed 10 years ago by mpatel

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

comment:2 in reply to: ↑ 1 Changed 10 years ago by mpatel

Replying to mpatel:

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.

comment:3 in reply to: ↑ 1 Changed 10 years ago by mvngu

Replying to mpatel:

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.

comment:4 Changed 10 years ago by mpatel

  • Description modified (diff)

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

comment:5 follow-up: Changed 10 years ago by mpatel

Perhaps a different coding slipped in?

comment:6 in reply to: ↑ 5 Changed 10 years ago by mpatel

Replying to mpatel:

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""").

Changed 10 years ago by timdumol

This adds the coding directive

comment:7 follow-up: Changed 10 years ago by timdumol

  • Authors set to Tim Dumol
  • Status changed from new to needs_review

This patch should do the trick.

comment:8 in reply to: ↑ 7 Changed 10 years ago by mpatel

  • Reviewers set to Mitesh Patel
  • Status changed from needs_review to positive_review

Replying to timdumol:

This patch should do the trick.

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

Changed 10 years ago by mpatel

Fix failed doctest. Replaces previous. sagenb repo.

Changed 10 years ago by mpatel

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

comment:9 Changed 10 years ago by mpatel

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

comment:10 Changed 10 years ago by mpatel

  • Merged in set to sagenb-0.7
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.