Skip Menu |

This queue is for tickets about the Mac-PropertyList CPAN distribution.

Report information
The Basics
Id: 83460
Status: resolved
Priority: 0/
Queue: Mac-PropertyList

People
Owner: Nobody in particular
Requestors: szr-pl [...] szroman.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.38
Fixed in: (no value)



Subject: Date portion of <date> fields is missing when reading binary plist under win32
I've noticed that under 32-bit Windows (not sure about 64-bit), I have noticed that when reading a binary plist, such as: <key>LastUpdate</key> <date>2013-02-19T20:49:56Z</date> I get "T20:49:56Z" instead of "2013-02-19T20:49:56Z", using the code below: Show quoted text
> perl -E " use Mac::PropertyList qw(:all); my $data = parse_plist_file
q/metadata.plist/; my $pd = $data->as_perl; say $data->{LastUpdate}->value " I get the proper value if I convert the plist file to plain XML. This only appears to occur under Windows, testing with ActivePerl 5.14.1 on two different Windows XP 32-bit machines. I could not reproduce this under Linux with either Perl 5.14.1 or 5.16.1. Thank you.
Subject: Re: [rt.cpan.org #83460] Date portion of <date> fields is missing when reading binary plist under win32
Date: Fri, 29 Mar 2013 02:02:18 -0500
To: bug-Mac-PropertyList [...] rt.cpan.org
From: brian d foy <bdfoy [...] cpan.org>
I don't have time to investigate this myself, but if you can provide that metadata.plist file, or any file that shows the problem, I can at least see if I can replicate it. If you come up with a patch, send it along. Thanks, On Tue, Feb 19, 2013 at 7:01 PM, via RT <bug-Mac-PropertyList@rt.cpan.org>wrote: Show quoted text
> Tue Feb 19 20:01:09 2013: Request 83460 was acted upon. > Transaction: Ticket created by szr > Queue: Mac-PropertyList > Subject: Date portion of <date> fields is missing when reading binary > plist under win32 > Broken in: 1.38 > Severity: Normal > Owner: Nobody > Requestors: szr-pl@szroman.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=83460 > > > > I've noticed that under 32-bit Windows (not sure about 64-bit), I have > noticed that when reading a binary plist, such as: > > <key>LastUpdate</key> > <date>2013-02-19T20:49:56Z</date> > > I get "T20:49:56Z" instead of "2013-02-19T20:49:56Z", using the code below: >
> > perl -E " use Mac::PropertyList qw(:all); my $data = parse_plist_file
> q/metadata.plist/; my $pd = $data->as_perl; say $data->{LastUpdate}->value > " > > I get the proper value if I convert the plist file to plain XML. This > only appears to occur under Windows, testing with ActivePerl 5.14.1 on > two different Windows XP 32-bit machines. I could not reproduce this > under Linux with either Perl 5.14.1 or 5.16.1. > > Thank you. > > >
-- brian d foy <brian.d.foy@gmail.com> http://www.pair.com/~comdog/
Subject: Re: [rt.cpan.org #83460] Date portion of <date> fields is missing when reading binary plist under win32
Date: Fri, 29 Mar 2013 09:36:15 -0700
To: bug-Mac-PropertyList [...] rt.cpan.org
From: SZR <szr [...] szroman.com>
Thank you for your reply. I have attached the file that you asked for. Please let me know if you can indeed reproduce the problem. -szr On 3/29/2013 0:03 AM, brian d foy via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=83460> > > I don't have time to investigate this myself, but if you can provide that > metadata.plist file, or any file that shows the problem, I can at least see > if I can replicate it. > > If you come up with a patch, send it along. > > Thanks, > > > On Tue, Feb 19, 2013 at 7:01 PM, via RT<bug-Mac-PropertyList@rt.cpan.org>wrote: >
>> Tue Feb 19 20:01:09 2013: Request 83460 was acted upon. >> Transaction: Ticket created by szr >> Queue: Mac-PropertyList >> Subject: Date portion of<date> fields is missing when reading binary >> plist under win32 >> Broken in: 1.38 >> Severity: Normal >> Owner: Nobody >> Requestors: szr-pl@szroman.com >> Status: new >> Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=83460> >> >> >> I've noticed that under 32-bit Windows (not sure about 64-bit), I have >> noticed that when reading a binary plist, such as: >> >> <key>LastUpdate</key> >> <date>2013-02-19T20:49:56Z</date> >> >> I get "T20:49:56Z" instead of "2013-02-19T20:49:56Z", using the code below: >>
>>> perl -E " use Mac::PropertyList qw(:all); my $data = parse_plist_file
>> q/metadata.plist/; my $pd = $data->as_perl; say $data->{LastUpdate}->value >> " >> >> I get the proper value if I convert the plist file to plain XML. This >> only appears to occur under Windows, testing with ActivePerl 5.14.1 on >> two different Windows XP 32-bit machines. I could not reproduce this >> under Linux with either Perl 5.14.1 or 5.16.1. >> >> Thank you. >> >> >>
>
Download metadata.plist
application/octet-stream 361b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #83460] Date portion of <date> fields is missing when reading binary plist under win32
Date: Fri, 29 Mar 2013 14:22:12 -0500
To: bug-Mac-PropertyList [...] rt.cpan.org
From: brian d foy <bdfoy [...] cpan.org>
This works for me on my Mac, so I'm guessing it's a Windows issue with the binary parsing. On Fri, Mar 29, 2013 at 11:36 AM, SZR via RT < bug-Mac-PropertyList@rt.cpan.org> wrote: Show quoted text
> Queue: Mac-PropertyList > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=83460 > > > Thank you for your reply. I have attached the file that you asked for. > Please let me know if you can indeed reproduce the problem. > > -szr > > On 3/29/2013 0:03 AM, brian d foy via RT wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=83460> > > > > I don't have time to investigate this myself, but if you can provide that > > metadata.plist file, or any file that shows the problem, I can at least
> see
> > if I can replicate it. > > > > If you come up with a patch, send it along. > > > > Thanks, > > > > > > On Tue, Feb 19, 2013 at 7:01 PM, via RT<bug-Mac-PropertyList@rt.cpan.org > >wrote: > >
> >> Tue Feb 19 20:01:09 2013: Request 83460 was acted upon. > >> Transaction: Ticket created by szr > >> Queue: Mac-PropertyList > >> Subject: Date portion of<date> fields is missing when reading
> binary
> >> plist under win32 > >> Broken in: 1.38 > >> Severity: Normal > >> Owner: Nobody > >> Requestors: szr-pl@szroman.com > >> Status: new > >> Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=83460> > >> > >> > >> I've noticed that under 32-bit Windows (not sure about 64-bit), I have > >> noticed that when reading a binary plist, such as: > >> > >> <key>LastUpdate</key> > >> <date>2013-02-19T20:49:56Z</date> > >> > >> I get "T20:49:56Z" instead of "2013-02-19T20:49:56Z", using the code
> below:
> >>
> >>> perl -E " use Mac::PropertyList qw(:all); my $data = parse_plist_file
> >> q/metadata.plist/; my $pd = $data->as_perl; say
> $data->{LastUpdate}->value
> >> " > >> > >> I get the proper value if I convert the plist file to plain XML. This > >> only appears to occur under Windows, testing with ActivePerl 5.14.1 on > >> two different Windows XP 32-bit machines. I could not reproduce this > >> under Linux with either Perl 5.14.1 or 5.16.1. > >> > >> Thank you. > >> > >> > >>
> >
> >
-- brian d foy <brian.d.foy@gmail.com> http://www.pair.com/~comdog/
Subject: Re: [rt.cpan.org #83460] Date portion of <date> fields is missing when reading binary plist under win32
Date: Sat, 30 Mar 2013 13:38:19 -0700
To: bug-Mac-PropertyList [...] rt.cpan.org
From: SZR <szr [...] szroman.com>
It works for me under Linux and OS X as well. The bug appears to only rear it's head under Win32. -szr On 3/29/2013 12:23 PM, brian d foy via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=83460> > > This works for me on my Mac, so I'm guessing it's a Windows issue with the > binary parsing. > > > On Fri, Mar 29, 2013 at 11:36 AM, SZR via RT< > bug-Mac-PropertyList@rt.cpan.org> wrote: >
>> Queue: Mac-PropertyList >> Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=83460> >> >> Thank you for your reply. I have attached the file that you asked for. >> Please let me know if you can indeed reproduce the problem. >> >> -szr >> >> On 3/29/2013 0:03 AM, brian d foy via RT wrote:
>>> <URL: https://rt.cpan.org/Ticket/Display.html?id=83460> >>> >>> I don't have time to investigate this myself, but if you can provide that >>> metadata.plist file, or any file that shows the problem, I can at least
>> see
>>> if I can replicate it. >>> >>> If you come up with a patch, send it along. >>> >>> Thanks, >>> >>> >>> On Tue, Feb 19, 2013 at 7:01 PM, via RT<bug-Mac-PropertyList@rt.cpan.org >>> wrote: >>>
>>>> Tue Feb 19 20:01:09 2013: Request 83460 was acted upon. >>>> Transaction: Ticket created by szr >>>> Queue: Mac-PropertyList >>>> Subject: Date portion of<date> fields is missing when reading
>> binary
>>>> plist under win32 >>>> Broken in: 1.38 >>>> Severity: Normal >>>> Owner: Nobody >>>> Requestors: szr-pl@szroman.com >>>> Status: new >>>> Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=83460> >>>> >>>> >>>> I've noticed that under 32-bit Windows (not sure about 64-bit), I have >>>> noticed that when reading a binary plist, such as: >>>> >>>> <key>LastUpdate</key> >>>> <date>2013-02-19T20:49:56Z</date> >>>> >>>> I get "T20:49:56Z" instead of "2013-02-19T20:49:56Z", using the code
>> below:
>>>>> perl -E " use Mac::PropertyList qw(:all); my $data = parse_plist_file
>>>> q/metadata.plist/; my $pd = $data->as_perl; say
>> $data->{LastUpdate}->value
>>>> " >>>> >>>> I get the proper value if I convert the plist file to plain XML. This >>>> only appears to occur under Windows, testing with ActivePerl 5.14.1 on >>>> two different Windows XP 32-bit machines. I could not reproduce this >>>> under Linux with either Perl 5.14.1 or 5.16.1. >>>> >>>> Thank you. >>>> >>>> >>>>
>>
>
I looked at this briefly and it seems like the problem must be in either gmtime() or POSIX::strftime(). Perhaps there is What do you get on your system if you execute this?: use POSIX; print "Cocoa epoch is: ".POSIX::strftime("%FT%H:%M:%SZ\n", gmtime(978307200)); Ideally you'd get this: Cocoa epoch is: 2001-01-01T00:00:00Z
On Mon Sep 23 00:43:19 2013, WIML wrote: Show quoted text
> I looked at this briefly and it seems like the problem must be in > either gmtime() or POSIX::strftime(). Perhaps there is What do you > get on your system if you execute this?: > > use POSIX; print "Cocoa epoch is: ".POSIX::strftime("%FT%H:%M:%SZ\n", > gmtime(978307200)); > > Ideally you'd get this: > Cocoa epoch is: 2001-01-01T00:00:00Z
Yes, under Linux I get: Cocoa epoch is: 2001-01-01T00:00:00Z but under Windows I get: T00:00:00Z Which is consistent with the previous tests. Thanks, at least it's known where the problem actually is.
Reading the POSIX docs, it says under strftime: If you want your code to be portable, your format ("fmt") argument should use only the conversion specifiers defined by the ANSI C standard (C89, to play safe). These are "aAbBcdHIjmMpSUwWxXyYZ%". I'm using the %F there to create %Y-%m-%d. I should stop doing that. I've released 1.38_02 with a trial fix. See if that works for you.
On Mon Sep 23 19:56:37 2013, BDFOY wrote: Show quoted text
> Reading the POSIX docs, it says under strftime: > > If you want your code to be portable, your format ("fmt") > argument should use only the conversion specifiers defined by > the ANSI C standard (C89, to play safe). These are > "aAbBcdHIjmMpSUwWxXyYZ%". > > I'm using the %F there to create %Y-%m-%d. I should stop doing that. > > I've released 1.38_02 with a trial fix. See if that works for you.
Yes, after installing this version, it I see both the date and time now, using the original test case. Thank you very much.
I've released 1.39, so the latest version has this fix.