Repository navigation
Commit 71bbb94
committed
Sanitize product and view names before using them as paths
A product collection named "JNR 12 BICON " (trailing space, straight off
the STEP filename) made every render fail with "cannot save". Windows
strips trailing spaces and dots when it creates a directory entry, so
os.makedirs quietly produced "CC_11_JNR 12 BICON" while the render path
still pointed at "CC_11_JNR 12 BICON \...", and that directory genuinely
does not exist. The mismatch is invisible from Python: os.path.isdir
strips the same trailing space on the way in and reports the folder as
present.
Route the directory and file names through safe_name(), which trims
trailing spaces and dots, replaces characters Windows rejects, and
sidesteps the reserved device names. The label prefix already keeps each
product in its own folder, so names that clean up to the same text still
cannot collide.1 parent 87e6704 commit 71bbb94
1 file changed
Lines changed: 34 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
675 | 675 | | |
676 | 676 | | |
677 | 677 | | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
678 | 710 | | |
679 | 711 | | |
680 | 712 | | |
| |||
1607 | 1639 | | |
1608 | 1640 | | |
1609 | 1641 | | |
1610 | | - | |
| 1642 | + | |
1611 | 1643 | | |
1612 | 1644 | | |
1613 | 1645 | | |
1614 | 1646 | | |
1615 | 1647 | | |
1616 | | - | |
| 1648 | + | |
1617 | 1649 | | |
1618 | 1650 | | |
1619 | 1651 | | |
| |||
0 commit comments