Issue #21999: Handled empty strings correctly when in POSIX mode.
diff --git a/Lib/shlex.py b/Lib/shlex.py
index e7c8acc..7bef0dd 100644
--- a/Lib/shlex.py
+++ b/Lib/shlex.py
@@ -230,7 +230,7 @@
                     if self.debug >= 2:
                         print "shlex: I see punctuation in word state"
                     self.state = ' '
-                    if self.token:
+                    if self.token or (self.posix and quoted):
                         break   # emit current token
                     else:
                         continue