[issue24550] maxint on 64 bit platforms breaks os.read
New submission from Brian Mingus: The lower range for this bug may be anything greater than 32 bit maxint. Other modules such as multiprocessing are limited passing objects of size 32 bit maxint, even on 64 bit systems, likely due to this issue. I have demonstrated this by modifying multiprocessing/connection.py to use longs in send and recv, which it surfaces the following error (note that read is os.read). Traceback (most recent call last): File /usr/lib/python3.4/multiprocessing/process.py, line 254, in _bootstrap self.run() File /usr/lib/python3.4/multiprocessing/process.py, line 93, in run self._target(*self._args, **self._kwargs) File /usr/lib/python3.4/multiprocessing/pool.py, line 103, in worker initializer(*initargs) File /usr/local/lib/python3.4/dist-packages/gensim-0.11.1_1-py3.4-linux-x86_64.egg/gensim/models/ldamulticore.py, line 266, in worker_e_step chunk_no, chunk, worker_lda = input_queue.get() File /usr/lib/python3.4/multiprocessing/queues.py, line 96, in get res = self._recv_bytes() File /usr/lib/python3.4/multiprocessing/connection.py, line 216, in recv_bytes buf = self._recv_bytes(maxlength) File /usr/lib/python3.4/multiprocessing/connection.py, line 420, in _recv_bytes return self._recv(size) File /usr/lib/python3.4/multiprocessing/connection.py, line 383, in _recv chunk = read(handle, remaining) OverflowError: signed integer is greater than maximum Which can be traced back to this cpython code: https://github.com/python/cpython/blob/3.4/Modules/posixmodule.c#L8048-L8065 -- components: IO messages: 246063 nosy: Brian Mingus priority: normal severity: normal status: open title: maxint on 64 bit platforms breaks os.read type: enhancement versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24550 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18914] Python docs link to terrible outsi
New submission from Brian Mingus: The python documentation links to an outside website for info and examples on http basic auth. This documentation is terrible and confusing. The link should be removed, and user's should be advised to use the Requests library. # this example is from http://www.voidspace.org.uk/python/articles/authentication.shtml # which is linked to by the official python docs http://docs.python.org/2/howto/urllib2.html import urllib2 theurl = 'http://www.someserver.com/toplevelurl/somepage.htm' username = 'johnny' password = 'XX' # a great password passman = urllib2.HTTPPasswordMgrWithDefaultRealm() # this creates a password manager passman.add_password(None, theurl, username, password) # because we have put None at the start it will always # use this username/password combination for urls # for which `theurl` is a super-url authhandler = urllib2.HTTPBasicAuthHandler(passman) # create the AuthHandler opener = urllib2.build_opener(authhandler) urllib2.install_opener(opener) # All calls to urllib2.urlopen will now use our handler # Make sure not to include the protocol in with the URL, or # HTTPPasswordMgrWithDefaultRealm will be very confused. # You must (of course) use it when fetching the page though. pagehandle = urllib2.urlopen(theurl) # authentication is now handled automatically for us -- assignee: docs@python components: Documentation messages: 196854 nosy: docs@python, mingus priority: normal severity: normal status: open title: Python docs link to terrible outsi versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18914] Confusing documentation in the urllib2 HOWTO
Brian Mingus added the comment: The documentation is confusing. Consider this comment: # All calls to urllib2.urlopen will now use our handler # Make sure not to include the protocol in with the URL, or # HTTPPasswordMgrWithDefaultRealm will be very confused. # You must (of course) use it when fetching the page though. In the actual code he provides, he uses the protocol. Furthermore, before showing a simple way to use the libary, he shows a godawfully complex way. Either the documentation should made beautiful and comprehensible, or it should not be linked to. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18914] Confusing documentation in the urllib2 HOWTO
Brian Mingus added the comment: Yes - this link was a waste of my time. It would have been better if it had not been there. I propose to replace it with nothing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com