base::serialize of version = 3 produces different result on windows and linux.

discussion moved from here.

Basically

base::serialize(list(aa = "aaval", bb = "bbval", cc = "ccval", dd = "ddval"), connection = stdout(), version = 3L)

the result of this differs on my Windows and Linux. Inspection of the differring lines seem to indicate that this is an encoding-related problem:

on Windows:

{....}
197888
6
CP1252
531
{....}

on Linux:

{....}
197888
5
UTF-8
531
{....}

How it affects me

I found this when using the targets package to track code changes. I rely on the hash produced by targets package to determine if code has changed thus to determine whether to do the heavy work. I do this on multiple machines of different platform. Because of this problem the work has to be done twice (by the windows and linux machine respectively) and the resulting data stored twice with different code hash but identical content.

1 Like

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.