Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get! on EnvDict does not convert Int to String anymore on 1.10.0-alpha1 #50472

Closed
jaakkor2 opened this issue Jul 8, 2023 · 3 comments · Fixed by #50771
Closed

get! on EnvDict does not convert Int to String anymore on 1.10.0-alpha1 #50472

jaakkor2 opened this issue Jul 8, 2023 · 3 comments · Fixed by #50771
Milestone

Comments

@jaakkor2
Copy link
Contributor

jaakkor2 commented Jul 8, 2023

On Julia 1.9.2 both of these work

get!(ENV, "foo", 0)
ENV["bar"] = 1

but on Julia 1.10.0-alpha1 I get

julia> get!(ENV, "foo", 0)
ERROR: MethodError: Cannot `convert` an object of type Int64 to an object of type String

Closest candidates are:
  convert(::Type{String}, ::Base.JuliaSyntax.Kind)
   @ Base C:\workdir\base\JuliaSyntax\src\kinds.jl:974
  convert(::Type{String}, ::String)
   @ Base essentials.jl:321
  convert(::Type{T}, ::T) where T
   @ Base Base.jl:84
  ...

Stacktrace:
 [1] get!(default::Base.var"#233#234"{Int64}, t::Base.EnvDict, key::String)
   @ Base .\abstractdict.jl:558
 [2] get!(t::Base.EnvDict, key::String, default::Int64)
   @ Base .\abstractdict.jl:552
 [3] top-level scope
   @ REPL[1]:1

Background: on https://pkgdocs.julialang.org/v1/environments/#Automatic-Precompilation documentation suggests that one can set environment variable to an integer ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0.

@DilumAluthge
Copy link
Member

Background: on https://pkgdocs.julialang.org/v1/environments/#Automatic-Precompilation documentation suggests that one can set environment variable to an integer ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0.

Probably the easiest approach is for us to fix the docs to instead say ENV["JULIA_PKG_PRECOMPILE_AUTO"]="0".

@Krastanov
Copy link

Isn't this a breaking change in public API?

@maleadt
Copy link
Member

maleadt commented Jul 10, 2023

#48128

@KristofferC KristofferC added this to the 1.10 milestone Jul 11, 2023
JeffBezanson added a commit that referenced this issue Aug 2, 2023
JeffBezanson added a commit that referenced this issue Aug 3, 2023
KristofferC pushed a commit that referenced this issue Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants