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

Converting to properties (t/map->properties) fails with Mac environmental variables #22

Open
evmin opened this issue Aug 2, 2017 · 0 comments

Comments

@evmin
Copy link

evmin commented Aug 2, 2017

(def config (load-config :resource "config.edn"
                         :merge [(from-env)]))

(defn config-properties []
        (t/map->properties config))

Results in:

Exception in thread "main" java.lang.IllegalArgumentException: Malformed \uxxxx encoding., compiling:(/private/var/folders/hl/dz69nmk50kl_cn4fgd904dwh0000gn/T/form-init5308382940781279132.clj:1:125)
	at clojure.lang.Compiler.load(Compiler.java:7391)
	at clojure.lang.Compiler.loadFile(Compiler.java:7317)
	at clojure.main$load_script.invokeStatic(main.clj:275)
	at clojure.main$init_opt.invokeStatic(main.clj:277)
	at clojure.main$init_opt.invoke(main.clj:277)
	at clojure.main$initialize.invokeStatic(main.clj:308)
	at clojure.main$null_opt.invokeStatic(main.clj:342)
	at clojure.main$null_opt.invoke(main.clj:339)
	at clojure.main$main.invokeStatic(main.clj:421)
	at clojure.main$main.doInvoke(main.clj:384)
	at clojure.lang.RestFn.invoke(RestFn.java:421)
	at clojure.lang.Var.invoke(Var.java:383)
	at clojure.lang.AFn.applyToHelper(AFn.java:156)
	at clojure.lang.Var.applyTo(Var.java:700)
	at clojure.main.main(main.java:37)
Caused by: java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
	at java.util.Properties.loadConvert(Properties.java:574)
	at java.util.Properties.load0(Properties.java:391)
	at java.util.Properties.load(Properties.java:317)
	at cprop.tools$map__GT_properties.invokeStatic(tools.cljc:76)
	at cprop.tools$map__GT_properties.invoke(tools.cljc:71)

If "(from-env)" is removed, everything works. I suspect that parsing of one of the env variables might be causing this. I'm on Mac.

I am attaching a code sample to reproduce.

The output included as result.txt is from the first call that works: semi - custom logic, based on other private methods in the lib to convert config to Properties.

issue-demo.zip

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

No branches or pull requests

1 participant