googlefonts / googlefonts/fontmake
Loading Glyphs file failed: 'str' object has no attribute 'read'
- Dominant language
- Python
- Stars
- 888
- Forks
- 97
- Avg merge
- 4d 52m
- Merged PRs (30d)
- 1
Description
In Debian 12, when I build , test has many errors:
cd .pybuild/cpython3_3.11/build
python3.11 -m pytest tests
`
FAILED tests/test_main.py::test_main_export_custom_ufo_structure[package-False] - SystemExit: fontmake: Error: In 'tests/data/GlyphsUnitTestSans.glyphs': Loading Glyphs file failed: 'str' object has no attribute 'read'
FAILED tests/test_main.py::test_main_export_custom_ufo_structure[package-True] - SystemExit: fontmake: Error: In 'tests/data/GlyphsUnitTestSans.glyphs': Loading Glyphs file failed: 'str' object has no attribute 'read'
FAILED tests/test_main.py::test_main_export_custom_ufo_structure[zip-False] - SystemExit: fontmake: Error: In 'tests/data/GlyphsUnitTestSans.glyphs': Loading Glyphs file failed: 'str' object has no attribute 'read'
FAILED tests/test_main.py::test_main_export_custom_ufo_structure[zip-True] - SystemExit: fontmake: Error: In 'tests/data/GlyphsUnitTestSans.glyphs': Loading Glyphs file failed: 'str' object has no attribute 'read'
============================================== 39 failed, 38 passed, 6 skipped, 6 warnings in 8.39s ==============================================
`
Contributor guide
Research direction
Reproduce the failure with `python3.11 -m pytest tests` from `.pybuild/cpython3_3.11/build`, focusing first on `tests/test_main.py::test_main_export_custom_ufo_structure` and `tests/data/GlyphsUnitTestSans.glyphs`. Trace the loading path that reports `'str' object has no attribute 'read'`; done means the listed tests no longer fail during Glyphs file loading.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100