Bug 17325 - Problem with serialization via readRDS() on a textConnection()
Summary: Problem with serialization via readRDS() on a textConnection()
Alias: None
Product: R
Classification: Unclassified
Component: I/O (show other bugs)
Version: R 3.4.1
Hardware: All Other
: P2 normal
Assignee: R-core
Depends on:
Reported: 2017-08-09 13:06 UTC by Duncan Murdoch
Modified: 2017-08-09 15:21 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
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.