[Rd] Internal error in 'ls' for pathological environments (PR#14035)

macrakis at alum.mit.edu macrakis at alum.mit.edu
Sun Nov 1 05:00:12 CET 2009


nchar(with(list(2),ls())) gives an internal error. This is of course
a peculiar call (no names in the list), but the error is not caught
cleanly.

It is not clear from the documentation whether with(list(2)...) is
allowable; if it is not, it should presumably give an error. If it is, then
ls
shouldn't have problems with the resulting environment.

> qq <- with(list(2),ls())                         # An incorrect call (no
names in list)
> nchar(qq)
Error in nchar(qq) : 'getEncChar' must be called on a CHARSXP  # ls returned
a bad object
> qq
[1]Error: 'getEncChar' must be called on a CHARSXP
> qq[1]
[1]Error: 'getEncChar' must be called on a CHARSXP
> qq[2]
[1] NA

Apparently related:

> with(list(a=1,2),ls())
Error in ls() : 'getEncChar' must be called on a CHARSXP



--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status =
 major = 2
 minor = 9.2
 year = 2009
 month = 08
 day = 24
 svn rev = 49384
 language = R
 version.string = R version 2.9.2 (2009-08-24)

Windows Vista x64 (build 6002) Service Pack 2

Locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

Search Path:
 .GlobalEnv, package:stats, package:graphics, package:grDevices,
package:utils, package:datasets, package:methods, Autoloads, package:base

	[[alternative HTML version deleted]]



More information about the R-devel mailing list