[Desktop-packages] [Bug 1564317] Re: Successful return code on encoding error
I haven't reported it to Debian, I did not have a test system to confirm that it is present there as well (I'm quite sure it would be present, it is the same package source) (And https://www.debian.org/Bugs/Reporting for manual reporting seems quite scary...) -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to html2text in Ubuntu. https://bugs.launchpad.net/bugs/1564317 Title: Successful return code on encoding error Status in One Hundred Papercuts: New Status in html2text package in Ubuntu: Confirmed Bug description: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input- encoding.patch OS: Ubuntu 14.04 / Ubuntu 16.04 Package: html2text-1.3.2a-17 / html2text-1.3.2a-18 To manage notifications about this bug go to: https://bugs.launchpad.net/hundredpapercuts/+bug/1564317/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1564317] Re: Successful return code on encoding error
Confirmed on Debian 8: $ curl -s https://launchpadlibrarian.net/250515419/test.html | html2text; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test��?) 0 -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to html2text in Ubuntu. https://bugs.launchpad.net/bugs/1564317 Title: Successful return code on encoding error Status in One Hundred Papercuts: New Status in html2text package in Ubuntu: Confirmed Bug description: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input- encoding.patch OS: Ubuntu 14.04 / Ubuntu 16.04 Package: html2text-1.3.2a-17 / html2text-1.3.2a-18 To manage notifications about this bug go to: https://bugs.launchpad.net/hundredpapercuts/+bug/1564317/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1564317] Re: Successful return code on encoding error
Gert, you're right, my bad. I get the full picture now. Have you reported this to the Debian bugtracker? -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to html2text in Ubuntu. https://bugs.launchpad.net/bugs/1564317 Title: Successful return code on encoding error Status in One Hundred Papercuts: New Status in html2text package in Ubuntu: Confirmed Bug description: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input- encoding.patch OS: Ubuntu 14.04 / Ubuntu 16.04 Package: html2text-1.3.2a-17 / html2text-1.3.2a-18 To manage notifications about this bug go to: https://bugs.launchpad.net/hundredpapercuts/+bug/1564317/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1564317] Re: Successful return code on encoding error
@Roland: Incorrect upstream, that is python-html2text / python3-html2text. This is from http://www.mbayer.de/html2text/ (And that won't have the issue, since it was introduced in Debian's UTF-8 patch) (Debian might also be affected though) -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to html2text in Ubuntu. https://bugs.launchpad.net/bugs/1564317 Title: Successful return code on encoding error Status in One Hundred Papercuts: New Status in html2text package in Ubuntu: Confirmed Bug description: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input- encoding.patch OS: Ubuntu 14.04 / Ubuntu 16.04 Package: html2text-1.3.2a-17 / html2text-1.3.2a-18 To manage notifications about this bug go to: https://bugs.launchpad.net/hundredpapercuts/+bug/1564317/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1564317] Re: Successful return code on encoding error
I logged this upstream at https://github.com/Alir3z4/html2text/issues/156 as well. ** Bug watch added: github.com/Alir3z4/html2text/issues #156 https://github.com/Alir3z4/html2text/issues/156 -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to html2text in Ubuntu. https://bugs.launchpad.net/bugs/1564317 Title: Successful return code on encoding error Status in One Hundred Papercuts: New Status in html2text package in Ubuntu: Confirmed Bug description: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input- encoding.patch OS: Ubuntu 14.04 / Ubuntu 16.04 Package: html2text-1.3.2a-17 / html2text-1.3.2a-18 To manage notifications about this bug go to: https://bugs.launchpad.net/hundredpapercuts/+bug/1564317/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1564317] Re: Successful return code on encoding error
I can confirm the same incorrect response on Ubuntu 14.04.5 LTS with all updates installed. -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to html2text in Ubuntu. https://bugs.launchpad.net/bugs/1564317 Title: Successful return code on encoding error Status in One Hundred Papercuts: New Status in html2text package in Ubuntu: Confirmed Bug description: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input- encoding.patch OS: Ubuntu 14.04 / Ubuntu 16.04 Package: html2text-1.3.2a-17 / html2text-1.3.2a-18 To manage notifications about this bug go to: https://bugs.launchpad.net/hundredpapercuts/+bug/1564317/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1564317] Re: Successful return code on encoding error
Status changed to 'Confirmed' because the bug affects multiple users. ** Changed in: html2text (Ubuntu) Status: New => Confirmed -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to html2text in Ubuntu. https://bugs.launchpad.net/bugs/1564317 Title: Successful return code on encoding error Status in One Hundred Papercuts: New Status in html2text package in Ubuntu: Confirmed Bug description: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input- encoding.patch OS: Ubuntu 14.04 / Ubuntu 16.04 Package: html2text-1.3.2a-17 / html2text-1.3.2a-18 To manage notifications about this bug go to: https://bugs.launchpad.net/hundredpapercuts/+bug/1564317/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1564317] Re: Successful return code on encoding error
Also affects 1.3.2a-18 on Ubuntu 16.04. ** Description changed: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input-encoding.patch - OS: Ubuntu 14.04 - Package: html2text-1.3.2a-17 + OS: Ubuntu 14.04 / Ubuntu 16.04 + Package: html2text-1.3.2a-17 / html2text-1.3.2a-18 -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to html2text in Ubuntu. https://bugs.launchpad.net/bugs/1564317 Title: Successful return code on encoding error Status in One Hundred Papercuts: New Status in html2text package in Ubuntu: New Bug description: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input- encoding.patch OS: Ubuntu 14.04 / Ubuntu 16.04 Package: html2text-1.3.2a-17 / html2text-1.3.2a-18 To manage notifications about this bug go to: https://bugs.launchpad.net/hundredpapercuts/+bug/1564317/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1564317] Re: Successful return code on encoding error
Note: This is probably also present in Debian, since it seems like the Ubuntu package is mostly unmodified. ** Also affects: hundredpapercuts Importance: Undecided Status: New -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to html2text in Ubuntu. https://bugs.launchpad.net/bugs/1564317 Title: Successful return code on encoding error Status in One Hundred Papercuts: New Status in html2text package in Ubuntu: New Bug description: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input- encoding.patch OS: Ubuntu 14.04 Package: html2text-1.3.2a-17 To manage notifications about this bug go to: https://bugs.launchpad.net/hundredpapercuts/+bug/1564317/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1564317] Re: Successful return code on encoding error
The attachment "Patch to modify patches to return an error code on recoding errors" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team. [This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.] ** Tags added: patch -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to html2text in Ubuntu. https://bugs.launchpad.net/bugs/1564317 Title: Successful return code on encoding error Status in html2text package in Ubuntu: New Bug description: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input- encoding.patch OS: Ubuntu 14.04 Package: html2text-1.3.2a-17 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/html2text/+bug/1564317/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1564317] Re: Successful return code on encoding error
My attempt at an actual patch. The other method, of actually changing all the error handling to save that there have been an error and returning the code at the end might still make sense for later. ** Patch added: "Patch to modify patches to return an error code on recoding errors" https://bugs.launchpad.net/ubuntu/+source/html2text/+bug/1564317/+attachment/4619089/+files/htmltext-encoding-error-code.patch -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to html2text in Ubuntu. https://bugs.launchpad.net/bugs/1564317 Title: Successful return code on encoding error Status in html2text package in Ubuntu: New Bug description: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input- encoding.patch OS: Ubuntu 14.04 Package: html2text-1.3.2a-17 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/html2text/+bug/1564317/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1564317] Re: Successful return code on encoding error
Diffs for patch files: (for simple fix - return 2 for recoding error, don't attempt to continue to other files) (The problem seems to be present to at least the precise version) --- 611-recognize-input-encoding.patch.orig 2016-03-31 18:25:01.914598768 +0200 +++ 611-recognize-input-encoding.patch 2016-03-31 18:25:56.277593065 +0200 @@ -271,7 +271,7 @@ + } + if (!result) + { -+ continue; ++ exit(2); + } + +if (number_of_input_urls != 1) { --- 630-recode-output-to-locale-charset.patch.orig 2016-03-31 18:25:11.939150917 +0200 +++ 630-recode-output-to-locale-charset.patch 2016-03-31 18:26:08.926289750 +0200 @@ -75,7 +75,7 @@ + result = recode(output_stream, output_encoding, "UTF-8"); + if (!result) + { -+ continue; ++ exit(2); + } + } + output_stream.clear(); -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to html2text in Ubuntu. https://bugs.launchpad.net/bugs/1564317 Title: Successful return code on encoding error Status in html2text package in Ubuntu: New Bug description: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input- encoding.patch OS: Ubuntu 14.04 Package: html2text-1.3.2a-17 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/html2text/+bug/1564317/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1564317] Re: Successful return code on encoding error
The simplest fix is to replace the "continue" in the recode error handlers with "exit(1)" (Patched html2text.C lines 595 and 555). (Using a different value for encoding errors might be useful) This makes the error handling consistent with other cases, like failing to open a file. (See line 482) A better solution would be to keep track of whether an error occurred in the loop and then change the final return value based on that. (Requiring changes to add a variable declaration, and on lines 482, 510, 555, 582 and 595) (Line numbers are from the patched Wily version) -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to html2text in Ubuntu. https://bugs.launchpad.net/bugs/1564317 Title: Successful return code on encoding error Status in html2text package in Ubuntu: New Bug description: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input- encoding.patch OS: Ubuntu 14.04 Package: html2text-1.3.2a-17 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/html2text/+bug/1564317/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1564317] Re: Successful return code on encoding error
Quick method to test: sudo apt-get install html2text curl -s https://launchpadlibrarian.net/250515419/test.html | html2text; echo $? -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to html2text in Ubuntu. https://bugs.launchpad.net/bugs/1564317 Title: Successful return code on encoding error Status in html2text package in Ubuntu: New Bug description: When running html2text on a file with incorrect encoding (e.g. indicated as us-ascii, but actually UTF-8), it fails with an error message but returns a successful result code (0). Actual output: - $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 0 Expected output: (substitute 1 for any appropriate failure code) -- $ html2text test.html; echo $? Input recoding failed due to invalid input sequence. Unconverted part of text follows. “Test”) 1 This seem to have been introduced by 611-recognize-input- encoding.patch OS: Ubuntu 14.04 Package: html2text-1.3.2a-17 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/html2text/+bug/1564317/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp