pare che urlparse nella lib standard abbia un comportamento un po' strano...
Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from urlparse import urlparse >>> u = urlparse('redis://localhost:6380') >>> u.port 6380 >>> u = urlparse('redis://localhost:63801') >>> u.port 63801 >>> u = urlparse('redis://localhost:638012') >>> u.port >>> u.port is None True stessa cosa succede su python 3 cambiando ovviamente l'import >>> from urllib.parse import urlparse Daccordo che il port number è un intero a 16-bit, per cui oltre 65535 non ha senso, però forse mi sarei aspettato un eccezione, mentre invece la port oltre un certo numero viene semplicemente interpretata come None >>> urlparse('redis://localhost:65535').port 65535 >>> urlparse('redis://localhost:65536').port is None True Marco
_______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python