----- Original Message ----
> From: Tatsuhiko Miyagawa <miyag...@gmail.com>
> To: John Napiorkowski <jjn1...@yahoo.com>
> Sent: Tuesday, August 4, 2009 11:26:23 PM
> Subject: Re: regarding RT#36554
> 
> Yes, I know gethostbyname('perl.bv') is returning true there in your
> ISP. That actually happens to my environment with OpenDNS turned on
> too. But you didn't answer whether example.xyz is returning true or
> not. It returns true with my OpenDNS env but probably false in your
> ISP.

hn-napiorkowskis-computer:~ jjn1056$ perl -e 'use Data::Dump qw/dump/; warn 
dump gethostbyname("perl.bv")'
("perl.bz", "", 2, 4, "\xD0\xC9\xEFd", "\xD0\xC9\xEFe") at -e line 1.
john-napiorkowskis-computer:~ jjn1056$ perl -e 'use Data::Dump qw/dump/; warn 
dump gethostbyname("perl.com")'
("perl.com", "", 2, 4, "\xD0\xC9\xEFd", "\xD0\xC9\xEFe") at -e line 1.
john-napiorkowskis-computer:~ jjn1056$ perl -e 'use Data::Dump qw/dump/; warn 
dump gethostbyname("example.xyz")'
() at -e line 1.
john-napiorkowskis-computer:~ jjn1056$ 

Strange huh?  I guess this is why I am getting pasted your initial check.

> 
> Let's assume that's the case. I think changing the host in the check
> example.xyz to perl.bv would solve the failure here, since that's
> exactly the same as your patch does. As it's mentioned in the other
> email, there's no guarantee where .xyz doesn't exist forever.
> 

In that case we'd end up skipping all three tests.  I tried to write my
patch against the most narrow case.  Also, since the existing code 
has pretty good reliability, and since is appears half of cpan relies on
URI, it might be safer to add in an incremental extra test, rather than
refactor one that appears to already working for 97% of the time.

> Also, skipping this test entirely unless it's explicitly told so with
> some env var like URI_TEST_DNS=1 would make sense, too.
> 

Yeah, I agree with this completely.  These tests probably don't need to
be run on the local installation, since we can't be sure what is going to
happen with DNS in the future.  Having tests rely on external data that
is unvalidated is always going to be a problem.  We can either do this
or er need to add lots of skips similar to my patch which explicitly tests 
the state of the local DNS setup.

I'm happy to do this work if that means I get to 'scratch my itch' regarding
this problem.

John

