hassanakbar4 / tractive-test

0 stars 0 forks source link

xml2rfc crash with empty artwork #370

Closed hassanakbar4 closed 2 years ago

hassanakbar4 commented 6 years ago

component_Version_3_cli_txt 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 2021-10-20 18:29:19 +0500

hassanakbar4 commented 6 years ago

@{"email"=>"miek@miek.nl", "name"=>nil, "username"=>nil} uploaded file 2100.xml (1.3 KiB)

hassanakbar4 commented 6 years ago

@{"email"=>"miek@miek.nl", "name"=>nil, "username"=>nil} 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.
hassanakbar4 commented 5 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} commented


Replying to hassanakbar4/tractive-test#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?

hassanakbar4 commented 5 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} commented


From [2563]:

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

hassanakbar4 commented 5 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} changed status from new to closed

hassanakbar4 commented 5 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} changed resolution from ` tofixed`

hassanakbar4 commented 5 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} commented


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