Bug 17325

Summary: Problem with serialization via readRDS() on a textConnection()
Product: R Reporter: Duncan Murdoch <murdoch>
Component: I/OAssignee: R-core <R-core>
Status: CLOSED FIXED    
Severity: normal CC: maechler
Priority: P2    
Version: R 3.4.1   
Hardware: All   
OS: Other   

Description Duncan Murdoch 2017-08-09 13:06:01 UTC
In message https://stat.ethz.ch/pipermail/r-help/2017-August/448539.html Christopher Walker reported the following bug:  readRDS can't read from an ascii serialization on a textConnection.  The code below worked for him in 3.2.x and for me in 3.3.2 but not in 3.4.1.

> 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
Comment 1 Martin Maechler 2017-08-09 15:21:04 UTC
This is an  R 3.4.1 - only bug  --- introduced when we made   readRDS(url(.)) 

It is fixed in R-devel now and will be ported to  "R 3.4.1 patched"  soon.