[BE] Do not add . after troubleshooting_url (#157753)

As it gets included into auto-hrefed URLs in say github logs to point to non existing location

For example from https://github.com/pytorch/pytorch/actions/runs/16130448756/job/45517004735?pr=157749#step:18:27
> W0708 00:23:20.150000 67082 torch/_dynamo/convert_frame.py:1047] [0/8] To diagnose recompilation issues, see [https://pytorch.org/docs/main/torch.compiler_troubleshooting.html.](https://pytorch.org/docs/main/torch.compiler_troubleshooting.html.)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/157753
Approved by: https://github.com/zou3519, https://github.com/jansel
This commit is contained in:
Nikita Shulga 2025-07-08 15:38:20 +00:00 committed by PyTorch MergeBot
parent 98bb0c0e78
commit f88d7a7a34

View File

@ -1050,12 +1050,14 @@ def _compile(
def format_func_info(code: CodeType) -> str: def format_func_info(code: CodeType) -> str:
return f"'{code.co_name}' ({code.co_filename}:{code.co_firstlineno})" return f"'{code.co_name}' ({code.co_filename}:{code.co_firstlineno})"
# NS: Don't add period at the end of string, as it'll be added to URL
# renderring it incorrect
log.warning( log.warning(
"torch._dynamo hit config.%s (%s)\n" "torch._dynamo hit config.%s (%s)\n"
" function: %s\n" " function: %s\n"
" last reason: %s\n" " last reason: %s\n"
'To log all recompilation reasons, use TORCH_LOGS="recompiles".\n' 'To log all recompilation reasons, use TORCH_LOGS="recompiles".\n'
"To diagnose recompilation issues, see %s.", "To diagnose recompilation issues, see %s",
limit_type, limit_type,
getattr(config, limit_type), getattr(config, limit_type),
format_func_info(code), format_func_info(code),