Many years ago I read a book or story where a group of people discover a dark city - maybe on another planet - which appears devoid of life but is in very good condition. As they gradually explore the city one of the them falls into a trap and is cut to pieces by something mechanical. This detail I can remember as it was a pretty gruesome idea. I don't know the ending but my guess is that none of them make it out alive.
Finally tracked down the short story I mentioned in my comment to the original question, and that Jeff mentioned in his answer: See if this sounds about right:
"The City" — A rocket expedition from Earth lands on an uncharted planet to be greeted by a seemingly empty city. As the humans begin to explore, they realize that the city is not as empty as it seems. The city was waiting for the arrival of humans; the contingency plan of a long dead civilization, put in place to take revenge upon humanity after their culture was wiped out with biological weapons by humans long before recorded history. Once the city captures and kills the human astronauts, the humans' corpses are used as automations to finalize the city's creators' revenge; a biological attack on the Earth.
It's from Ray Bradbury's 'The Illustrated Man' compilation.
I read a fantastic short story that sounds similar and I've wanted to rediscover it for years. The plot was about a planet created as a trap. Long-dead victims of Earth(?) aggression, realizing they would be wiped out, create a giant trap to wipe out Earth generations in the future. Over the eons, the people of Earth forget about the war and the enemy planet but eventually rediscover it - just as their ancient victims foresaw. The machine eviscerates the explorers and fills their bodies with a virus or other nasty thing and then sends them back to Earth to exact revenge. I remember my brother and I talking about it enthusiastically around, oh, 1978 or so. No idea of the name, but it would have been in a SF anthology.
There are a couple of similar instances in Simon Green's Deathstalker saga. An expedition is sent into an alien city to retrieve some bio-weapons, and many people in the expedition are killed or vanish due to a variety of horrific alien traps.
Similarly, attempts to navigate the "Madness Maze", another alien artifact, result in people being lost, physically rearranged, driven insane, etc..
Might also be Rogue Moon by Algis Budrys.