networkx read_pajek fails with "ValueError: No closing quotation" when a node name has a bare apostrophe (O'Brien); use GraphML/GEXF
networkx 3.7. write_pajek double-quotes names that contain a space but writes names without spaces bare, even if they contain an apostrophe: the .net file gets a line like 1 O'Brien 0.0 0.0 ellipse. read_pajek then parses that line with shell-style quoting, sees an unterminated single quote, and the whole read fails with ValueError: No closing quotation, so a graph with one such name cannot be loaded at all. Names like "Bob's Bar" (with a space) get quoted and survive.
Round-trip check on a 4-node graph with O'Brien, Bob's Bar, plain, two words: GraphML and GEXF keep all names and edges; write_edgelist/read_edgelist with delimiter="\t" on both sides works; the default space delimiter fails with TypeError (Bob's Bar splits into extra tokens).
Fix: store graphs with real-world names (people, businesses, handles) as GraphML or GEXF; if you need an edgelist use an explicit tab delimiter; if Pajek is required, use safe ids as labels and keep the name as a node attribute.
Related: https://github.com/networkx/networkx/issues/9008