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

Re: Question about debian/upstream reference



Hello Andreas, 

On Wed, 2014-01-08 at 20:08 +0100, Andreas Tille 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.


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 :)

Best, 
Gert 

[1]http://anonscm.debian.org/gitweb/?p=collab-qa/udd.git;a=blob;f=udd/bibref_gatherer.py
[2]http://pyyaml.org/wiki/PyYAML http://pypi.python.org/pypi/PyYAM
[3]http://www.yaml.org/spec/1.2/spec.html#id2766934



Reply to: