[issue22231] httplib: unicode url will cause an ascii codec error when combined with a utf-8 string header
Changes by Bob Chen 175818...@qq.com: -- keywords: +patch Added file: http://bugs.python.org/file36492/httplib.py.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22231 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22231] httplib: unicode url will cause an ascii codec error when combined with a utf-8 string header
Bob Chen added the comment: This patch ensures the url not to be unicode, so the 'join' would not cause error when there is utf-8 string behind. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22231 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22257] PEP 432: Redesign the interpreter startup sequence
Changes by Drekin dre...@gmail.com: -- nosy: +Drekin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22257 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12319] [http.client] HTTPConnection.putrequest not support chunked Transfer-Encodings to send data
Rolf Krahl added the comment: I'd like to support the request. I have a use case where I definitely need this feature: I maintain a Python client for a scientific metadata catalogue, see [1] for details. The client also features the upload of the data files. The files may come in as a data stream from another process, so my client takes a file like object as input. The files may be large (several GB), so buffering them is not an option, they must get streamed to the server as they come in. Therefore, there is have no way to know the Content-length of the upload beforehand. I implemented chunked transfer encoding in a custom module that monkey patches the library, see the attached file. This works fine, but of course it's an awkward hack as I must meddle deeply into the internals of urllib and http.client to get this working. This module is tested to work with Python 2.7, 3.1, 3.2, 3.3, and 3.4 (for Python 3 you need to pass it through 2to3 first). I really would like to see this feature in the standard library in order to get rid of this hack in my package. I would happy to transform my module into a patch to the library if such a patch would have a chance to get accepted. [1]: https://code.google.com/p/icatproject/wiki/PythonIcat -- nosy: +Rotkraut Added file: http://bugs.python.org/file36493/chunkedhttp.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12319 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22231] httplib: unicode url will cause an ascii codec error when combined with a utf-8 string header
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22231 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21527] concurrent.futures.ThreadPoolExecutor does not use a default value
Changes by Claudiu Popa pcmantic...@gmail.com: Added file: http://bugs.python.org/file36494/issue21527.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21527 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22292] pickle whichmodule RuntimeError
Attilio Di Nisio added the comment: A simple patch to freeze the list of sys.modules. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22292 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22292] pickle whichmodule RuntimeError
STINNER Victor added the comment: A simple patch to freeze the list of sys.modules. Which patch? -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22292 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22292] pickle whichmodule RuntimeError
Attilio Di Nisio added the comment: diff -r fb3aee1cff59 Lib/pickle.py --- a/Lib/pickle.py Wed Aug 27 09:41:05 2014 -0700 +++ b/Lib/pickle.py Thu Aug 28 10:59:37 2014 +0200 @@ -280,7 +280,7 @@ module_name = getattr(obj, '__module__', None) if module_name is not None: return module_name -for module_name, module in sys.modules.items(): +for module_name, module in list(sys.modules.items()): if module_name == '__main__' or module is None: continue try: -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22292 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22288] Incorrect Call grammar in documentation
Martijn Pieters added the comment: Fixed by revision 3ae399c6ecf6 -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22288 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22293] mock could be less memory-intensive
New submission from James Westby: Hi, I'm looking in to the memory usage of our testsuite, which does a fair amount of def setUp(): patcher = patch.multiple(...) self.mock_whatever = patcher.start() self.addCleanup(patcher.stop) or other ways of creating a mock and assigning it to an instance variable on a TestCase. This means that by the end of a run, we have quite a lot of references to MagicMocks. This then becomes the majority of the memory usage of the python process: (from meliae) Total 1157176 objects, 1189 types, Total size = 327.1MiB (342972340 bytes) Index Count % Size % Cum Max Kind 0 575750 49 198058000 57 57 344 MagicProxy 1 49955 4 52034888 15 72 196888 dict 2 124127 10 11881628 3 76 386477 str 3 12997 1 11749288 3 79 904 type 48225 0 9146200 2 821112 MagicMock 5 66310 5 5282392 1 84 80056 tuple 6 38161 3 4579320 1 85 120 function 71503 0 3972281 1 86 49488 module 8 28506 2 3648768 1 87 128 code 9 25768 2 2869680 0 88 69168 list 10 12649 1 2803196 0 89 66356 unicode 112251 0 2503112 0 891112 ClientHandler 122228 0 2477536 0 901112 _patch 13 28223 2 2257840 0 91 80 instancemethod 142014 0 2239568 0 911112 BoundMethodWeakref 152003 0 2227336 0 921112 DummyCache 16 24681 2 2221112 0 93 792 _CallList 17 18555 1 1632840 0 93 88 weakref 181457 0 1550248 0 941064 Morsel 19 46258 3 1110192 0 94 24 int The fact that each MagicMock creates 72 MagicProxies means that it is a significant chunk of memory, despite each being small. John Arbash Meinel suggested setting __slots__ = ['name', 'parent'] on MagicProxy to reduce the memory usage of this simple object. This helps with the memory usage: Total 1140377 objects, 1189 types, Total size = 169.5MiB (177755867 bytes) Index Count % Size % Cum Max Kind 0 47744 4 51347840 28 28 196888 dict 1 574210 50 36749440 20 49 64 MagicProxy 2 122020 10 11769659 6 56 386477 str 3 12975 1 11729400 6 62 904 type 48203 0 9121736 5 671112 MagicMock 5 64125 5 5141368 2 70 80056 tuple 6 36024 3 4322880 2 73 120 function 71503 0 3972281 2 75 49488 module 8 28506 2 3648768 2 77 128 code 9 12643 1 2801540 1 79 66356 unicode 10 23634 2 2716064 1 80 69168 list 112251 0 2503112 1 821112 ClientHandler 12 28223 2 2257840 1 83 80 instancemethod 132014 0 2239568 1 841112 BoundMethodWeakref 142003 0 2227336 1 851112 DummyCache 15 24615 2 2214536 1 87 792 _CallList 16 18482 1 1626416 0 87 88 weakref 171457 0 1550248 0 881064 Morsel 18 46259 4 1110216 0 89 24 int 192496 0858624 0 89 344 ModelState I'm going to go through and drop references so that these can get garbage collected, but making Mock less memory-intensive would probably be appreciated by its users. Reducing the memory usage of the tiny MagicProxies would be good, but also if there is a way to reduce the number of them by not pre-assiging 72 of them for every MagicMock, when each is very unlikely to be used, then that would be good as well. Thanks, James -- components: Library (Lib) messages: 226017 nosy: james-w priority: normal severity: normal status: open title: mock could be less memory-intensive type: resource usage versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22293 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12319] [http.client] HTTPConnection.putrequest not support chunked Transfer-Encodings to send data
Piotr Dobrogost added the comment: @Rotkraut The truth is http in stdlib is dead. Your best option is to use 3rd party libs like requests or urllib3. Authors of these libs plan to get rid of httplib entirely; see Moving away from httplib (https://github.com/shazow/urllib3/issues/58) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12319 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22294] 2to3 consuming_calls: len, min, max, zip, map, reduce, filter, dict, xrange
New submission from Edward O: This is a patch for issues similar to #16573 With this patch, the following new tests are now unchanged: r = dict(zip(s, range(len(s))), **d) r = len(filter(attrgetter('t'), self.a)) r = min(map(methodcaller('f'), self.a)) max(map(node.id, self.nodes)) + 1 if self.nodes else 0 reduce(set.union, map(f, self.a)) Note that as part of the patch, the range transformation now calls the generic in_special_context in addition to the customized one (which. I guess, should be removed, but I didn't dare). All existing tests pass, but the patterns used may not be strict enough, though I tried to stick to how it was done for other consuming calls. M Lib/lib2to3/fixer_util.py M Lib/lib2to3/fixes/fix_xrange.py M Lib/lib2to3/tests/test_fixers.py -- components: 2to3 (2.x to 3.x conversion tool) files: 2to3_more_consuming_calls.diff hgrepos: 271 keywords: patch messages: 226019 nosy: eddygeek priority: normal severity: normal status: open title: 2to3 consuming_calls: len, min, max, zip, map, reduce, filter, dict, xrange type: enhancement versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file36495/2to3_more_consuming_calls.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22294 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22274] subprocess.Popen(stderr=STDOUT) fails to redirect subprocess stderr to stdout
Akira Li added the comment: Josh, on Windows, if at least one standard stream is replaced; all three hStdInput, hStdOutput, hStdError handles are provided (all-or-nothing). On POSIX, standard streams stdin (0), stdout (1), stderr (2) are always inherited from the parent. Each stream can be manipulated independently. c2pwrite=-1 is different from providing c2pwrite=1 (STDOUT_FILENO) explicitly e.g., set_inheritable() call is made after the fork() in the latter case. My patch leads to dup2(fileno(stdout), STDERR_FILENO) when stdout is None and stderr=STDOUT on POSIX i.e., it redirects stderr to the inherited stdout (like 21 in the shell). It has no effect otherwise. sys.__stdout__ is used so that the call fails sooner without fork() if fileno(stdout) is not a valid file descriptor when python initializes (daemon, GUI). __stdout__-based solution doesn't support a case when fileno(stdout) is changed later in the program e.g., using freopen() on some systems. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22274 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22293] unittest.mock: use slots in MagicMock to reduce memory footprint
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +michael.foord title: mock could be less memory-intensive - unittest.mock: use slots in MagicMock to reduce memory footprint ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22293 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22294] 2to3 consuming_calls: len, min, max, zip, map, reduce, filter, dict, xrange
Changes by Edward O edoubray...@gmail.com: -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22294 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17620] Python interactive console doesn't use sys.stdin for input
Drekin added the comment: I have found another example of where the current interaction between readline and Python core lead to confussion. It started with following report on my package: https://github.com/Drekin/win-unicode-console/issues/2 . Basically, IPython interactive console on Windows uses pyreadline package, which provides GNU readline functionality. To get input from user, it just calls input(prompt). Input calls readline both for writing prompt and reading the input. It interprets ANSI control sequences so colored prompt is displayed rather than garbage. And when user types, things like auto-completion work. sys.stdin is not used at all and points to standard object. One easily gets the impression that since sys.stdin is bypassed, changing it doesn't mind, but it actually does. With changed sys.stdin, input() now uses it rather than readline and ANSI control sequences result in a mess. See https://github.com/ipython/ipython/issues/17#issuecomment-53696541 . I just think that it would be better when input() allways delegated to sys.stdin and print() to sys.stdout() and this was the standard way to interact with terminal. It would then be the responsibility of sys.std* objects to do right thing – to read from file, to delegate to readline, to directly interact with console some way, to interpret or not the ANSI control sequences. Solving issues like #1602 or #18597 or adding readline support to Windows would then be just matter of providing the right sys.std* implementation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17620 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22244] load_verify_locations fails to handle unicode paths on Python 2
Roundup Robot added the comment: New changeset 97081a80f487 by Benjamin Peterson in branch '2.7': fix load_verify_locations on unicode paths (closes #22244) http://hg.python.org/cpython/rev/97081a80f487 -- nosy: +python-dev resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21307] PEP 466: backport hashlib changes
Roundup Robot added the comment: New changeset 3f73c44b1fd1 by Benjamin Peterson in branch '2.7': PEP 466: backport hashlib algorithm constants (closes #21307) http://hg.python.org/cpython/rev/3f73c44b1fd1 -- nosy: +python-dev resolution: - fixed stage: needs patch - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21307 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12319] [http.client] HTTPConnection.putrequest not support chunked Transfer-Encodings to send data
Rolf Krahl added the comment: Thanks for the notice! As far as I read from the link you cite, getting rid of the current httplib in urllib3 is planned but far from being done. Furthermore, I don't like packages with too many 3rd party dependencies. Since my package is working fine with the current standard lib, even though using an ugly hack in one place, I'd consider switching to urllib3 as soon as the latter makes it into the standard lib. I still believe that adding chunked transfer encoding to http.client and urllib in the current standard lib would only require a rather small change that can easily be done such that the lib remains fully compatible with existing code. Still waiting for feedback if such a patch is welcome. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12319 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21305] PEP 466: update os.urandom
Benjamin Peterson added the comment: You should probably backport _PyRandom_Fini and cleanup the FD like a good citizen. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21305] PEP 466: update os.urandom
Alex Gaynor added the comment: This patch adds the finalizer to the backport -- not sure how I missed this the first time. -- Added file: http://bugs.python.org/file36496/backport-urandom.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21305] PEP 466: update os.urandom
STINNER Victor added the comment: @alex: please disable git format in your hgrc, so the bug tracker can create a review link to Rietveld for your patches. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21305] PEP 466: update os.urandom
Alex Gaynor added the comment: Victor -- new patch is in `hg` format. -- Added file: http://bugs.python.org/file36497/backport-urandom.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21305] PEP 466: update os.urandom
STINNER Victor added the comment: The third backport-urandom.diff (the one with the review link) looks good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22277] webbrowser.py add parameters to suppress output on stdout and stderr
Akira Li added the comment: open(url, stdout=DEVNULL) won't work on Windows (os.startfile()) and OS X (AppleScript) by default. UnixBrowser already suppresses the output when it is safe, if self.redirect_stdout=True and self.background=True are set. Also, open(url, stdout=DEVNULL) would probably break text-browsers such as elinks (e.g., they are run when $DISPLAY environment variable is not set). What left: Unix browsers for which webbrowser doesn't think that it is safe to suppress the output. If webbrowser allows the output when it shouldn't then it could be fixed on case by case basis and/or maybe some mechanism could be provided to override the webbrowser choice e.g., BaseBrowser.suppress_output attribute that defaults to None (let webbrowser decide). webbrowser is a high-level interface; stdout/stderr from subprocess are too low-level for open() function (inventing your own stdout/stderr values is even worse). -- nosy: +akira ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22277 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21305] PEP 466: update os.urandom
Roundup Robot added the comment: New changeset 3e7f88550788 by Benjamin Peterson in branch '2.7': PEP 466: backport persistent urandom fd (closes #21305) http://hg.python.org/cpython/rev/3e7f88550788 -- nosy: +python-dev resolution: - fixed stage: needs patch - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21527] concurrent.futures.ThreadPoolExecutor does not use a default value
Guido van Rossum added the comment: Looks good. -- nosy: +gvanrossum ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21527 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22293] unittest.mock: use slots in MagicMock to reduce memory footprint
Changes by Natalia B. Bidart nataliabid...@gmail.com: -- nosy: +nessita ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22293 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22276] pathlib glob issues
Antoine Pitrou added the comment: What is */ supposed to do? Only select directories? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22276 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22276] pathlib glob issues
João Guerra added the comment: Yes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22276 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22194] access to cdecimal / libmpdec API
Stefan Behnel added the comment: Stefan (Behnel), could you comment on the strategy that you had in mind? Is it similar to module_get_symbol.diff or entirely different? I agree with Antoine that a Capsule would work better here (and yes, the performance problem of capsules is only with cases where they need to be unpacked frequently). Here is our current API for datetime as an example: https://github.com/cython/cython/blob/e6c13f8922d6406f64f2578f5a0041e1615291a3/Cython/Includes/cpython/datetime.pxd It's not great (it would be possible to make it look more OOP-ish), but it's simple and quite easy to use. The top of the file contains the necessary header declarations, and the rest are inline C wrapper functions that basically just rename the existing capsule C-API functions and macros to make them easily and nicely callable from Cython code without having to care about the Capsule and its list of C functions. The declarations for _cdecimal would use a similar scheme and additionally include the libmpdec header declarations so that users could work with the underlying C data directly with a single (c-)import. That would then require the libmpdec symbols to be available, though, also when it's linked internally into _cdecimal. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22194 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22276] pathlib glob issues
R. David Murray added the comment: Heh. I never noticed that about shell globs, but it is logical. Learn something new every day. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22276 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22239] asyncio: nested event loop
Daniel Arbuckle added the comment: All right. However, for anyone who's interested, here is a patch that enables nested event loops in asyncio, and the accompanying unit tests -- keywords: +patch Added file: http://bugs.python.org/file36498/nested.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22239 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21720] TypeError: Item in ``from list'' not a string message
Julian Gindi added the comment: I'm trying to replicate this issue. I do not get an error when I run ``` __import__('datetime', fromlist=[u'datetime']) ``` any more information you could provide to help move this issue forward? -- nosy: +Julian.Gindi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21720 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22292] pickle whichmodule RuntimeError
Changes by Attilio Di Nisio attilio.dini...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file36499/pickle.py.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22292 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21720] TypeError: Item in ``from list'' not a string message
David Szotten added the comment: after some trial and error it only appears to break for 3rd party packages (all 20 or so i happened to have installed), whereas everything i tried importing from the standard library worked fine ``` __import__('requests.', fromlist=[u'get']) Traceback (most recent call last): File stdin, line 1, in module TypeError: Item in ``from list'' not a string __import__('os.', fromlist=[u'path']) module 'os' from 'snip (virtualenv)/lib/python2.7/os.pyc' ``` -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21720 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21720] TypeError: Item in ``from list'' not a string message
Julian Gindi added the comment: Interesting...I'll try to dig in and see what's going on. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21720 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22189] collections.UserString missing some str methods
Julian Gindi added the comment: Good catch. I'm gonna look into this. Seems like you should be able to access these from UserString as well. -- nosy: +Julian.Gindi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22189 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22295] Clarify available commands for package installation
New submission from Nick Coghlan: https://docs.python.org/3/installing/index.html is too subtle in pointing out the command in a source build or system Python on POSIX is pip3 or pip3.4 rather than the unadorned pip. At least one example should show pip3, and it's likely worth having an explanation in the last section on building from source. -- assignee: ncoghlan components: Devguide, Documentation messages: 226042 nosy: ezio.melotti, ncoghlan priority: normal severity: normal status: open title: Clarify available commands for package installation type: enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22295 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20996] Backport TLS 1.1 and 1.2 support for ssl_version
Alex Gaynor added the comment: This is resolved now. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20996 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22295] Clarify available commands for package installation
Donald Stufft added the comment: If you want to be completely unambiguous, python -m pip works as well. -- nosy: +dstufft ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22295 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22273] abort when passing certain structs by value using ctypes
Weeble added the comment: I had a closer look at the cif object in gdb. The ffi_type of the argument in question has size 16, alignment 1, type FFI_TYPE_STRUCT and elements contains a single nested ffi_type, of size 8, alignment 8, type FFI_TYPE_POINTER. I think this pointer type is wrong. The struct should indeed be size 16, but its contents (in this case) should be 16 bytes of uint8s, rather than a single pointer. I'm not certain how to correctly describe an array to libffi. While you might be able to hack it with a nested struct filled with 16 individual integers, I have no idea if that would work consistently across platforms. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22273 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22273] abort when passing certain structs by value using ctypes
Changes by Ned Deily n...@acm.org: -- nosy: +amaury.forgeotdarc, belopolsky, meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22273 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21720] TypeError: Item in ``from list'' not a string message
David Szotten added the comment: first ever patch to python, so advice on the patch would be appreciated found an example in the stdlib that triggers bug (used in test): `__import__('encodings', fromlist=[u'aliases'])` -- keywords: +patch Added file: http://bugs.python.org/file36500/fromlist.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21720 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21720] TypeError: Item in ``from list'' not a string message
Berker Peksag added the comment: Thanks for the patch, David! +def test_fromlist_error_messages(self): +# Test for issue #21720: fromlist unicode error messages +try: +__import__('encodings', fromlist=[u'aliases']) +except TypeError as exc: +self.assertIn(must be str, not unicode, str(exc)) You could use assertRaises here: with self.assertRaises(TypeError) as cm: # ... self.assertIn('foo', str(cm.exception)) +if (PyUnicode_Check(item)) { +PyErr_SetString(PyExc_TypeError, +Item in ``from list'' must be str, not unicode); +Py_DECREF(item); +return 0; +} I think it would be better to improve the error message in Python/import.c: http://hg.python.org/cpython/file/2.7/Python/import.c#l2571 So you can safely remove this check. -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21720 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22282] ipaddress module accepts octal formatted IPv4 addresses in IPv6 addresses
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +ncoghlan, pitrou, pmoody ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22282 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22189] collections.UserString missing some str methods
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22189 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22276] pathlib glob issues
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22276 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21611] int() docstring - unclear what number is
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21611 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.
Roger Serwy added the comment: When it comes to the checkmark next to Code Context in the menu, be aware of issue13179. You can launch IDLE, open two separate editors, enable Code Context in one, and the other will have its menu entry checked as well when it is not enabled. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17535 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22182] distutils.file_util.move_file unpacks wrongly an exception
Roundup Robot added the comment: New changeset a3452677a386 by Berker Peksag in branch '3.4': Issue #22182: Use e.args to unpack exceptions correctly in distutils.file_util.move_file. http://hg.python.org/cpython/rev/a3452677a386 New changeset f01413758114 by Berker Peksag in branch 'default': Issue #22182: Use e.args to unpack exceptions correctly in distutils.file_util.move_file. http://hg.python.org/cpython/rev/f01413758114 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22182 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22182] distutils.file_util.move_file unpacks wrongly an exception
Berker Peksag added the comment: Thanks Claudiu. -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22182 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22295] Clarify available commands for package installation
Nick Coghlan added the comment: Yes, that came up on Twitter as well (where this conversation started). I think that's the best way to go - it's the only invocation that works *everywhere*, regardless of how your Python instance got installed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22295 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22098] Behavior of Structure inconsistent with BigEndianStructure when using __slots__
Changes by Claudiu Popa pcmantic...@gmail.com: -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22098 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20745] test_statistics fails in refleak mode
Zachary Ware added the comment: Thanks, Xavier! -- resolution: - fixed stage: needs patch - resolved status: open - closed superseder: - test_asyncio unstable in refleak mode ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20745 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger()
Zachary Ware added the comment: Sorry, I have no familiarity with msilib, _msi, or the internals of MSIs in general. The patch looks reasonably harmless to me, but I don't have the confidence to take responsibility for it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1102 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com