Code Monkey home page Code Monkey logo

Comments (8)

calid avatar calid commented on July 30, 2024

There's something wrong on that test box, the locale specific string is already being checked, not the literal "Invalid argument":
https://metacpan.org/source/CALID/ZMQ-FFI-0.17/t/errors.t#L21

I'm also able to install locally under the german locale without issue...
http://pastebin.com/Bxwk5g5R

from perlzmq.

eserte avatar eserte commented on July 30, 2024

The mentioned fail report is from perl 5.21.8. Bleadperl behaves differently than earlier perls:

$ env LC_ALL=de_DE.UTF_8 perl5.21.9 -E '$!=1; say "$!"'
Operation not permitted
$ env LC_ALL=de_DE.UTF_8 perl5.20.2 -E '$!=1; say "$!"'
Die Operation ist nicht erlaubt

from perlzmq.

eserte avatar eserte commented on July 30, 2024

And it is the locale, here's a pass/fail pair from the perl version on the same box, just with different LC_ALL settings (C vs. de_DE.UTF-8):

from perlzmq.

calid avatar calid commented on July 30, 2024

hmm, this looks like a bug in the latest Perl... it's not honoring the locale when string-ifying $!. You should report this as a bug in Perl itself.

from perlzmq.

calid avatar calid commented on July 30, 2024

To expand a bit, ZMQ::FFI gets the error string by using zmq_strerror. This returns the properly localized error string. Then in the test, I get the expected localized error string by simply setting $! to EINVAL and stringifying it. In previous Perl versions this worked, but as your comment above demonstrates this is broken in the latest Perl... it's always producing the english version of $!.

from perlzmq.

eserte avatar eserte commented on July 30, 2024

No, this is an intentional change in perl 5.21.x. To get the localized stringified $!, you have to enclose it in use locale now. From perl5211delta.pod:

"$!" text is now in English outside "use locale" scope
Previously, the text, unlike almost everything else, always came out
based on the current underlying locale of the program. (Also affected on
some systems is ""$^E"".) For programs that are unprepared to handle
locale, this can cause garbage text to be displayed. It's better to
display text that is translatable via some tool than garbage text which
is much harder to figure out.

from perlzmq.

calid avatar calid commented on July 30, 2024

@eserte I believe this should be resolved now. Let me know if you have any further issues.

from perlzmq.

eserte avatar eserte commented on July 30, 2024

I think the change looks good. Will know for sure when you're releasing a new version to cpan and cpantesters.

from perlzmq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.