New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bleadperl v5.13.7-234-g7b98bc4 breaks YAML::XS #10874
Comments
From @andkgit bisect: commit 7b98bc4 regcomp.c: utf8 pattern defaults to Unicode semantics CPAN distros affected: SPROUT/JE-0.051.tar.gz I have patched YAML-LibYAML before so that only the newly broken tests ftp://cpan.cpantesters.org/CPAN/authors/id/A/AN/ANDK/patches/ANDK/patches/YAML-LibYAML-0.34-ANDK-01.patch.gz My observation: perl -le 'my $x = "\x{100}"; chop $x; print qr/$x/' This doesn't look right to me that an empty string gets the "u" and perl -V: Summary of my perl5 (revision 5 version 13 subversion 7) configuration: Characteristics of this binary (from libperl): -- |
From @demerphqOn 4 December 2010 09:11, Andreas J. Koenig via RT
I cant seem to fetch those.
Hmm. Edge case. Arguable both ways, but probably should be special However, can I ask exactly what is going on here that fails? You see it sounds like YAML might be doing dodgy or there could be a If YAML is not using it, then it will have problems as we add If YAML does use it, then it /should/ be robust to these problems. Im thinking in particular of this: use re qw(regexp_pattern); my $ref= qr/\x{100}/; Nevertheless, this is fixed in commit 5b6010b make empty string regexp stringify to the same thing regardless of thanks for the report. cheers, -- |
The RT System itself - Status changed from 'new' to 'open' |
From @andk
> I cant seem to fetch those. Drats, duplicate copy and paste, hereby corrected. ftp://cpan.cpantesters.org/CPAN/authors/id/A/AN/ANDK/patches/YAML-LibYAML-0.34-ANDK-01.patch.gz
> Hmm. Edge case. Arguable both ways, but probably should be special I don't think I said that. I just wanted to present one observation that > However, can I ask exactly what is going on here that fails? The appearance of the "u" switch in qr/.../ is probably not predictable. So this time I bring you an example that will hopefully stick. This perl -le ' I'll leave the rest of you posting uncommented. -- |
From @demerphqOn 4 December 2010 21:15, Andreas J. Koenig
This is the expected result. Yves -- |
From @demerphqOn 4 December 2010 21:15, Andreas J. Koenig
It seemed to me did imply it by saying 'that an empty string gets the "u"'.
Umm, actually until my patch it was extremely predictable. Now it is a
As I said before this is expected. The rule is "if the unicode flag is on, or the pattern contains When you concatenated \x{100} onto $x it was marked as a unicode You can see this with Devel::Peek.
Well thats a pity as it seems to apply directly to some of the changes you did. my $rx2_ = Load($yaml2); Should be rewritten so that you use re::regexp_pattern on the source, Using is($qr, "string") is inherently not future compatible. What can we do to make this kind of thing easier so that you dont have cheers, -- |
From @andk
> It seemed to me did imply it by saying 'that an empty string gets the "u"'. Not at all.
> Umm, actually until my patch it was extremely predictable. Now it is a You should probably revert it.
> As I said before this is expected. > The rule is "if the unicode flag is on, or the pattern contains Before the "Unicode Bug" was fixed it has been said that the unicode > When you concatenated \x{100} onto $x it was marked as a unicode > You can see this with Devel::Peek. If this is not a bug, is it documented? Since your patch did not change
> Well thats a pity as it seems to apply directly to some of the changes you did. > my $rx2_ = Load($yaml2); > Should be rewritten so that you use re::regexp_pattern on the source, That would be a very different test. The current test is asserting a I cannot speak for the author of the test but I believe he doesn't mind > Using is($qr, "string") is inherently not future compatible. This seems to have been accepted by the author of the test. How can we > What can we do to make this kind of thing easier so that you dont have For one moment, please don't worry about the future of the test, just -- |
From @demerphqOn 5 December 2010 05:15, Andreas J. Koenig
For now, I will not. As it has benefit on its own. If i could easily
Hmm. Well. Is it documented that you will *only* see msix in a regexp pattern? Because it is not true, and hasnt been true since 5.10, when 'p' was
A) the syntax of perls regular expression engine is part of the Perl language. B) regexps arent strings - they are *programs*.
Well by using perls stringified regex format they seem to have Regexes stringify to their pattern not so people can print them out, IMO if it were truely language independent then it would output something like: regex($pattern,$modifiers) And use re::regexp_pattern to do so. And then each language would be You cannot even expect the stringified version of a QR to *look* the And in fact this has been true from the first day of qr// objects. So I go back to saying that the only sane test is to create a qr//, Testing it does the right things in other languages is out of scope of
Given the amount of activity related to adding new modifiers to perl
I dont know that I can help with that. Im actually trying, and have
It is not. Unicode data has to behave differently to nonunicode data in patterns. For instance unicode 'e' has to match a larger set of characters in a This subtlety was overlooked in the past and taking a unicode regex Ill try to follow up on this a bit, but basically, if this test code And the behaviour of perl with respect to unicode strings is Anyway, I still do have one more nit on this that I will discuss with But the general points remain: A) that a regex will stringify to some particular string should not be Let me put this in different terms. Does YAML think that it can use Because that is basically what you are asserting for regexes. And that cheers, -- |
From @cpansproutI fixed JE as soon as this ticket was posted, so I’m removing it from |
From @khwilliamsonI never understood a large part of the discussion about this bug. But I I don't know how to proceed with this. The changes to the core are I worked some on this module in September. My suggested fix at that |
From @khwilliamson |
From @obraYAML::LibYAML 0.35 now passes tests on blead. I'm resolving this ticket. |
@obra - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#80212 (status was 'resolved')
Searchable as RT80212$
The text was updated successfully, but these errors were encountered: