writing text does not correctly handle zero length strings
Open
- Dominant language
- Python
- Stars
- 5
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
The following creates incorrect output:
```python
import roffio
contents = {"tagname": [("keyname", "")]}
roffio.write("file.roff", contents, roff_format=roffio.Format.ASCII)
print(roffio.read("file.roff"))
```
produces `{'filedata': {'byteswaptest': 1, 'creationDate': '13/12/2024 11:54:11'}, 'version': {'major': 2, 'minor': 0}, 'tagname': {'keyname': '"'}, 'eof': {}}`
Contributor guide
Research direction
Start by running the Python example and inspecting the roffio.write/read round trip for the empty string in the tagname/keyname entry. Trace how zero-length text is written and read; done means the round trip preserves the empty string instead of producing a quote character.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100