← pod_r5_v1i

rich_2725

resolved RESOLVED PASS · 18 tool calls · 128 s · Textualize/rich

Task input

fix table rendering order of box elements

## Type of changes

- [x] Bug fix
- [ ] New feature
- [ ] Documentation / docstrings
- [x] Tests
- [ ] Other

## Checklist

- [x] I've run the latest [black](https://github.com/psf/black) with default args on new code.
- [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
- [x] I've added tests for new code.
- [x] I accept that @willmcgugan may be pedantic in the code review.

## Description

* Previously "mid" box elements appeared in last line of table (footer), while "footer" box elements appeared mid table body. Reversed that order so mid is truly mid, footer is truly footer.
* Tested with:

    ```
    table.box.head_left = '1'
    table.box.head_vertical = '2'
    table.box.head_right = '3'

    table.box.mid_left = '4'
    table.box.mid_vertical = '5'
    table.box.mid_right = '6'

    table.box.foot_left = '7'
    table.box.foot_vertical = '8'
    table.box.foot_right = '9'
    ```

  After change, correct ordering:

    ```
    +--------------------------------------------------------------------------+
    1Date        2Title                            2  Production2    Box Office3
    |------------ --------------------------------- ------------ --------------|
    4Dec 20, 20195Star Wars: The Rise of Skywalker 5$275,000,0005  $375,126,1186
    4May 25, 20185Solo: A Star Wars Story          5$275,000,0005  $393,151,3476
    7Dec 15, 20178Star Wars Ep. VIII: The Last Jedi8$262,000,0008$1,332,539,8899
    +--------------------------------------------------------------------------+
    ```

* All non-skipped prior automated tests pass. No automated tests added. Unclear that additional test for box ordering would add proportionate value.

Tool calls (19)

#ToolArgumentsResult
1run_command
{
 "command": "grep -rn 'Box' --include=*.py rich/table.py || echo 'Not found'"
}
{"status": "ok", "stdout": "rich/table.py:47: box (box.Box, optional): One of the constants in box.py used to draw the edges (see :ref:`appendix_box`), or ``Non
full
{"status": "ok", "stdout": "rich/table.py:47:        box (box.Box, optional): One of the constants in box.py used to draw the edges (see :ref:`appendix_box`), or ``None`` for no box lines. Defaults to box.HEAVY_HEAD.\nrich/table.py:160:        box (box.Box, optional): One of the constants in box.py used to draw the edges (see :ref:`appendix_box`), or ``None`` for no box lines. Defaults to box.HEAVY_HEAD.\nrich/table.py:193:        box: Optional[box.Box] = box.HEAVY_HEAD,\nrich/table.py:940:        table.add_column(\"Box Office\", justify=\"right\", style=\"green\")\n", "stderr": "", "exit_code": 0}
2run_command
{
 "command": "grep -n 'mid_left' rich/table.py || echo 'Not found'"
}
{"status": "ok", "stdout": "784: _Segment(_box.mid_left, border_style),\n", "stderr": "", "exit_code": 0}
full
{"status": "ok", "stdout": "784:                    _Segment(_box.mid_left, border_style),\n", "stderr": "", "exit_code": 0}
3run_command
{
 "command": "sed -n '750,850p' rich/table.py"
}
{"status": "ok", "stdout": " )\n row_cells: List[Tuple[_Cell, ...]] = list(zip(*_column_cells))\n _box = (\n self.box.substitute(\n options, safe=pick_bool(self
full
{"status": "ok", "stdout": "        )\n        row_cells: List[Tuple[_Cell, ...]] = list(zip(*_column_cells))\n        _box = (\n            self.box.substitute(\n                options, safe=pick_bool(self.safe_box, console.safe_box)\n            )\n            if self.box\n            else None\n        )\n        _box = _box.get_plain_headed_box() if _box and not self.show_header else _box\n\n        new_line = Segment.line()\n\n        columns = self.columns\n        show_header = self.show_header\n        show_footer = self.show_footer\n        show_edge = self.show_edge\n        show_lines = self.show_lines\n        leading = self.leading\n\n        _Segment = Segment\n        if _box:\n            box_segments = [\n                (\n                    _Segment(_box.head_left, border_style),\n                    _Segment(_box.head_right, border_style),\n                    _Segment(_box.head_vertical, border_style),\n                ),\n                (\n                    _Segment(_box.foot_left, border_style),\n                    _Segment(_box.foot_right, border_style),\n                    _Segment(_box.foot_vertical, border_style),\n                ),\n                (\n                    _Segment(_box.mid_left, border_style),\n                    _Segment(_box.mid_right, border_style),\n                    _Segment(_box.mid_vertical, border_style),\n                ),\n            ]\n            if show_edge:\n                yield _Segment(_box.get_top(widths), border_style)\n                yield new_line\n        else:\n            box_segments = []\n\n        get_row_style = self.get_row_style\n        get_style = console.get_style\n\n        for index, (first, last, row_cell) in enumerate(loop_first_last(row_cells)):\n            header_row = first and show_header\n            footer_row = last and show_footer\n            row = (\n                self.rows[index - show_header]\n                if (not header_row and not footer_row)\n        
4run_command
{
 "command": "sed -n '850,950p' rich/table.py"
}
{"status": "ok", "stdout": " _Segment.set_shape(\n align_cell(\n cell,\n _cell.vertical,\n width,\n get_style(_cell.style) + row_style,\n ),\n width,\n max_heig
full
{"status": "ok", "stdout": "                _Segment.set_shape(\n                    align_cell(\n                        cell,\n                        _cell.vertical,\n                        width,\n                        get_style(_cell.style) + row_style,\n                    ),\n                    width,\n                    max_height,\n                )\n                for width, _cell, cell, column in zip(widths, row_cell, cells, columns)\n            ]\n\n            if _box:\n                if last and show_footer:\n                    yield _Segment(\n                        _box.get_row(widths, \"foot\", edge=show_edge), border_style\n                    )\n                    yield new_line\n                left, right, _divider = box_segments[0 if first else (2 if last else 1)]\n\n                # If the column divider is whitespace also style it with the row background\n                divider = (\n                    _divider\n                    if _divider.text.strip()\n                    else _Segment(\n                        _divider.text, row_style.background_style + _divider.style\n                    )\n                )\n                for line_no in range(max_height):\n                    if show_edge:\n                        yield left\n                    for last_cell, rendered_cell in loop_last(cells):\n                        yield from rendered_cell[line_no]\n                        if not last_cell:\n                            yield divider\n                    if show_edge:\n                        yield right\n                    yield new_line\n            else:\n                for line_no in range(max_height):\n                    for rendered_cell in cells:\n                        yield from rendered_cell[line_no]\n                    yield new_line\n            if _box and first and show_header:\n                yield _Segment(\n                    _box.get_row(widths, \"head\", edge=show_edge), border_style\n      
5run_command
{
 "command": "cat > /tmp/repro.py <<'PY'\nfrom rich.console import Console\nfrom rich.table import Table\nfrom rich import box\n\nconsole = Console(force_terminal=True)\ntable = Table()\ntable.box = box.Box(\n    head_left='1', head_vertical='2', head_right='3',\n    mid_left='4', mid_vertical='5', mid_right='6',\n    foot_left='7', foot_vertical='8', foot_right='9'\n)\n\ntable.add_column(\"Date\")\ntable.add_column(\"Title\")\ntable.add_column(\"Production\")\ntable.add_column(\"Box Office\")\n\ntable.add_row(\"Dec 20, 2019\", \"Star Wars: The Rise of Skywalker\", \"$275,000,000\", \"$375,126,118\")\ntable.add_row(\"May 25, 2018\", \"Solo: A Star Wars Story\", \"$275,000,000\", \"$393,151,347\")\ntable.add_row(\"Dec 15, 2017\", \"Star Wars Ep. VIII: The Last Jedi\", \"$262,000,000\", \"$1,332,539,889\")\n\n# To ensure foot is triggered, we might need to enable show_footer=True\n# But the provided example uses a table with 3 rows. \n# If show_footer=False (default), the last row is still the 'last' row in loop_first_last.\n# Let's see what happens.\n\nconsole.print(table)\nPY\npython3 /tmp/repro.py\n"
}
{"status": "error", "error_type": "CommandError", "error_message": "Traceback (most recent call last):\n File \"/tmp/repro.py\", line 7, in <module>\n table.box
full
{"status": "error", "error_type": "CommandError", "error_message": "Traceback (most recent call last):\n  File \"/tmp/repro.py\", line 7, in <module>\n    table.box = box.Box(\n                ~~~~~~~^\n        head_left='1', head_vertical='2', head_right='3',\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        mid_left='4', mid_vertical='5', mid_right='6',\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        foot_left='7', foot_vertical='8', foot_right='9'\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    )\n    ^\nTypeError: Box.__init__() got an unexpected keyword argument 'head_left'\n", "details": {"stdout": "", "stderr": "Traceback (most recent call last):\n  File \"/tmp/repro.py\", line 7, in <module>\n    table.box = box.Box(\n                ~~~~~~~^\n        head_left='1', head_vertical='2', head_right='3',\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        mid_left='4', mid_vertical='5', mid_right='6',\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        foot_left='7', foot_vertical='8', foot_right='9'\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    )\n    ^\nTypeError: Box.__init__() got an unexpected keyword argument 'head_left'\n", "exit_code": 1}}
6run_command
{
 "command": "grep -rn 'class Box' rich/box.py || echo 'Not found'"
}
{"status": "ok", "stdout": "rich/box.py:16:class Box:\n", "stderr": "", "exit_code": 0}
full
{"status": "ok", "stdout": "rich/box.py:16:class Box:\n", "stderr": "", "exit_code": 0}
7run_command
{
 "command": "sed -n '16,60p' rich/box.py"
}
{"status": "ok", "stdout": "class Box:\n \"\"\"Defines characters to render boxes.\n\n \u250c\u2500\u252c\u2510 top\n \u2502 \u2502\u2502 head\n \u251c\u2500\u2
full
{"status": "ok", "stdout": "class Box:\n    \"\"\"Defines characters to render boxes.\n\n    \u250c\u2500\u252c\u2510 top\n    \u2502 \u2502\u2502 head\n    \u251c\u2500\u253c\u2524 head_row\n    \u2502 \u2502\u2502 mid\n    \u251c\u2500\u253c\u2524 row\n    \u251c\u2500\u253c\u2524 foot_row\n    \u2502 \u2502\u2502 foot\n    \u2514\u2500\u2534\u2518 bottom\n\n    Args:\n        box (str): Characters making up box.\n        ascii (bool, optional): True if this box uses ascii characters only. Default is False.\n    \"\"\"\n\n    def __init__(self, box: str, *, ascii: bool = False) -> None:\n        self._box = box\n        self.ascii = ascii\n        line1, line2, line3, line4, line5, line6, line7, line8 = box.splitlines()\n        # top\n        self.top_left, self.top, self.top_divider, self.top_right = iter(line1)\n        # head\n        self.head_left, _, self.head_vertical, self.head_right = iter(line2)\n        # head_row\n        (\n            self.head_row_left,\n            self.head_row_horizontal,\n            self.head_row_cross,\n            self.head_row_right,\n        ) = iter(line3)\n\n        # mid\n        self.mid_left, _, self.mid_vertical, self.mid_right = iter(line4)\n        # row\n        self.row_left, self.row_horizontal, self.row_cross, self.row_right = iter(line5)\n        # foot_row\n        (\n            self.foot_row_left,\n            self.foot_row_horizontal,\n            self.foot_row_cross,\n            self.foot_row_right,\n        ) = iter(line6)\n        # foot\n", "stderr": "", "exit_code": 0}
8run_command
{
 "command": "cat > /tmp/repro.py <<'PY'\nfrom rich.console import Console\nfrom rich.table import Table\nfrom rich import box\n\nconsole = Console(force_terminal=True)\ntable = Table()\n\n# Creating a custom Box by providing a string with 8 lines\n# Line 1: top\n# Line 2: head\n# Line 3: head_row\n# Line 4: mid\n# Line 5: row\n# Line 6: foot_row\n# Line 7: foot\n# Line 8: bottom\ncustom_box_str = (\n    \"AAAA\\n\" # top\n    \"123\\n\"  # head (head_left, _, head_vertical, head_right) - Wait, head is 3 chars in the Box class init\n    \"BBBB\\n\" # head_row\n    \"456\\n\"  # mid (mid_left, _, mid_vertical, mid_right)\n    \"CCCC\\n\" # row\n    \"DDDD\\n\" # foot_row\n    \"789\\n\"  # foot (foot_left, _, foot_vertical, foot_right)\n    \"EEEE\\n\" # bottom\n)\n# Wait, let's check Box.__init__ again.\n# self.head_left, _, self.head_vertical, self.head_right = iter(line2)\n# That's 4 characters.\n\ncustom_box_str = (\n    \"TL---TR\\n\" # top: top_left, top, top_divider, top_right\n    \"1.23\\n\"    # head: head_left, _, head_vertical, head_right\n    \"HL-HR\\n\"   # head_row\n    \"4.56\\n\"    # mid: mid_left, _, mid_vertical, mid_right\n    \"RL-RR\\n\"   # row\n    \"FL-FR\\n\"   # foot_row\n    \"7.89\\n\"    # foot: foot_left, _, foot_vertical, foot_right\n    \"BL---BR\\n\" # bottom\n)\n\ntable.box = box.Box(custom_box_str)\n\ntable.add_column(\"Date\")\ntable.add_column(\"Title\")\ntable.add_column(\"Production\")\ntable.add_column(\"Box Office\")\n\ntable.add_row(\"Dec 20, 2019\", \"Star Wars: The Rise of Skywalker\", \"$275,000,000\", \"$375,126,118\")\ntable.add_row(\"May 25, 2018\", \"Solo: A Star Wars Story\", \"$275,000,000\", \"$393,151,347\")\ntable.add_row(\"Dec 15, 2017\", \"Star Wars Ep. VIII: The Last Jedi\", \"$262,000,000\", \"$1,332,539,889\")\n\nconsole.print(table)\nPY\npython3 /tmp/repro.py\n"
}
{"status": "error", "error_type": "CommandError", "error_message": "Traceback (most recent call last):\n File \"/tmp/repro.py\", line 42, in <module>\n table.bo
full
{"status": "error", "error_type": "CommandError", "error_message": "Traceback (most recent call last):\n  File \"/tmp/repro.py\", line 42, in <module>\n    table.box = box.Box(custom_box_str)\n                ~~~~~~~^^^^^^^^^^^^^^^^\n  File \"/workspace/rich/box.py\", line 38, in __init__\n    self.top_left, self.top, self.top_divider, self.top_right = iter(line1)\n    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nValueError: too many values to unpack (expected 4)\n", "details": {"stdout": "", "stderr": "Traceback (most recent call last):\n  File \"/tmp/repro.py\", line 42, in <module>\n    table.box = box.Box(custom_box_str)\n                ~~~~~~~^^^^^^^^^^^^^^^^\n  File \"/workspace/rich/box.py\", line 38, in __init__\n    self.top_left, self.top, self.top_divider, self.top_right = iter(line1)\n    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nValueError: too many values to unpack (expected 4)\n", "exit_code": 1}}
9run_command
{
 "command": "cat > /tmp/repro.py <<'PY'\nfrom rich.console import Console\nfrom rich.table import Table\nfrom rich import box\n\nconsole = Console(force_terminal=True)\ntable = Table()\n\n# Line 1: top (4 chars)\n# Line 2: head (4 chars: head_left, _, head_vertical, head_right)\n# Line 3: head_row (4 chars)\n# Line 4: mid (4 chars: mid_left, _, mid_vertical, mid_right)\n# Line 5: row (4 chars)\n# Line 6: foot_row (4 chars)\n# Line 7: foot (4 chars: foot_left, _, foot_vertical, foot_right)\n# Line 8: bottom (4 chars)\n\ncustom_box_str = (\n    \"1234\\n\" # top\n    \"1.23\\n\" # head\n    \"1234\\n\" # head_row\n    \"4.56\\n\" # mid\n    \"1234\\n\" # row\n    \"1234\\n\" # foot_row\n    \"7.89\\n\" # foot\n    \"1234\\n\" # bottom\n)\n\ntable.box = box.Box(custom_box_str)\n\ntable.add_column(\"Date\")\ntable.add_column(\"Title\")\ntable.add_column(\"Production\")\ntable.add_column(\"Box Office\")\n\ntable.add_row(\"Dec 20, 2019\", \"Star Wars: The Rise of Skywalker\", \"$275,000,000\", \"$375,126,118\")\ntable.add_row(\"May 25, 2018\", \"Solo: A Star Wars Story\", \"$275,000,000\", \"$393,151,347\")\ntable.add_row(\"Dec 15, 2017\", \"Star Wars Ep. VIII: The Last Jedi\", \"$262,000,000\", \"$1,332,539,889\")\n\nconsole.print(table)\nPY\npython3 /tmp/repro.py\n"
}
{"status": "ok", "stdout": "12222222222222232222222222222222222222222222222322222222222222322222222222222224\n1 Date 2 Title 2 Production 2 Box Office 3\n122222
full
{"status": "ok", "stdout": "12222222222222232222222222222222222222222222222322222222222222322222222222222224\n1 Date         2 Title                         2 Production   2 Box Office     3\n12222222222222232222222222222222222222222222222322222222222222322222222222222224\n7 Dec 20, 2019 8 Star Wars: The Rise of        8 $275,000,000 8 $375,126,118   9\n7              8 Skywalker                     8              8                9\n7 May 25, 2018 8 Solo: A Star Wars Story       8 $275,000,000 8 $393,151,347   9\n4 Dec 15, 2017 5 Star Wars Ep. VIII: The Last  5 $262,000,000 5 $1,332,539,889 6\n4              5 Jedi                          5              5                6\n12222222222222232222222222222222222222222222222322222222222222322222222222222224\n", "stderr": "", "exit_code": 0}
10run_command
{
 "command": "sed -n '765,780p' rich/table.py"
}
{"status": "ok", "stdout": " show_footer = self.show_footer\n show_edge = self.show_edge\n show_lines = self.show_lines\n leading = self.leading\n\n _Segment =
full
{"status": "ok", "stdout": "        show_footer = self.show_footer\n        show_edge = self.show_edge\n        show_lines = self.show_lines\n        leading = self.leading\n\n        _Segment = Segment\n        if _box:\n            box_segments = [\n                (\n                    _Segment(_box.head_left, border_style),\n                    _Segment(_box.head_right, border_style),\n                    _Segment(_box.head_vertical, border_style),\n                ),\n                (\n                    _Segment(_box.foot_left, border_style),\n                    _Segment(_box.foot_right, border_style),\n", "stderr": "", "exit_code": 0}
11run_command
{
 "command": "sed -n '780,795p' rich/table.py"
}
{"status": "ok", "stdout": " _Segment(_box.foot_right, border_style),\n _Segment(_box.foot_vertical, border_style),\n ),\n (\n _Segment(_box.mid_left, border_st
full
{"status": "ok", "stdout": "                    _Segment(_box.foot_right, border_style),\n                    _Segment(_box.foot_vertical, border_style),\n                ),\n                (\n                    _Segment(_box.mid_left, border_style),\n                    _Segment(_box.mid_right, border_style),\n                    _Segment(_box.mid_vertical, border_style),\n                ),\n            ]\n            if show_edge:\n                yield _Segment(_box.get_top(widths), border_style)\n                yield new_line\n        else:\n            box_segments = []\n\n        get_row_style = self.get_row_style\n", "stderr": "", "exit_code": 0}
12run_command
{
 "command": "sed -n '860,875p' rich/table.py"
}
{"status": "ok", "stdout": " for width, _cell, cell, column in zip(widths, row_cell, cells, columns)\n ]\n\n if _box:\n if last and show_footer:\n yield _Segmen
full
{"status": "ok", "stdout": "                for width, _cell, cell, column in zip(widths, row_cell, cells, columns)\n            ]\n\n            if _box:\n                if last and show_footer:\n                    yield _Segment(\n                        _box.get_row(widths, \"foot\", edge=show_edge), border_style\n                    )\n                    yield new_line\n                left, right, _divider = box_segments[0 if first else (2 if last else 1)]\n\n                # If the column divider is whitespace also style it with the row background\n                divider = (\n                    _divider\n                    if _divider.text.strip()\n                    else _Segment(\n", "stderr": "", "exit_code": 0}
13run_command
{
 "command": "python3 - <<'PY'\nfrom pathlib import Path\np = Path(\"rich/table.py\"); s = p.read_text()\nold = \"\"\"            box_segments = [\n                (\n                    _Segment(_box.head_left, border_style),\n                    _Segment(_box.head_right, border_style),\n                    _Segment(_box.head_vertical, border_style),\n                ),\n                (\n                    _Segment(_box.foot_left, border_style),\n                    _Segment(_box.foot_right, border_style),\n                    _Segment(_box.foot_vertical, border_style),\n                ),\n                (\n                    _Segment(_box.mid_left, border_style),\n                    _Segment(_box.mid_right, border_style),\n                    _Segment(_box.mid_vertical, border_style),\n                ),\n            ]\"\"\"\nnew = \"\"\"            box_segments = [\n                (\n                    _Segment(_box.head_left, border_style),\n                    _Segment(_box.head_right, border_style),\n                    _Segment(_box.head_vertical, border_style),\n                ),\n                (\n                    _Segment(_box.mid_left, border_style),\n                    _Segment(_box.mid_right, border_style),\n                    _Segment(_box.mid_vertical, border_style),\n                ),\n                (\n                    _Segment(_box.foot_left, border_style),\n                    _Segment(_box.foot_right, border_style),\n                    _Segment(_box.foot_vertical, border_style),\n                ),\n            ]\"\"\"\nassert s.count(old) == 1, (\"old text found this many times:\", s.count(old))\nt = s.replace(old, new); compile(t, str(p), \"exec\"); p.write_text(t)\nPY\n"
}
{"status": "ok", "stdout": "", "stderr": "", "exit_code": 0}
full
{"status": "ok", "stdout": "", "stderr": "", "exit_code": 0}
14run_command
{
 "command": "python3 /tmp/repro.py"
}
{"status": "ok", "stdout": "12222222222222232222222222222222222222222222222322222222222222322222222222222224\n1 Date 2 Title 2 Production 2 Box Office 3\n122222
full
{"status": "ok", "stdout": "12222222222222232222222222222222222222222222222322222222222222322222222222222224\n1 Date         2 Title                         2 Production   2 Box Office     3\n12222222222222232222222222222222222222222222222322222222222222322222222222222224\n4 Dec 20, 2019 5 Star Wars: The Rise of        5 $275,000,000 5 $375,126,118   6\n4              5 Skywalker                     5              5                6\n4 May 25, 2018 5 Solo: A Star Wars Story       5 $275,000,000 5 $393,151,347   6\n7 Dec 15, 2017 8 Star Wars Ep. VIII: The Last  8 $262,000,000 8 $1,332,539,889 9\n7              8 Jedi                          8              8                9\n12222222222222232222222222222222222222222222222322222222222222322222222222222224\n", "stderr": "", "exit_code": 0}
15run_command
{
 "command": "git diff"
}
{"status": "ok", "stdout": "diff --git a/rich/table.py b/rich/table.py\nindex fe4054cf..44e457be 100644\n--- a/rich/table.py\n+++ b/rich/table.py\n@@ -775,16 +7
full
{"status": "ok", "stdout": "diff --git a/rich/table.py b/rich/table.py\nindex fe4054cf..44e457be 100644\n--- a/rich/table.py\n+++ b/rich/table.py\n@@ -775,16 +775,16 @@ class Table(JupyterMixin):\n                     _Segment(_box.head_right, border_style),\n                     _Segment(_box.head_vertical, border_style),\n                 ),\n-                (\n-                    _Segment(_box.foot_left, border_style),\n-                    _Segment(_box.foot_right, border_style),\n-                    _Segment(_box.foot_vertical, border_style),\n-                ),\n                 (\n                     _Segment(_box.mid_left, border_style),\n                     _Segment(_box.mid_right, border_style),\n                     _Segment(_box.mid_vertical, border_style),\n                 ),\n+                (\n+                    _Segment(_box.foot_left, border_style),\n+                    _Segment(_box.foot_right, border_style),\n+                    _Segment(_box.foot_vertical, border_style),\n+                ),\n             ]\n             if show_edge:\n                 yield _Segment(_box.get_top(widths), border_style)\n", "stderr": "", "exit_code": 0}
16run_command
{
 "command": "python -m pytest tests/test_table.py -q -x -k \"Table\" || echo \"No tests match\""
}
{"status": "ok", "stdout": "............... [100%]\n15 passed in 0.12s\n", "stderr": "", "exit_code": 0}
full
{"status": "ok", "stdout": "...............                                                          [100%]\n15 passed in 0.12s\n", "stderr": "", "exit_code": 0}
17run_command
{
 "command": "python -m pytest tests/test_table.py -q"
}
{"status": "ok", "stdout": "............... [100%]\n15 passed in 0.12s\n", "stderr": "", "exit_code": 0}
full
{"status": "ok", "stdout": "...............                                                          [100%]\n15 passed in 0.12s\n", "stderr": "", "exit_code": 0}
18run_command
{
 "command": "submit_patch"
}
{"status": "error", "error_type": "CommandError", "error_message": "/bin/bash: submit_patch: command not found\n", "details": {"stdout": "", "stderr": "/bin/bas
full
{"status": "error", "error_type": "CommandError", "error_message": "/bin/bash: submit_patch: command not found\n", "details": {"stdout": "", "stderr": "/bin/bash: submit_patch: command not found\n", "exit_code": 127}}
19submit_patch
{}
{"status": "ok", "patch_size": 1099, "files_changed": 1}
full
{"status": "ok", "patch_size": 1099, "files_changed": 1}

Patch

diff --git a/rich/table.py b/rich/table.py
index fe4054cf..44e457be 100644
--- a/rich/table.py
+++ b/rich/table.py
@@ -775,16 +775,16 @@ class Table(JupyterMixin):
                     _Segment(_box.head_right, border_style),
                     _Segment(_box.head_vertical, border_style),
                 ),
-                (
-                    _Segment(_box.foot_left, border_style),
-                    _Segment(_box.foot_right, border_style),
-                    _Segment(_box.foot_vertical, border_style),
-                ),
                 (
                     _Segment(_box.mid_left, border_style),
                     _Segment(_box.mid_right, border_style),
                     _Segment(_box.mid_vertical, border_style),
                 ),
+                (
+                    _Segment(_box.foot_left, border_style),
+                    _Segment(_box.foot_right, border_style),
+                    _Segment(_box.foot_vertical, border_style),
+                ),
             ]
             if show_edge:
                 yield _Segment(_box.get_top(widths), border_style)

Test output

show
...................                                                      [100%]
19 passed in 0.13s