Miners and energy companies helped give the Toronto stock market a solid lift mid-morning Thursday as prices for oil and copper advanced.At the same time, traders are trying to gauge the likelihood of a U.S. federal government shutdown and the economic fallout from such an event.The S&P/TSX composite index climbed 57.03 points to 12,893.74, while the Canadian dollar was up 0.05 of a cent to 97.01 cents US.U.S. indexes were sharply higher after worries about the U.S. economy and a looming budget battle in Washington sent the Dow industrials and the S&P 500 lower for the past five sessions.The Dow gained 92.5 points to 15,365.76, the Nasdaq was ahead 31.59 points to 3,792.68, and the S&P 500 index rose 9.17 points to 1,701.94 as two financial deadlines for the U.S. government loom.Congress needs to pass a funding bill to keep the federal government operating after Oct. 1, when its new fiscal year starts. And the U.S. borrowing limit needs to be raised before Oct. 17.Markets are nervous as investors remember the summer of 2011 when a similar situation roiled markets at a time when Europe’s debt crisis was flaring, and prompted Standard & Poor’s to strip the U.S. of its triple A credit rating.“While a limited shutdown of a week or two is unlikely to derail the expansion, a prolonged one certainly could,” observed BMO Capital Markets senior economist Sal Guatieri.“Moreover, if the government needs to slash spending further to meet its obligations beyond Oct. 17, the direct impact alone, not even considering the turbulence in financial markets and knock-on effects to confidence, would easily tip the economy into recession.”President Barack Obama has said he won’t negotiate on the debt limit. But positions appeared to harden mid-morning after House Speaker John Boehner said that “it doesn’t work that way” and that Americans don’t want either Obamacare or a government shutdown.There was good news on the U.S. housing front as a report showed that average U.S. rates on fixed mortgages fell this week to 4.32 per cent, their lowest point in two months. The decline follows the Federal Reserve’s decision last week to hold off slowing its monthly bond purchases.On the corporate front, Rogers Communications Inc. (TSX:RCI.B) and U.S. wireless carrier Sprint Corp. say they will offer Canadians a high-speed Internet access in their vehicles. The cost of the project, pricing for the services and dates for the rollout weren’t included in a joint statement issued by the companies, which have two of North America’s largest telecommunications networks. Rogers was up 15 cents to $45.06.BlackBerry shares were up 19 cents or 2.3 per cent to $8.45 on the TSX after Fairfax Financial chief executive Prem Watsa said that he has every intention of completing the acquisition of the smartphone maker, adding his firm is not in the business of making an offer and then walking away or redoing the deal.Fairfax (TSX:FFH) has proposed to take the company private with a consortium of unnamed financiers for US$9 per share. But its shares fell about six per cent Wednesday amid wavering confidence that a solid Fairfax deal will materialize.A Norwegian energy firm Statoil is estimating that an untapped oil field off Canada’s east coast contains between 300 and 600 million barrels of recoverable oil, making it one of the biggest discoveries in recent years. Calgary-based Husky Energy (TSX:HSE), another major producer in Newfoundland’s current offshore oilfields, is Statoil’s partner in the area, with a 35 per cent working interest in three discoveries. Husky shares were ahead 89 cents to $29.95.Commodity prices were generally higher and the base metals sector rose 1.6 per cent while December copper gained five cents to US$3.32 a pound. Teck Resources (TSX:TCK.B) rose 81 cents to C$29.39.The energy sector was ahead almost one per cent as the November crude contract on the New York Mercantile Exchange moved up 38 cents to US$103.04 a barrel. Canadian Natural Resources (TSX:CNQ) was 47 cents higher to C$32.89.The gold sector rose 0.3 per cent as bullion prices headed lower with the December contract in New York down $1 to US$1,335.20 an ounce.Barrick Gold Corp. (TSX:ABX) says the Supreme Court of Chile has upheld rulings that require the miner to complete a water management system for the Pascua-Lama mining project, to the satisfaction of the country’s environment ministry, before resuming construction. Barrick has submitted a plan that estimates completion of the water management system by the end of 2014. Its shares were a penny higher to C$19.30.European bourses were mixed with London’s FTSE 100 index up 0.35 per cent, Frankfurt’s DAX added 0.13 per cent and the Paris CAC 40 lost 0.04 per cent.