Bug 996266

Summary: Calling logger() with unicode characters results in "Wide character in print at /usr/share/perl5/vendor_perl/Publican.pm line 1092, <FH> line 7."
Product: [Community] Publican Reporter: Stephen Gordon <sgordon>
Component: publicanAssignee: PnT DevOps Devs <hss-ied-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 3.1CC: aigao, rlandman, sgordon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.0.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-19 02:46:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test book. none

Description Stephen Gordon 2013-08-12 19:24:17 UTC
Created attachment 785860 [details]
Test book.

Description of problem:

When running publican_print_unused on a book containing images with UTF-8 characters in their file names, and those image files happen to be unused, I receive this error from the logger() subroutine:

Wide character in print at /usr/share/perl5/vendor_perl/Publican.pm line 1092, <FH> line 7.

The file names of the relevant images are however still output correctly - the error isn't fatal. The relevant block of code is:

1086 sub logger {
1087     my ( $msg, $colour ) = @_;
1088
1089     return if ($QUIET);
1090
1091     if ( $colour && !$NOCOLOURS ) {
1092         print( STDOUT $colour, $msg, RESET);
1093     }
1094     else {
1095         print( STDOUT $msg );
1096     }
1097
1098     return;
1099 }

Full output for the attached test book is:

$ publican print_unused_images

List of unused Image files in en-US
Wide character in print at /usr/share/perl5/vendor_perl/Publican.pm line 1092, <FH> line 7.
    images/Flavors-–-TGen-Cloud-Dashboard.png
Wide character in print at /usr/share/perl5/vendor_perl/Publican.pm line 1092, <FH> line 7.
    images/Login-–-OpenStack-Dashboard.png

List of missing Image files in en-US
    Common_Content/images/title_logo.svg

Version-Release number of selected component (if applicable):

publican-3.2.0-0.fc18.noarch

Comment 2 Jeff Fearn 🐞 2013-09-23 04:40:47 UTC
Seems to be working in DEVEL branch.

[jfearn@cranium Users_Guide]$ publican print_unused_images 

DEBUG: Publican: config loaded

List of unused Image files in en-US
    images/drupal_add_user.png
    images/test—image.png

List of missing Image files in en-US
    Common_Content/images/title_logo.svg

Note the f^^^ err... large boned dash in the test image name.

Comment 3 Stephen Gordon 2013-09-24 12:25:28 UTC
(In reply to Jeff Fearn from comment #2)
> Seems to be working in DEVEL branch.
> 
> [jfearn@cranium Users_Guide]$ publican print_unused_images 
> 
> DEBUG: Publican: config loaded
> 
> List of unused Image files in en-US
>     images/drupal_add_user.png
>     images/test—image.png
> 
> List of missing Image files in en-US
>     Common_Content/images/title_logo.svg
> 
> Note the f^^^ err... large boned dash in the test image name.

Ok, I'm still getting it on 3.2.1 but I have to build some RPMs and test the devel stuff anyway... ;)