ponylang / library-documentation-action

:horse: Generates documentation for Pony libraries
BSD 2-Clause "Simplified" License
4 stars 3 forks source link

Fix variable shadowing in with block #24

Closed ergl closed 2 years ago

ergl commented 2 years ago

By shadowing corral_file inside the with block, we're changing its type form a string to a file descriptor.

If we error inside this block, we'll try to print the path of the corral file. Since it's no longer a string at that time, trying to concatenate it with other strings will fail with "TypeError: can only concatenate str (not "_io.TextIOWrapper") to str"

See error: https://github.com/ergl/pony-protobuf/runs/6708413752?check_suite_focus=true#step:4:46, which failed inside the except block when trying to read from a corral file without "documentation_url"

SeanTAllen commented 2 years ago

Thanks