[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question about debian/upstream reference



Hi,

On Wed, Jan 08, 2014 at 11:20:40PM +0100, Gert Wollny wrote:
> > Just for the sake of interest: May I ask how did you tested that '8:20'
> > worked.  I wonder if I need to issue at least a warning in the UDD
> > importer.
> I installed dev-python/pyyaml-3.10  [2] on my Gentoo installation at
> home, and ran the following on the upstream file:
> 
>   import yaml
>   f = open("upstream")
>   data = yaml.load(f.read(), Loader=yaml.Loader)
>   print(yaml.dump(data, Dumper=yaml.Dumper))
> 
> and this printed out (amongst others) 
> 
>   Volume: '8:20', Year: 2013, eprint: ...
> 
> BUT: I just now I did some additional checks: 
> 
> print(yaml.dump(yaml.load("Volume: 8:20", Loader=yaml.Loader),
>       Dumper=yaml.Dumper))
> 
> Result (as seen before): 
>      {Volume: 500} 
> 
> print(yaml.dump(yaml.load("Volume: \"8:20\"", Loader=yaml.Loader),
>       Dumper=yaml.Dumper))
> 
> Result: 
>      {Volume: '8:20'}
> 
> Which means the example should have worked for you and on the other hand
> it is quite possible that "Volume: '8:20'" will not work, because the
> quotation is somehow stripped.
> 
> I also tested yaml.safe_load(...) as used in [1], and it also honors the
> double quoted "8:20", on both Debian testing and Gentoo. 
> 
> In both cases the pyyaml base version is 3.10, and the libyaml base
> version is 0.1.4.
> 
> Well, in any case the quotation will do no harm and may result in the
> correct reference, I really don't like the "pages" approach, it is more
> fun to find the problem, meaning I will upload the single-quoted version
> and see what happens.

Thanks for sharing your knowledge!  I agree that finding the problem
is the more challenging solution.  However, if the context would be
really "Pages: 20" it should be put there.  Or am I missing something?
 
> And after looking at [3] I think I know where the 500 comes from: 
> 8:20 may be interpreted as time, like e.g. 8 min 20 s which equals
> 500s :)

Uhhhmmm, OOOOO, AAAA - is this Excel or what???
That's pretty stupid to try to be more intelligent than the writer! 

Anyway, lesson learned I think.

Thanks again for your research

     Andreas.

-- 
http://fam-tille.de


Reply to: