{"action":"created","issue":{"url":"https://api.github.com/repos/tcalmant/python-javaobj/issues/2","repository_url":"https://api.github.com/repos/tcalmant/python-javaobj","labels_url":"https://api.github.com/repos/tcalmant/python-javaobj/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/tcalmant/python-javaobj/issues/2/comments","events_url":"https://api.github.com/repos/tcalmant/python-javaobj/issues/2/events","html_url":"https://github.com/tcalmant/python-javaobj/issues/2","id":149624932,"number":2,"title":"Request: optionally allow remaining bytes in stream","user":{"login":"voetsjoeba","id":1284184,"avatar_url":"https://avatars.githubusercontent.com/u/1284184?v=3","gravatar_id":"","url":"https://api.github.com/users/voetsjoeba","html_url":"https://github.com/voetsjoeba","followers_url":"https://api.github.com/users/voetsjoeba/followers","following_url":"https://api.github.com/users/voetsjoeba/following{/other_user}","gists_url":"https://api.github.com/users/voetsjoeba/gists{/gist_id}","starred_url":"https://api.github.com/users/voetsjoeba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voetsjoeba/subscriptions","organizations_url":"https://api.github.com/users/voetsjoeba/orgs","repos_url":"https://api.github.com/users/voetsjoeba/repos","events_url":"https://api.github.com/users/voetsjoeba/events{/privacy}","received_events_url":"https://api.github.com/users/voetsjoeba/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tcalmant/python-javaobj/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-20T01:11:18Z","updated_at":"2016-04-22T18:32:55Z","closed_at":"2016-04-22T18:12:24Z","body":"The JavaObjectUnmarshaller.readObject method currently emits a warning when there are remaining bytes present beyond the serialized Java object. It would be useful to have a way to suppress that warning in cases where further data in the input stream is expected and normal.\r\n\r\nMotivating use case is unserializing SecretKey objects from JCEKS keystores, as done in the pyjks project (https://github.com/doublereedkurt/pyjks). The JCEKS keystore format is almost entirely custom structured binary data, with the exception of SecretKey entries which are stored as wholesale serialized Java objects embedded right in the middle of the file.\r\n\r\nKeystore entries can appear in any order and mix of types, and there are always raw signature bytes present at the end of a keystore, so it is fully expected for there to be trailing data after a call to readObject. There is no way of knowing in advance what the size of a serialized Java object is either, so we also can't get around it by feeding a subset of the stream to javaobj.\r\n\r\nSo my request is: could we have a flag to indicate that trailing data is expected, in which case no warning is emitted?"},"comment":{"url":"https://api.github.com/repos/tcalmant/python-javaobj/issues/comments/213545298","html_url":"https://github.com/tcalmant/python-javaobj/issues/2#issuecomment-213545298","issue_url":"https://api.github.com/repos/tcalmant/python-javaobj/issues/2","id":213545298,"user":{"login":"voetsjoeba","id":1284184,"avatar_url":"https://avatars.githubusercontent.com/u/1284184?v=3","gravatar_id":"","url":"https://api.github.com/users/voetsjoeba","html_url":"https://github.com/voetsjoeba","followers_url":"https://api.github.com/users/voetsjoeba/followers","following_url":"https://api.github.com/users/voetsjoeba/following{/other_user}","gists_url":"https://api.github.com/users/voetsjoeba/gists{/gist_id}","starred_url":"https://api.github.com/users/voetsjoeba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voetsjoeba/subscriptions","organizations_url":"https://api.github.com/users/voetsjoeba/orgs","repos_url":"https://api.github.com/users/voetsjoeba/repos","events_url":"https://api.github.com/users/voetsjoeba/events{/privacy}","received_events_url":"https://api.github.com/users/voetsjoeba/received_events","type":"User","site_admin":false},"created_at":"2016-04-22T18:32:55Z","updated_at":"2016-04-22T18:32:55Z","body":"Syntax error on these lines in python 2.7 :(\r\n```\r\ndef load(file_object, *transformers, ignore_remaining_data=False):\r\ndef loads(string, *transformers, ignore_remaining_data=False):\r\n```\r\nPutting the `*transformers` at the end of the argument list resolves it."}}