# JSON.print throws stack overflow error

**URL:** <https://discourse.julialang.org/t/json-print-throws-stack-overflow-error/73733>\
**Category:** General Usage\
**Tags:** json\
**Created:** [December 28, 2021, 11:01pm UTC](https://discourse.julialang.org/t/json-print-throws-stack-overflow-error/73733 "2021-12-28T23:01:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cocoa1231](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cocoa1231/32/22215_2.png) [@cocoa1231](https://discourse.julialang.org/u/cocoa1231)\
**Post date:** [December 28, 2021, 11:01pm UTC](https://discourse.julialang.org/t/json-print-throws-stack-overflow-error/73733/1 "2021-12-28T23:01:11Z")

</div>

So I was trying to export the Plots.PyPlot.matplotlib.rcParams dictionary to a JSON file so I could use that configuration in my Python code (since the default plots made by Plots.jl are quite nice looking), so I wrote the following to export it to a JSON file -

```julia
using JSON
using Plots

pyplot()
configs = Plots.PyPlot.matplotlib.rcParams

open("rcParams.json", "w") do f
    JSON.print(f, configs)
end

```

However it throws this StackOverflow error

```julia
ERROR: LoadError: StackOverflowError:
in expression starting at /home/cocoa/Documents/DarkMatterProject/JuliaCode/main.jl:7

```

I’m unsure what the issue is here. It works fine for a test dictionary I made

```julia
julia> td = Dict("Hello" => 1, "World" => 2)
Dict{String, Int64} with 2 entries:
  "Hello" => 1
  "World" => 2

julia> JSON.print(td)
{"Hello":1,"World":2}

```

Perhaps some issue with the dictionary? Here is the full dictionary - [Debian paste error](https://paste.debian.net/1224856/)

Appreciate your help!
