awslabs / awslabs/aws-shell

Documentation generation fails on Python 2.6.9

Open
#131 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
7.3k
Forks
780
PR merge metrics
No merged PRs in 30d

Description

The HTML parser blows up when trying to generate documentation for the first time on v2.6.9.

```
First run, creating autocomplete index...
Traceback (most recent call last):
File "/Users/guymonj/.pyenv/versions/2.6.9/bin/aws-shell", line 9, in
load_entry_point('aws-shell', 'console_scripts', 'aws-shell')()
File "/Users/guymonj/Code/aws-shell/awsshell/__init__.py", line 47, in main
write_index(index_file)
File "/Users/guymonj/Code/aws-shell/awsshell/makeindex.py", line 67, in write_index
index_command(current, help_command)
File "/Users/guymonj/Code/aws-shell/awsshell/makeindex.py", line 59, in index_command
index_command(child, sub_help_command)
File "/Users/guymonj/Code/aws-shell/awsshell/makeindex.py", line 59, in index_command
index_command(child, sub_help_command)
File "/Users/guymonj/Code/aws-shell/awsshell/makeindex.py", line 40, in index_command
arg_obj.documentation.split('\n')[0])
File "/Users/guymonj/Code/aws-shell/awsshell/utils.py", line 22, in remove_html
s.feed(html)
File "/Users/guymonj/.pyenv/versions/2.6.9/lib/python2.6/HTMLParser.py", line 108, in feed
self.goahead(0)
File "/Users/guymonj/.pyenv/versions/2.6.9/lib/python2.6/HTMLParser.py", line 148, in goahead
k = self.parse_starttag(i)
File "/Users/guymonj/.pyenv/versions/2.6.9/lib/python2.6/HTMLParser.py", line 229, in parse_starttag
endpos = self.check_for_whole_start_tag(i)
File "/Users/guymonj/.pyenv/versions/2.6.9/lib/python2.6/HTMLParser.py", line 304, in check_for_whole_start_tag
self.error("malformed start tag")
File "/Users/guymonj/.pyenv/versions/2.6.9/lib/python2.6/HTMLParser.py", line 115, in error
raise HTMLParseError(message, self.getpos())
HTMLParser.HTMLParseError: malformed start tag, at line 1, column 275
```

The documentation causing the issue is `deploy push`:

> Required. Information about the location of the application revision to be uploaded to Amazon S3. You must specify both a bucket and a key that represent the Amazon S3 bucket name and the object key name. Content will be zipped before uploading. Use the format s3:///

Specifically: `Use the format s3://\/\` is being incorrectly interpreted as HTML
This can be seen on the online docs here:
http://docs.aws.amazon.com/cli/latest/reference/deploy/push.html
Which seems to strip the 'tags' to `Use the format s3:///`

This also affects the CLI docs as the parameter descriptions are missing after this option:

```
OPTIONS
--application-name (string) Required. The name of the AWS CodeDeploy
application to be associated with the application revision.

--s3-location (string)

--ignore-hidden-files | --no-ignore-hidden-files (boolean)

--source (string)

--description (string)
```

This appears to work properly on all other versions of Python (2.7, 3.3, 3.4, 3.5). The documentation on the CLI for these versions strips the documentation to `Use the format s3:///` much like the online docs, which is still not optimal.

Potentially related to #107, but this is a different error.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.