# Union::normal: Nonatomic expression expected when using Uncompress

I saved a expresion to a file like this

Export["file.dat",Compress@myExpression];


Then (i don't know why) when I import the file i get the compressed expresion embedded in a nested list like this:

test = Import["file.dat"] (* test -> {{ compressedString }} *)


So I use this to Uncompress the expresion:

myExp = Uncompress@First@Flatten@Import["file.dat"];


And I get my expresion back correctly, but i get these msg

Union::normal: Nonatomic expression expected at position 2 in <<1>>. >>
Union::normal: Nonatomic expression expected at position 2 in <<1>>. >>


Should I worry about those msg? Why am I getting those?

You can check for yourselves: https://dl.dropboxusercontent.com/u/35192406/bad.dat

-
The .dat file is assumed to contain tabular data, so Import gives you a 2D list. You can use Import["file.dat", "Text"] to get the string directly. The messages are presumably coming from the evaluation of myExpression – Simon Woods Apr 3 '14 at 19:35

It seems there is a undefined variable games in the compressed data. The code in the compressed data attempts to do a union on this games variable and some lists. So essentially, the error you get is the same one caused by

Union[{}, games]


To see it for yourself, try using Uncompress with two arguments. I suggest to use HoldComplete as a second argument.

We then have

MatchQ[heldData, HoldComplete[Union[___]]]


True

-