Opened 5 years ago

Closed 5 years ago

#23475 closed enhancement (fixed)

py3: better handling of unicode repr in sage object

Reported by: chapoton Owned by:
Priority: major Milestone: sage-8.1
Component: python3 Keywords:
Cc: tscrim, jdemeyer, jhpalmieri Merged in:
Authors: Frédéric Chapoton Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: e0e3da9 (Commits, GitHub, GitLab) Commit: e0e3da958ad09ba387d658ef7f57a7517f1756dd
Dependencies: Stopgaps:

Status badges


do not encode if unicode when running python3

Change History (8)

comment:1 Changed 5 years ago by chapoton

  • Branch set to u/chapoton/23475
  • Commit set to 8be2de91164de1c588a7c2e91e45cacde5d22e91
  • Status changed from new to needs_review

New commits:

8be2de9py3: better handling of _repr_ in sage object

comment:2 Changed 5 years ago by chapoton

  • Cc tscrim jdemeyer jhpalmieri added

bot seems to be morally green..

comment:3 Changed 5 years ago by tscrim

Wouldn't it be easier just to check the major version number of Python?

            import sys
            if sys.version_info[0] < 3 and isinstance(result, unicode):
                # Py3 compatibility: allow _repr_ to return unicode
                return result.encode('utf-8')
                return result

comment:4 Changed 5 years ago by git

  • Commit changed from 8be2de91164de1c588a7c2e91e45cacde5d22e91 to e0e3da958ad09ba387d658ef7f57a7517f1756dd

Branch pushed to git repo; I updated commit sha1. New commits:

e0e3da9trac 23475 referee suggestion

comment:5 Changed 5 years ago by chapoton


comment:6 Changed 5 years ago by chapoton


comment:7 Changed 5 years ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review


comment:8 Changed 5 years ago by vbraun

  • Branch changed from u/chapoton/23475 to e0e3da958ad09ba387d658ef7f57a7517f1756dd
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.