Opened 4 years ago

Closed 4 years ago

#18492 closed defect (fixed)

sage's setup.py breaks on python 3

Reported by: ohanar Owned by:
Priority: major Milestone: sage-6.8
Component: build Keywords:
Cc: Merged in:
Authors: R. Andrew Ohana Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: 208f751 (Commits) Commit: 208f7516c794d42f94a05f2edaeb44737167b42b
Dependencies: Stopgaps:

Description

Mostly trivially.

Change History (15)

comment:1 Changed 4 years ago by ohanar

  • Status changed from new to needs_review

comment:2 Changed 4 years ago by jdemeyer

  • Status changed from needs_review to needs_work

six should be mentioned as dependency of sage in build/deps.

comment:3 follow-up: Changed 4 years ago by jdemeyer

Isn't there a Python-3 equivalent of

sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)

Changing the print statement is not equivalent to changing stdout.

comment:4 in reply to: ↑ 3 Changed 4 years ago by ohanar

Replying to jdemeyer:

Isn't there a Python-3 equivalent of

sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)

Changing the print statement is not equivalent to changing stdout.

I agree, but no there isn't a python 3 equivalent: python 3 requires sys.stdout to be buffered, unless you start python with the -u (but you can also do that with python 2).

comment:5 follow-up: Changed 4 years ago by jdemeyer

Not sure, but isn't there something possible with sys.stdout.buffer in Python 3?

comment:6 in reply to: ↑ 5 Changed 4 years ago by ohanar

Replying to jdemeyer:

Not sure, but isn't there something possible with sys.stdout.buffer in Python 3?

It allows you to write bytes to stdout: sys.stdout.buffer is a BytesIO interface to stdout, whereas sys.stdout is a StringIO interface to stdout.

comment:7 Changed 4 years ago by git

  • Commit changed from cd33340d6aa67576520e644987bc369fcbefea1e to 2c9f70be2399489450250e5c166449e349d88882

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

e3e563dadd six as a build dependency of sage
2c9f70bpass -u to sage's setup.py for unbuffered output

comment:8 Changed 4 years ago by ohanar

  • Status changed from needs_work to needs_review

comment:9 Changed 4 years ago by git

  • Commit changed from 2c9f70be2399489450250e5c166449e349d88882 to 6b854d92b8e6e0ef2b802b5b17cb23a7e1fd7963

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

d448c95add six as a build dependency of sage
6b854d9pass -u to sage's setup.py for unbuffered output

comment:10 Changed 4 years ago by jdemeyer

  • Reviewers set to Jeroen Demeyer
  • Status changed from needs_review to positive_review

Assuming that you actually tested this, positive_review since the diff looks good.

comment:11 Changed 4 years ago by vbraun

  • Status changed from positive_review to needs_work

Apparently you haven't actually (doc-)tested it ;-)

comment:12 Changed 4 years ago by git

  • Commit changed from 6b854d92b8e6e0ef2b802b5b17cb23a7e1fd7963 to 208f7516c794d42f94a05f2edaeb44737167b42b

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

297dff6fix sage.env
208f751git fix sage_setup.autogen.interpeters

comment:13 Changed 4 years ago by ohanar

  • Status changed from needs_work to needs_review

Little hard to doctest on python 3 at the moment :)

comment:14 Changed 4 years ago by jdemeyer

  • Status changed from needs_review to positive_review

comment:15 Changed 4 years ago by vbraun

  • Branch changed from u/ohanar/python3setuppy to 208f7516c794d42f94a05f2edaeb44737167b42b
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.