#31080 closed enhancement (fixed)

Replace startup exception by warning

Reported by: gh-tobiasdiez Owned by:
Priority: major Milestone: sage-9.3
Component: build Keywords:
Cc: mkoeppe, chapoton, tscrim, jhpalmieri, slabbe Merged in:
Authors: Tobias Diez Reviewers: Matthias Koeppe
Report Upstream: N/A Work issues:
Branch: a5eb21d (Commits, GitHub, GitLab) Commit: a5eb21d17a051b45193d33ca797bde2ffbc5fde1
Dependencies: Stopgaps:

Status badges

Description (last modified by mkoeppe)

Since #22755, when lazy_import is used during startup, a runtime exception is thrown. This leads to problems if you want to use code with lazy imports in a library mode (e.g. in standalone tests or python scripts).

To support these use cases, this ticket replaces the exception to a print (which matches other warnings printed by the same code).

Change History (12)

comment:1 Changed 10 months ago by gh-tobiasdiez

  • Status changed from new to needs_review

comment:2 Changed 10 months ago by git

  • Commit changed from c4a802d2b6cb571a8a412f58d5b60250bd2a1945 to 5e4f60703562247638eadb772dbc84414699ad98

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

5e4f607Change import exception to print message

comment:3 follow-up: Changed 10 months ago by mkoeppe

#22752 was not merged

comment:4 follow-up: Changed 10 months ago by mkoeppe

Should this not use warning.warn?

comment:5 in reply to: ↑ 3 ; follow-up: Changed 10 months ago by gh-tobiasdiez

Replying to mkoeppe:

#22752 was not merged

Ok, it was in https://github.com/sagemath/sage/commit/8aac18a6b165bc397ccaeaba0b596797e900b0f1. No idea which ticket this corresponds to.

comment:6 in reply to: ↑ 4 Changed 10 months ago by gh-tobiasdiez

Replying to mkoeppe:

Should this not use warning.warn?

Not sure, the other code in that file also used simple print statements.

comment:7 in reply to: ↑ 5 Changed 10 months ago by mkoeppe

Replying to gh-tobiasdiez:

Replying to mkoeppe:

#22752 was not merged

Ok, it was in https://github.com/sagemath/sage/commit/8aac18a6b165bc397ccaeaba0b596797e900b0f1. No idea which ticket this corresponds to.

git trac find thinks it's #22755

comment:8 Changed 10 months ago by mkoeppe

  • Cc jhpalmieri slabbe added

comment:9 Changed 10 months ago by mkoeppe

  • Description modified (diff)
  • Reviewers set to Matthias Koeppe
  • Status changed from needs_review to positive_review

comment:10 Changed 10 months ago by git

  • Commit changed from 5e4f60703562247638eadb772dbc84414699ad98 to a5eb21d17a051b45193d33ca797bde2ffbc5fde1
  • Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

a5eb21dFix doctest

comment:11 Changed 10 months ago by gh-tobiasdiez

  • Status changed from needs_review to positive_review

Thanks!

I just fixed the failing doctest as well.

comment:12 Changed 10 months ago by vbraun

  • Branch changed from public/build/startupWarningMinimal to a5eb21d17a051b45193d33ca797bde2ffbc5fde1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.