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

xml2rfc crash with empty artwork #370

Closed
ietf-svn-bot opened this issue Aug 31, 2018 · 7 comments
Closed

xml2rfc crash with empty artwork #370

ietf-svn-bot opened this issue Aug 31, 2018 · 7 comments
Labels
medium text Issues in text output

Comments

@ietf-svn-bot
Copy link

resolution_fixed type_defect | by miek@miek.nl


xml2rfc crashes if you create an empty file for the artwork to include.

% xml2rfc --v3 2100.xml
Parsing file 2100.xml
2100.xml(25): Error: Expected an <artwork> src= file at '/home/miek/g/src/github.com/mmarkdown/mmark/img.svg', but no such file exists
2100.xml(27): Error: Expected an <artwork> src= file at '/home/miek/g/src/github.com/mmarkdown/mmark/img.svg', but no such file exists
2100.xml(28): Error: Expected an <artwork> src= file at '/home/miek/g/src/github.com/mmarkdown/mmark/img.svg', but no such file exists
Created file 2100.txt

And then

touch img.svg

leads to

% xml2rfc --v3 2100.xml
Parsing file 2100.xml
Traceback (most recent call last):
  File "/usr/bin/xml2rfc", line 11, in <module>
    load_entry_point('xml2rfc==2.10.0', 'console_scripts', 'xml2rfc')()
  File "/usr/lib/python3/dist-packages/xml2rfc/run.py", line 382, in main
    xmlrfc.tree = prep.prep()
  File "/usr/lib/python3/dist-packages/xml2rfc/writers/preptool.py", line 353, in prep
    func(e, e.getparent())
  File "/usr/lib/python3/dist-packages/xml2rfc/writers/preptool.py", line 1457, in element_artwork
    debug.type('data')
NameError: name 'debug' is not defined

Issue migrated from trac:370 at 2022-02-05 12:46:03 +0000

@ietf-svn-bot
Copy link
Author

@miek@miek.nl uploaded file 2100.xml (1.3 KiB)

@ietf-svn-bot
Copy link
Author

@miek@miek.nl commented


The text rendering is also not that great

1.  Introduction

   (Artwork only available as None: <img.svg>)

   (Artwork only available as None: <img.svg>)(Artwork only available as None: <img.svg>)

                            Figure 1: Mama Mia.

@ietf-svn-bot
Copy link
Author

ietf-svn-bot commented Sep 15, 2018

@henrik@levkowetz.com commented


Replying to ietf-svn-conversion/xml2rfc#370 (comment:1):

The text rendering is also not that great

1.  Introduction

   (Artwork only available as None: <img.svg>)

   (Artwork only available as None: <img.svg>)(Artwork only available as None: <img.svg>)

                            Figure 1: Mama Mia.

Umm. I'm going to add a warning during preptool run when reading an empty artwork src file. But when we arrive at rendering, and have no text content, and no type value has been set, what would be a better message?

@ietf-svn-bot
Copy link
Author

@henrik@levkowetz.com commented


From a331fbf:

Added error messages for empty artwork files. Tweaked the error message for missing artwork text. Addresses issue #370

@ietf-svn-bot
Copy link
Author

@henrik@levkowetz.com changed status from new to closed

@ietf-svn-bot
Copy link
Author

@henrik@levkowetz.com changed resolution from `` to fixed

@ietf-svn-bot
Copy link
Author

@henrik@levkowetz.com commented


Lacking further input, I'm closing this as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium text Issues in text output
Projects
None yet
Development

No branches or pull requests

1 participant