doctor: don't pass pathnames to Formula.factory
doctor: don't pass pathnames to Formula.factory

Fixes Homebrew/homebrew#20908.

pseudocody/brew,Linuxbrew/brew,nandub/brew,sjackman/homebrew,jmsundar/brew,tonyg/homebrew,EricFromCanada/brew,claui/brew,JCount/brew,alyssais/brew,sjackman/homebrew,EricFromCanada/brew,tonyg/homebrew,JCount/brew,mistydemeo/homebrew,staticfloat/brew,mgrimes/brew,Homebrew/brew,zmwangx/brew,alyssais/brew,bfontaine/brew,Linuxbrew/brew,reelsense/brew,nandub/brew,jmsundar/brew,MikeMcQuaid/brew,mahori/brew,aw1621107/brew,hanxue/linuxbrew,mahori/brew,gregory-nisbet/brew,gregory-nisbet/brew,maxim-belkin/brew,claui/brew,mahori/brew,claui/brew,ilovezfs/brew,tonyg/homebrew,palxex/brew,konqui/brew,hanxue/linuxbrew,Homebrew/brew,rwhogg/brew,nandub/brew,bfontaine/brew,mistydemeo/homebrew,jmsundar/brew,konqui/brew,gordonmcshane/homebrew,gordonmcshane/homebrew,reelsense/brew,toonetown/homebrew,gordonmcshane/homebrew,vitorgalvao/brew,maxim-belkin/brew,vitorgalvao/brew,ilovezfs/brew,ilovezfs/brew,muellermartin/dist,reitermarkus/brew,AnastasiaSulyagina/brew,alyssais/brew,pseudocody/brew,maxim-belkin/brew,reitermarkus/brew,hanxue/linuxbrew,mgrimes/brew,amar-laksh/brew_sudo,palxex/brew,reelsense/brew,amar-laksh/brew_sudo,reitermarkus/brew,konqui/brew,zmwangx/brew,vitorgalvao/brew,Homebrew/brew,DomT4/brew,mgrimes/brew,sjackman/homebrew,DomT4/brew,aw1621107/brew,EricFromCanada/brew,staticfloat/brew,JCount/brew,pseudocody/brew,JCount/brew,Linuxbrew/brew,aw1621107/brew,AnastasiaSulyagina/brew,vitorgalvao/brew,MikeMcQuaid/brew,muellermartin/dist,DomT4/brew,mahori/brew,rwhogg/brew,claui/brew,nandub/brew,MikeMcQuaid/brew,rwhogg/brew,amar-laksh/brew_sudo,reitermarkus/brew,bfontaine/brew,toonetown/homebrew,AnastasiaSulyagina/brew,EricFromCanada/brew,toonetown/homebrew,DomT4/brew,staticfloat/brew,MikeMcQuaid/brew,Linuxbrew/brew,gregory-nisbet/brew,zmwangx/brew,muellermartin/dist,Homebrew/brew,palxex/brew,sjackman/homebrew,konqui/brew,mistydemeo/homebrew