Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't print unicode escape sequences for non-ascii chars #1049

Closed
wants to merge 2 commits into from

Conversation

jamesls
Copy link
Member

@jamesls jamesls commented Dec 8, 2014

Also, we need to use the get_stdout_text_writer because of a
bug in py2.6 in which the .encoding attribute is not honored
for sys.stdout (http://bugs.python.org/issue4947).

Fixes #1048.

Also manually verified on py2.6:

$ aws --version
aws-cli/1.6.6 Python/2.6.8 Darwin/13.4.0
$ aws dynamodb scan --table-name testtable2 --output json
{
    "Count": 1,
    "Items": [
        {
            "foo": {
                "S": "✓"
            }
        }
    ],
    "ScannedCount": 1,
    "ConsumedCapacity": null
}

$ aws dynamodb scan --table-name testtable2 --output text
FOO ✓

$ aws dynamodb scan --table-name testtable2 --output table
-----------------------------------------------
|                    Scan                     |
+-------------------+--------+----------------+
| ConsumedCapacity  | Count  | ScannedCount   |
+-------------------+--------+----------------+
|  None             |  1     |  1             |
+-------------------+--------+----------------+
||                   Items                   ||
|||                   foo                   |||
||+-------------------+---------------------+||
|||  S                |  ✓                  |||
||+-------------------+---------------------+||

cc @kyleknap @danielgtaylor

Also, we need to use the get_stdout_text_writer because of a
bug in py2.6 in which the `.encoding` attribute is not honored
for `sys.stdout` (http://bugs.python.org/issue4947).

Fixes aws#1048.
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling a491787 on jamesls:print-unicode into d40e59b on aws:develop.

@kyleknap
Copy link
Contributor

kyleknap commented Dec 8, 2014

LGTM 🚢

@danielgtaylor
Copy link
Contributor

Looks good, :shipit:

@jamesls
Copy link
Member Author

jamesls commented Dec 9, 2014

Merged via f2191e9.

@jamesls jamesls closed this Dec 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON output should print unicode chars instead of escape sequences
4 participants