Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#16442 closed enhancement (fixed)

Replace os.tmpfile by tempfile module

Reported by: aapitzsch Owned by:
Priority: major Milestone: sage-6.4
Component: doctest framework Keywords: python3
Cc: Merged in:
Authors: André Apitzsch Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: 5661567 (Commits, GitHub, GitLab) Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by wluebbe)

os.tmpfile() is not available in python3. Use tempfile module which exists in both versions.

The relevant reference in official Python documentation is https://docs.python.org/3.0/whatsnew/3.0.html#library-changes: The functions os.tmpnam(), os.tempnam() and os.tmpfile() have been removed in favor of the tempfile module.

Change History (8)

comment:1 Changed 8 years ago by aapitzsch

  • Branch set to u/aapitzsch/ticket/16442
  • Commit set to 6059f150620343b6cfa1c1681a57de47de843f25
  • Status changed from new to needs_review

New commits:

6059f15replace os.tmpfile() by tempfile.TemporaryFile()

comment:2 follow-up: Changed 8 years ago by vdelecroix

Hello,

What is the point of modifying src/doc/en/thematic_tutorials/linear_programming.rst, src/sage/numerical/backends/glpk_backend.pyx, src/sage/numerical/linear_functions.pyx and src/sage/numerical/mip.pyx in the same commit?

Vincent

comment:3 in reply to: ↑ 2 Changed 8 years ago by aapitzsch

Replying to vdelecroix:

What is the point of modifying src/doc/en/thematic_tutorials/linear_programming.rst, src/sage/numerical/backends/glpk_backend.pyx, src/sage/numerical/linear_functions.pyx and src/sage/numerical/mip.pyx in the same commit?

Without these changes some doctests will fail because the line number changed from 839 to 840.

It's common to write ... instead of the line number.

comment:4 Changed 8 years ago by git

  • Commit changed from 6059f150620343b6cfa1c1681a57de47de843f25 to 566156710124d51851fc9045335dada96c06396f

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

5661567Merge remote-tracking branch 'origin/develop' into py3_tempfile

comment:5 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:6 Changed 8 years ago by jdemeyer

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

comment:7 Changed 8 years ago by vbraun

  • Branch changed from u/aapitzsch/ticket/16442 to 566156710124d51851fc9045335dada96c06396f
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:8 Changed 8 years ago by wluebbe

  • Commit 566156710124d51851fc9045335dada96c06396f deleted
  • Description modified (diff)
Note: See TracTickets for help on using tickets.