Bug 15813 - writeLines hangs with locale==C if writing special characters. infinite warnings fill up disk
Summary: writeLines hangs with locale==C if writing special characters. infinite warni...
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: I/O (show other bugs)
Version: R 3.1.0
Hardware: x86_64/x64/amd64 (64-bit) OS X Mavericks
: P5 normal
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2014-05-29 15:16 UTC by Dan Tenenbaum
Modified: 2015-03-06 00:59 UTC (History)
1 user (show)

See Also:


Attachments
reproduces the bug. contains non-ascii characters (12.97 KB, text/html)
2014-05-29 15:16 UTC, Dan Tenenbaum
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Tenenbaum 2014-05-29 15:16:50 UTC
Created attachment 1608 [details]
reproduces the bug. contains non-ascii characters

If I start R as follows:

LANG= R

and then run:

x = paste(readLines('a.html'), collapse = '\n')
con = file(tempfile(), 'w', encoding = 'UTF-8')
writeLines(x, con) 

R will hang. If I hit control-C I see many identical warnings. In practice these warnings were filling up the hard drive.

I realize this is a corner case and in fact the machine was misconfigured, it should have had a UTF-8-based locale. But the consequences were severe enough (filling up the hard drive) that I report it.

Thanks.