@@ -684,16 +684,25 @@ def _convert_egg_info_reqs_to_simple_reqs(sections):
684684 def make_condition (name ):
685685 return name and f'extra == "{ name } "'
686686
687- def parse_condition (section ):
687+ def quoted_marker (section ):
688688 section = section or ''
689689 extra , sep , markers = section .partition (':' )
690690 if extra and markers :
691691 markers = f'({ markers } )'
692692 conditions = list (filter (None , [markers , make_condition (extra )]))
693693 return '; ' + ' and ' .join (conditions ) if conditions else ''
694694
695+ def url_req_space (req ):
696+ """
697+ PEP 508 requires a space between the url_spec and the quoted_marker.
698+ Ref python/importlib_metadata#357.
699+ """
700+ # '@' is uniquely indicative of a url_req.
701+ return ' ' * ('@' in req )
702+
695703 for section in sections :
696- yield section .value + parse_condition (section .name )
704+ space = url_req_space (section .value )
705+ yield section .value + space + quoted_marker (section .name )
697706
698707
699708class DistributionFinder (MetaPathFinder ):
@@ -748,6 +757,9 @@ class FastPath:
748757 """
749758 Micro-optimized class for searching a path for
750759 children.
760+
761+ >>> FastPath('').children()
762+ ['...']
751763 """
752764
753765 @functools .lru_cache () # type: ignore
@@ -762,7 +774,7 @@ def joinpath(self, child):
762774
763775 def children (self ):
764776 with suppress (Exception ):
765- return os .listdir (self .root or '' )
777+ return os .listdir (self .root or '. ' )
766778 with suppress (Exception ):
767779 return self .zip_children ()
768780 return []
0 commit comments