Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upserializing "package_version" object causes infinite recursion #37
Comments
|
The package_version object is a funny one. For kicks, can you check what happens with these two:
I presume these travel fine. I am not quite where we'd have to go to stop the recursion. But your suggested check is a good one. If you have time to dig ... |
|
Just raised a PR. > x1 <- as.raw(x)
Error: (list) object cannot be coerced to type 'raw'
> x2 <- format(x)
> x2
[1] "1.2" |
|
No, I meant: what happens when you try to protobuf x1 or x2. I guess x1 is out anyway... |
> serialize_pb(format(x),NULL)
[1] 08 00 2a 07 0a 03 31 2e 32 10 00
> unserialize_pb(serialize_pb(format(x),NULL))
[1] "1.2"Ah, yep works as intended |
The following R code causes RProtoBuf to infinitely recurse:
I did some digging and it looks like when this is because when sub indexing the list, the list returns itself:
this causes
lapply(obj, rexp_obj)to never terminate.Perhaps in these situations, we should call unlist?