Christopher Walker
2017-Aug-08 20:39 UTC
[R] Problem with serialization via readRDS() on a textConnection()
Hi All, I had working code under R v3.2 that serialized an object, stored the serialized object in a database, and then successfully retrieved and hydrated that object. I recently updated to R v3.4.1 and the same code now fails. Here is the code in question (simplified), and the resulting error:> zz = textConnection('tempConnection', 'wb') > saveRDS(c("a", "b", "c"), zz, ascii = TRUE) > serialized_obj = paste(textConnectionValue(zz), collapse='\n') > readRDS(textConnection(serialized_obj))Error in gzcon(file) : 'read' not enabled for this connection Docs haven't been much help in this case. I've tried a number of variations but no luck. readRDS() was updated in v3.4.1, but I'm hesitant to call this a bug without intimate knowledge of the source. Any help would be greatly appreciated. [[alternative HTML version deleted]]
Apparently Analagous Threads
- Problem with serialization via readRDS() on a textConnection()
- Error in .readRDS(nsInfoFilePath) : unknown input format (PR#13659)
- [FORGED] recordPlot/replayPlot not working with saveRDS/readRDS
- saveRDS()/readRDS() on environments
- Error in .readRDS(nsInfoFilePath) : unknown input format (PR#13660)