Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the YAML CPAN distribution.

Report information
The Basics
Id: 68845
Status: resolved
Priority: 0/
Queue: YAML

People
Owner: Nobody in particular
Requestors: dolmen [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.73
Fixed in: 1.18_001



Subject: verbatim '\n' in error messages
Some error messages contain verbatim '\n': '\n' in the error message definition is not expanded to CR LF or LF. The problem is in YAML::Error. Example: perl -MYAML -e "YAML::LoadFile('none')" YAML Error: Couldn't open none for input:\nMauvais descripteur de fichier Code: YAML_LOAD_ERR_FILE_INPUT at -e line 1 -- Olivier Mengué - http://search.cpan.org/~dolmen/ http://github.com/dolmen/
Чтв Июн 16 04:58:38 2011, DOLMEN писал: Show quoted text
> Some error messages contain verbatim '\n': '\n' in the error message > definition is not expanded to CR LF or LF.
Here is the patch.
Subject: yaml-newline.patch
diff --git a/lib/YAML/Error.pm b/lib/YAML/Error.pm index 1bfee71..97081c8 100644 --- a/lib/YAML/Error.pm +++ b/lib/YAML/Error.pm @@ -33,7 +33,7 @@ sub error_messages { $error_messages; } -%$error_messages = map {s/^\s+//;$_} split "\n", <<'...'; +%$error_messages = map {s/^\s+//;s/\\n/\n/;$_} split "\n", <<'...'; YAML_PARSE_ERR_BAD_CHARS Invalid characters in stream. This parser only supports printable ASCII YAML_PARSE_ERR_NO_FINAL_NEWLINE
This issue has been copied to: https://github.com/ingydotnet/yaml-pm/issues/113 please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.
fixed in 1.18_001