Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

test_plaincontent_poundsign_utf8_8bit failing in Linux because of unexpected System preferred encoding #77

Closed
andrewferrier opened this issue Jul 1, 2015 · 4 comments
Labels

Comments

@andrewferrier
Copy link
Owner

Based on experiences with issue #76

@andrewferrier
Copy link
Owner Author

Discovered this is no longer just a procmail issue, can be recreated using test_plaincontent_poundsign_utf8_8bit inside Docker image.

@andrewferrier andrewferrier changed the title Create some docker-based tests to test procmail test_plaincontent_poundsign_utf8_8bit failing in Linux because of unexpected System preferred encoding Jul 6, 2015
@andrewferrier
Copy link
Owner Author

Some potential explanation here: http://stackoverflow.com/a/21968640/27641.

@andrewferrier
Copy link
Owner Author

Current output inside Linux Docker:

Checking if online... Yes.
Output examination directory: /tmp/tmp_qnzrqp6

INFO: Options used are: Namespace(add_prefix_date=False, attachments=True, body=True, enforce_syslog=False, headers=False, help=False, ignore_floating_attachments=False, inputFile='/tmp/tmpe7bnbj15', outputDirectory='/tmp/tmp1hl67e1x', outputFile='/tmp/tmp_qnzrqp6/plaincontent_poundsign_utf8_8bit.pdf', verbose=2)
INFO: Output file name is: /tmp/tmp_qnzrqp6/plaincontent_poundsign_utf8_8bit.pdf
DEBUG: System preferred encoding is: ANSI_X3.4-1968
Traceback (most recent call last):
  File "/tmp/email2pdf/email2pdf", line 575, in call_main
    main(argv, syslog_handler, syserr_handler)
  File "/tmp/email2pdf/email2pdf", line 86, in main
    input_data = get_input_data(args)
  File "/tmp/email2pdf/email2pdf", line 205, in get_input_data
    data = input_handle.read()
  File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 214: ordinal not in range(128)

F
======================================================================
FAIL: test_plaincontent_poundsign_utf8_8bit (tests.Subprocess.test_Subprocess_MIME.TestMIME)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/email2pdf/tests/Subprocess/test_Subprocess_MIME.py", line 33, in test_plaincontent_poundsign_utf8_8bit
    self.assertEqual(0, rc)
AssertionError: 0 != 3

@andrewferrier
Copy link
Owner Author

This is the same issue as #76 after all; needs to be resolved by providing an --input-encoding switch (along with some docs). Closing this a duplicate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant