{"action":"created","issue":{"url":"https://api.github.com/repos/Julian/jsonschema/issues/299","repository_url":"https://api.github.com/repos/Julian/jsonschema","labels_url":"https://api.github.com/repos/Julian/jsonschema/issues/299/labels{/name}","comments_url":"https://api.github.com/repos/Julian/jsonschema/issues/299/comments","events_url":"https://api.github.com/repos/Julian/jsonschema/issues/299/events","html_url":"https://github.com/Julian/jsonschema/issues/299","id":179872450,"number":299,"title":"When open()'ing file, encoding needs to be specified. Was: A strange issue with jsonschema in docker.","user":{"login":"LebedevRI","id":88600,"avatar_url":"https://avatars.githubusercontent.com/u/88600?v=3","gravatar_id":"","url":"https://api.github.com/users/LebedevRI","html_url":"https://github.com/LebedevRI","followers_url":"https://api.github.com/users/LebedevRI/followers","following_url":"https://api.github.com/users/LebedevRI/following{/other_user}","gists_url":"https://api.github.com/users/LebedevRI/gists{/gist_id}","starred_url":"https://api.github.com/users/LebedevRI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LebedevRI/subscriptions","organizations_url":"https://api.github.com/users/LebedevRI/orgs","repos_url":"https://api.github.com/users/LebedevRI/repos","events_url":"https://api.github.com/users/LebedevRI/events{/privacy}","received_events_url":"https://api.github.com/users/LebedevRI/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-09-28T19:56:32Z","updated_at":"2016-10-16T12:52:39Z","closed_at":"2016-10-16T12:52:39Z","body":"Hi.\r\n\r\nSo this will probably turn out to be a my local problem, but i'm not seeing it just yet.\r\n\r\nI'm using jsonschema to validate a JSON file in darktable:  https://github.com/darktable-org/darktable/blob/master/data/CMakeLists.txt#L99\r\n\r\nOn my local machine this just works:\r\n```\r\n$ make validate_noiseprofiles_json \r\nChecking validity of noiseprofiles.json\r\nBuilt target validate_noiseprofiles_json\r\n```\r\n\r\nHowever in clean docker environment it does not:\r\nhttps://travis-ci.org/darktable-org/darktable/jobs/163489568#L520\r\n```\r\n[  4%] Checking validity of noiseprofiles.json\r\nusage: jsonschema [-h] [-i INSTANCES] [-F ERROR_FORMAT] [-V VALIDATOR] schema\r\njsonschema: error: argument -i/--instance: invalid _json_file value: '/build/darktable/data/noiseprofiles.json'\r\n```\r\n\r\nIf i manually pull that image, and do it manually, it does cause the same issue.\r\nAnd outside of the image, it just works.\r\nOn the exact same input JSON+schema, with exactly the same sha512sum's for those 2 files.\r\n\r\nWhat could possibly be going on?"},"comment":{"url":"https://api.github.com/repos/Julian/jsonschema/issues/comments/254045209","html_url":"https://github.com/Julian/jsonschema/issues/299#issuecomment-254045209","issue_url":"https://api.github.com/repos/Julian/jsonschema/issues/299","id":254045209,"user":{"login":"Julian","id":329822,"avatar_url":"https://avatars.githubusercontent.com/u/329822?v=3","gravatar_id":"","url":"https://api.github.com/users/Julian","html_url":"https://github.com/Julian","followers_url":"https://api.github.com/users/Julian/followers","following_url":"https://api.github.com/users/Julian/following{/other_user}","gists_url":"https://api.github.com/users/Julian/gists{/gist_id}","starred_url":"https://api.github.com/users/Julian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Julian/subscriptions","organizations_url":"https://api.github.com/users/Julian/orgs","repos_url":"https://api.github.com/users/Julian/repos","events_url":"https://api.github.com/users/Julian/events{/privacy}","received_events_url":"https://api.github.com/users/Julian/received_events","type":"User","site_admin":false},"created_at":"2016-10-16T12:52:39Z","updated_at":"2016-10-16T12:52:39Z","body":"That answer seems to assume you'd want unicode in both languages, but we don't, jsonschema just needs a native str. The locale is what Python3 uses to know what encoding your bytes are in if you don't specify one, but having jsonschema forcibly assume one isn't really better than the default, it would just flip flop who's broken -- someone with a non-UTF-8 non-ASCII-file or someone with a UTF-8 file and an ASCII locale. And yeah, on Py2, just getting back bytes is the intention, and the json module there happily accept them.\r\n\r\nGonna just close this out, glad you were able to get it to work."}}
{"actor":{"display_login":"Julian"}}