> 
> On Tue, Aug 4, 2009 at 8:17 PM, John Napiorkowskiwrote:
> >
> >
> >
> >
> > ----- Original Message ----
> >> From: Tatsuhiko Miyagawa 
> >> To: John Napiorkowski 
> >> Cc: libwww@perl.org
> >> Sent: Tuesday, August 4, 2009 9:41:56 PM
> >> Subject: Re: regarding RT#36554
> >>
> >> On Tue, Aug 4, 2009 at 6:39 PM, John Napiorkowskiwrote:
> >>
> >> > Hmm. I just when to http://gitorious.org/perl-uri/mainline and cloned it.
> >>  That was the
> >> > repository that was listed in the POD.  If that's not the right place 
> please
> >> let me know
> >> > and I will patch against whatever is considered trunk.
> >>
> >> I believe it's now on http://github.com/gisle/uri (I sent a patch against 
> this)
> >>
> >> > However I do think this patch is valid since I first wrote it against 
> >> > what 
> I
> >> downloaded
> >> > from CPAN.  It fixed my problem there.
> >>
> >> So does your ISP resolve perl.bv but not example.xyz? Is that what's
> >> happening when you run make test against URI-1.38 from CPAN?
> >
> > So if I do "look URI" from the cpan shell and manually run the test it goes
> > like this:
> >
> > C:\strawberry\cpan\build\URI-1.38-esiPfL>prove -lv t\heuristic.t
> > t\heuristic....1..15
> > ok 1
> > ok 2
> > ok 3
> > ok 4
> > ok 5
> > not ok 6
> > ok 7
> > ok 8
> > ok 9
> > ok 10
> > ok 11
> > ok 12
> > ok 13
> > ok 14
> > ok 15
> > FAILED test 6
> >        Failed 1/15 tests, 93.33% okay
> > Failed Test   Stat Wstat Total Fail  List of Failed
> > ---------------------------------------------------------------------------
> > t\heuristic.t               15    1  6
> > Failed 1/1 test scripts. 1/15 subtests failed.
> > Files=1, Tests=15,  3 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00 CPU)
> > Failed 1/1 test programs. 1/15 subtests failed.
> >
> > Now, that's on Strawberry Perl because right now I am remote on a Windows
> > machine, but I get the exact error from my linux boxes.
> >
> > When I dig a bit. particularly regarding the example.xyz thing I discover 
> > the
> > root cause:
> >
> > C:\strawberry\cpan\build\URI-1.38-esiPfL>perl -Ilib -e "use URI::Heuristic 
> qw(uf
> > _urlstr); $URI::Heuristic::MY_COUNTRY = 'bv';$URI::Heuristic::DEBUG=1; warn 
> uf_u
> > rlstr('perl/camel.gif')"
> > uf_uristr: resolving perl/camel.gif
> > uf_uristr: gethostbyname('www.perlt.bv.')...yes
> > uf_uristr: ==> http://www.perl.bv/camel.gif
> > http://www.perl.bv/camel.gif at -e line 1.
> >
> > That "uf_uristr: gethostbyname('www.perl.bv.')...yes" should say "...no" 
> > since
> > that URL is not supposed to exist.  This test was design to flex the 
> heuristics
> > matching when the hostname is incomplete.  The way it works is that it first
> > trys your home country and then falls back to '.com'.  The idea here is 
> > that 
> the
> > incomplete hostname should eventually match on www.perl.com, however since
> > for some reasons some ISPs resove www.perl.bv it causes the test to fail.
> >
> > When I test this from another job site it does say no.
> >
> > BTW, another email mentioned that 'invalid' is reserved for this kind of 
> testing but
> > unfortunately that doesn't fix it in my case.  Basically this is the ISP 
> breaking the
> > rule regarding what they are supposed to do when you try to get a hostname 
> that
> > doesn't exist.  Instead of returning a "not found" they use it as an 
> opportunity to
> > serve up some ads.  Yeah. it sucks and I complained to them but they have 
> > not
> > reason to fix it based on me having trouble installing a Perl application.
> >
> > Basically the basis of my patch is that if a test expect the perl.bz to 
> > fail 
> as a
> > condition of the test, it should test that.  In this case allow the test to 
> skip would
> > result in breaking code that relies on the ISP properly returning a not 
> > found. 
>  I don't
> > know of anything on CPAN that does have that requirement, but there's a lot 
> > of 
> stuff
> > around so I guess this proposed patch might end up pushing some errors 
> downstream.
> >
> > I could alter this patch to put out a more detailed issue report.  That way 
> people can
> > call their ISP to complate.  However after talking with my ISP for 2 hours 
> today trying
> >  to find someone that even understood this is a problem told me that most 
> people find
> > the 'friendly' not found page better.  It violates standards though.  But 
> > it 
> makes a bit of
> > money for the ISP.  Anyway, that's it for me tonight :)  Let me know what 
> > you 
> all think.
> > Skipping the test as I propose makes URI work for what most people I know 
> > need 
> it to
> > work for.  But I primarily use it for Catalyst, which just uses it to 
> constraint valid URLs
> > and doesn't use any of URIs fancy pattern matching and hostname guessing.  
> > So 
> for
> > me it's a fix, but I guess it might cause some trouble for other people. 
>  Other people
> > might not be testing for this issue and relying on URI to balk.  On the 
> > other 
> hand its
> > a pretty esoteric error.  I imagine most people scratch their head and just 
> force install
> > it.
> >
> > john
> >>
> >> >> If your ISP doesn't resolve example.xyz but does perl.bv, it's
> >> >> surprising but i could understand, that changing the check hostname
> >> >> would make more sense.
> >> >>
> >> >> On Tue, Aug 4, 2009 at 6:16 PM, Tatsuhiko Miyagawawrote:
> >> >> > I believe this is fixed by my patch and released as 1.38.
> >> >> > 
> http://github.com/gisle/uri/commit/4af5412726c6f719d76ffb666054a72c9cd2c492
> >> >> > http://cpansearch.perl.org/src/GAAS/URI-1.38/Changes
> >> >>
> >> >>
> >> >> --
> >> >> Tatsuhiko Miyagawa
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> Tatsuhiko Miyagawa
> >
> >
> >
> >
> >
> 
> 
> 
> -- 
> Tatsuhiko Miyagawa



      

Reply via email to