From report at bugs.python.org Fri Mar 1 13:58:25 2013 From: report at bugs.python.org (Christoph Zwerschke) Date: Fri, 01 Mar 2013 12:58:25 +0000 Subject: [docs] [issue17326] Windows build docs still referring to VS 2008 in 3.3 Message-ID: <1362142705.89.0.367756520949.issue17326@psf.upfronthosting.co.za> New submission from Christoph Zwerschke: The first paragraph in PCbuild/readme.txt of Python 3.3 still talks about Visual C++ 2008 Express and Visual Studio 2008. It says that VS 2008 is required at the very least (which may be still true, I'm not sure), but then it also says "the official Python releases are built with this [i.e. the 2008] version of VS", while it seems they have been built with VS 2010 in reality (as the title is also indicating). ---------- assignee: docs at python components: Documentation messages: 183259 nosy: cito, docs at python priority: normal severity: normal status: open title: Windows build docs still referring to VS 2008 in 3.3 type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 14:00:17 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 13:00:17 +0000 Subject: [docs] [issue17326] Windows build docs still referring to VS 2008 in 3.3 In-Reply-To: <1362142705.89.0.367756520949.issue17326@psf.upfronthosting.co.za> Message-ID: <1362142817.77.0.32921209023.issue17326@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +brian.curtin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 16:04:33 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 01 Mar 2013 15:04:33 +0000 Subject: [docs] [issue17329] Document unittest.SkipTest Message-ID: <1362150273.59.0.386989863107.issue17329@psf.upfronthosting.co.za> New submission from Brett Cannon: ---------- assignee: docs at python components: Documentation messages: 183262 nosy: brett.cannon, docs at python, ezio.melotti, michael.foord, zach.ware priority: normal severity: normal stage: needs patch status: open title: Document unittest.SkipTest versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 19:40:42 2013 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 01 Mar 2013 18:40:42 +0000 Subject: [docs] [issue11448] docs for HTTPConnection.set_tunnel are ambiguous In-Reply-To: <1299636529.48.0.302129596868.issue11448@psf.upfronthosting.co.za> Message-ID: <1362163242.7.0.878166939556.issue11448@psf.upfronthosting.co.za> ?ric Araujo added the comment: > This is a possible additional example for set_tunnel, Thanks. In general, our tooling expects unified diffs, such as produced by hg diff. > modification of python3.3/html/_sources/library/http.client.txt That?s a copy for web hosting, the real source is in Doc/library/http.client.rst (see devguide for more info). ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 22:31:03 2013 From: report at bugs.python.org (Ernie Hershey) Date: Fri, 01 Mar 2013 21:31:03 +0000 Subject: [docs] [issue17332] typo in json docs - "convered" should be "converted" Message-ID: <1362173463.23.0.943587603223.issue17332@psf.upfronthosting.co.za> New submission from Ernie Hershey: Hi, On these pages: http://docs.python.org/3.4/library/json.html http://docs.python.org/3.3/library/json.html http://docs.python.org/3.2/library/json.html http://docs.python.org/2/library/json.html http://docs.python.org/2.6/library/json.html This line says "convered" but should be "converted." Note Keys in key/value pairs of JSON are always of the type str. When a dictionary is converted into JSON, all the keys of the dictionary are coerced to strings. As a result of this, if a dictionary is convered into JSON and then back into a dictionary, the dictionary may not equal the original one. That is, loads(dumps(x)) != x if x has non-string keys. ---------- assignee: docs at python components: Documentation messages: 183293 nosy: docs at python, ernest priority: normal severity: normal status: open title: typo in json docs - "convered" should be "converted" type: enhancement versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 23:42:31 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Mar 2013 22:42:31 +0000 Subject: [docs] [issue17309] __bytes__ doesn't work in subclass of int and str In-Reply-To: <1361979686.07.0.236846670702.issue17309@psf.upfronthosting.co.za> Message-ID: <1362177751.95.0.109015402078.issue17309@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The library doc says that if the source argument for bytes() or bytearray() is a string or integer it is treated a certain way. I believe 'string' and 'integer' are meant to include subclasses of str and int, else it should have said str or int. You have verified that int subclass instances are indeed treated as integers. The following shows that str subclass instances are treated as strings. class mystr(str): def __bytes__(self): return b'hello' print(bytes(mystr('a'))) raises TypeError: string argument without an encoding The language reference says "object.__bytes__(self): Called by bytes() to compute a byte-string representation of an object." No exception is given. I see this as a contradiction in the manual, in which case the current behavior rules and the contradiction is removed by changing the doc part that conflicts with behavior. That would mean extending the doc sentence with 'that is not a string or integer'. However, I am waiting for other opinions for two reasons. 1. The doc also specified special treatment for buffer interface and iterable objects. However, __bytes__ *is* checked first for those objects. class myit(list): def __bytes__(self): return b'hello' print (bytes (myit([1,2,3]))) # b'hello' class mybit(bytes): # example def __bytes__(self): return b'hello' print (bytes (mybit(b'a'))) # b'hello' So the exception is limited to 'strings' and 'integers', making it somewhat inconsistent. 2. If someone gives an str or int subclass a __bytes__ method, they can only mean for it to be called by bytes(), as there is no other use of that special method. On the third hand, a user of a class who tests its instances before calling bytes with "isinstance(x, (str, int))" instead of "type(x) is str or type(x) is int", likely expects getting normal string or integer behavior. Of course, the same might be true if the test is 'isiterable(x)'. If behavior were changed, I think it should wait for 3.4 since the current behavior is not clearly a bug to me. ---------- assignee: -> docs at python components: +Documentation -Interpreter Core nosy: +docs at python, terry.reedy title: __bytes__ doesn't work in subclass of int -> __bytes__ doesn't work in subclass of int and str versions: +Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 23:45:01 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Mar 2013 22:45:01 +0000 Subject: [docs] [issue17285] subprocess.check_output incorrectly state that output is always bytes In-Reply-To: <1361706230.84.0.572016082.issue17285@psf.upfronthosting.co.za> Message-ID: <1362177901.48.0.785360125308.issue17285@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +terry.reedy versions: +Python 3.4 -Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 00:03:39 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Mar 2013 23:03:39 +0000 Subject: [docs] [issue17309] __bytes__ doesn't work in subclass of int and str In-Reply-To: <1361979686.07.0.236846670702.issue17309@psf.upfronthosting.co.za> Message-ID: <1362179019.82.0.210337701512.issue17309@psf.upfronthosting.co.za> Terry J. Reedy added the comment: More data: class myit(list): def __bytes__(self): return b'hello' print (bytes(b'a')) class myit(list): def __bytes__(self): return b'hello' print (bytearray (myit([1,2,3]))) # bytearray(b'a') # bytearray(b'\x01\x02\x03') class by: def __bytes__(self): return b'hello' # TypeError: 'by' object is not iterable (Error message is incomplete.) So bytearray *always* treats objects as specified in its library entry and never calls __bytes__, making its value sometimes unequal as a sequence of bytes from bytes with the same input. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 19:42:21 2013 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 02 Mar 2013 18:42:21 +0000 Subject: [docs] [issue17309] __bytes__ doesn't work in subclass of int and str In-Reply-To: <1361979686.07.0.236846670702.issue17309@psf.upfronthosting.co.za> Message-ID: <1362249741.84.0.338357934841.issue17309@psf.upfronthosting.co.za> Benjamin Peterson added the comment: This has been fixed recently: $ ./python bytes.py b'\x00' b'hello' ---------- nosy: +benjamin.peterson resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From mhoy09 at gmail.com Sat Mar 2 23:12:47 2013 From: mhoy09 at gmail.com (mhoy09 at gmail.com) Date: Sat, 02 Mar 2013 22:12:47 -0000 Subject: [docs] Doc: remove errors about mixed-type comparisons. (issue 12067) Message-ID: <20130302221247.16716.69426@psf.upfronthosting.co.za> http://bugs.python.org/review/12067/diff/6175/Doc/reference/expressions.rst File Doc/reference/expressions.rst (right): http://bugs.python.org/review/12067/diff/6175/Doc/reference/expressions.rst#newcode1048 Doc/reference/expressions.rst:1048: specific :meth:`__eq__()` and :meth:`__ne__()`. With ``<``, ``>``, On 2013/02/23 07:51:56, ezio.melotti wrote: > These should be :meth:`~object.__eq__` (or whatever creates a link to the __eq__ > documention). The () shouldn't be included. Currently working on this. http://bugs.python.org/review/12067/ From mhoy09 at gmail.com Sun Mar 3 01:01:17 2013 From: mhoy09 at gmail.com (mhoy09 at gmail.com) Date: Sun, 03 Mar 2013 00:01:17 -0000 Subject: [docs] Doc: remove errors about mixed-type comparisons. (issue 12067) Message-ID: <20130303000117.16681.40833@psf.upfronthosting.co.za> On 2013/02/23 07:51:56, ezio.melotti wrote: > http://bugs.python.org/review/12067/diff/6175/Doc/reference/expressions.rst > File Doc/reference/expressions.rst (right): > > http://bugs.python.org/review/12067/diff/6175/Doc/reference/expressions.rst#newcode1048 > Doc/reference/expressions.rst:1048: specific :meth:`__eq__()` and > :meth:`__ne__()`. With ``<``, ``>``, > These should be :meth:`~object.__eq__` (or whatever creates a link to the __eq__ > documention). The () shouldn't be included. It appears that this section of the documentation is vary different from what I worked on 4 months ago. Can we please get some input as to whether or not this issue needs to remain open? http://bugs.python.org/review/12067/ From mhoy09 at gmail.com Sun Mar 3 01:01:24 2013 From: mhoy09 at gmail.com (mhoy09 at gmail.com) Date: Sun, 03 Mar 2013 00:01:24 -0000 Subject: [docs] Doc: remove errors about mixed-type comparisons. (issue 12067) Message-ID: <20130303000124.16681.86894@psf.upfronthosting.co.za> http://bugs.python.org/review/12067/ From report at bugs.python.org Sun Mar 3 04:19:00 2013 From: report at bugs.python.org (karl) Date: Sun, 03 Mar 2013 03:19:00 +0000 Subject: [docs] [issue11448] docs for HTTPConnection.set_tunnel are ambiguous In-Reply-To: <1299636529.48.0.302129596868.issue11448@psf.upfronthosting.co.za> Message-ID: <1362280740.85.0.17514325081.issue11448@psf.upfronthosting.co.za> karl added the comment: Ah thanks Eric, I will fix that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 04:31:21 2013 From: report at bugs.python.org (karl) Date: Sun, 03 Mar 2013 03:31:21 +0000 Subject: [docs] [issue11448] docs for HTTPConnection.set_tunnel are ambiguous In-Reply-To: <1299636529.48.0.302129596868.issue11448@psf.upfronthosting.co.za> Message-ID: <1362281481.93.0.810480164829.issue11448@psf.upfronthosting.co.za> karl added the comment: ok made a proper patch on the rst file with hg diff. See issue-11448-1.patch ---------- Added file: http://bugs.python.org/file29293/issue-11448-1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 07:24:49 2013 From: report at bugs.python.org (Ankur Ankan) Date: Sun, 03 Mar 2013 06:24:49 +0000 Subject: [docs] [issue15542] Documentation incorrectly suggests __init__ called after direct __new__ call In-Reply-To: <1343946223.73.0.562621858875.issue15542@psf.upfronthosting.co.za> Message-ID: <1362291889.63.0.684694593671.issue15542@psf.upfronthosting.co.za> Changes by Ankur Ankan : ---------- nosy: +Ankur.Ankan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 18:04:21 2013 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Mar 2013 17:04:21 +0000 Subject: [docs] [issue14123] Indicate that there are no current plans to deprecate printf-style formatting In-Reply-To: <1330202928.96.0.727285588049.issue14123@psf.upfronthosting.co.za> Message-ID: <1362330261.57.0.800972485022.issue14123@psf.upfronthosting.co.za> Mark Lawrence added the comment: I can't see too much sense in leaving this open, what are your opinions? ---------- nosy: +BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 23:15:44 2013 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 03 Mar 2013 22:15:44 +0000 Subject: [docs] [issue12768] docstrings for the threading module In-Reply-To: <1313548989.72.0.178892692878.issue12768@psf.upfronthosting.co.za> Message-ID: <1362348944.19.0.360981452106.issue12768@psf.upfronthosting.co.za> Eli Bendersky added the comment: moijes, did you address the review comments? Does your patch apply to 3.2? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 04:48:43 2013 From: report at bugs.python.org (Todd Rovito) Date: Mon, 04 Mar 2013 03:48:43 +0000 Subject: [docs] [issue16278] os.rename documentation slightly inaccurate In-Reply-To: <1350581776.08.0.668682100781.issue16278@psf.upfronthosting.co.za> Message-ID: <1362368923.05.0.9229851148.issue16278@psf.upfronthosting.co.za> Changes by Todd Rovito : Removed file: http://bugs.python.org/file27890/OSRename_test_os_3point4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 04:48:54 2013 From: report at bugs.python.org (Todd Rovito) Date: Mon, 04 Mar 2013 03:48:54 +0000 Subject: [docs] [issue16278] os.rename documentation slightly inaccurate In-Reply-To: <1350581776.08.0.668682100781.issue16278@psf.upfronthosting.co.za> Message-ID: <1362368934.41.0.610837828612.issue16278@psf.upfronthosting.co.za> Changes by Todd Rovito : Removed file: http://bugs.python.org/file28071/OSRenameDocs3point4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 04:53:54 2013 From: report at bugs.python.org (Todd Rovito) Date: Mon, 04 Mar 2013 03:53:54 +0000 Subject: [docs] [issue16278] os.rename documentation slightly inaccurate In-Reply-To: <1350581776.08.0.668682100781.issue16278@psf.upfronthosting.co.za> Message-ID: <1362369234.18.0.558563973256.issue16278@psf.upfronthosting.co.za> Todd Rovito added the comment: Combined the test cases and document changes into a single patch. As suggested by Mr. Terry Reedy I used a table and removed the text. The table still needs some work but it is a good start. As suggested by Mr. Jerdonek I tried to make the test cases WETter by setting up the files and directories one time in the setup method then only changing that setup in the actual test case only if needed. This patch needs still needs some work but I wanted people to know I had not quit yet. It still needs to be tested on Windows, which I will do ASAP. Thanks. ---------- Added file: http://bugs.python.org/file29301/16278OSRenameDocsTest.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 13:36:21 2013 From: report at bugs.python.org (Thomas Kluyver) Date: Mon, 04 Mar 2013 12:36:21 +0000 Subject: [docs] [issue16851] Hint about correct ismethod and isfunction usage In-Reply-To: <1357231289.77.0.0608728593688.issue16851@psf.upfronthosting.co.za> Message-ID: <1362400580.98.0.603046764475.issue16851@psf.upfronthosting.co.za> Thomas Kluyver added the comment: I agree that the docs for inspect.ismethod() for Python 2 are wrong. The docs say: "Return true if the object is a bound method written in Python." However, it also returns True for an unbound method: >>> class A: ... def meth(self): ... pass ... >>> A.meth >>> import inspect >>> inspect.ismethod(A.meth) True ---------- nosy: +takluyver _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 15:36:39 2013 From: report at bugs.python.org (Phil Elson) Date: Mon, 04 Mar 2013 14:36:39 +0000 Subject: [docs] [issue17351] Fixed python3 descriptor documentation example + removal of explicit "object" inheritance in docs Message-ID: <1362407799.21.0.301955058492.issue17351@psf.upfronthosting.co.za> New submission from Phil Elson: The example at http://docs.python.org/3.4/howto/descriptor.html#properties does not run due to the old style "raise AttributeError, message" form. This patch fixes the problem, and also goes through the docs to remove explicit sub-classing from "object". The only remaining instances of this now are: $> grep -r -E "class .*\(object\)\:" Doc/* Doc/howto/pyporting.rst: class UnicodeMixin(object): Doc/reference/compound_stmts.rst: class Foo(object): Doc/tools/sphinxext/pyspecific.py:class PyDecoratorMixin(object): Doc/whatsnew/2.6.rst: class C(object): Doc/whatsnew/2.2.rst: class C(object): Doc/whatsnew/2.2.rst: class C(object): Doc/whatsnew/2.2.rst: class C(object): Doc/whatsnew/2.2.rst: class C(object): Doc/whatsnew/2.2.rst: >>> class C(object): Which are all (minus tools/sphinxext/pyspecific) referring to python2 in some context. I'm not bound to fixing the explicit object subclassing, so if it is better off not being here, that's fine. Cheers, ---------- assignee: docs at python components: Documentation files: pelson_doc_decorator.diff keywords: patch messages: 183458 nosy: docs at python, pelson, rhettinger priority: normal severity: normal status: open title: Fixed python3 descriptor documentation example + removal of explicit "object" inheritance in docs versions: Python 3.1 Added file: http://bugs.python.org/file29305/pelson_doc_decorator.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 15:54:53 2013 From: report at bugs.python.org (Eli Bendersky) Date: Mon, 04 Mar 2013 14:54:53 +0000 Subject: [docs] [issue16575] ctypes: unions as arguments In-Reply-To: <1354163044.21.0.431588472559.issue16575@psf.upfronthosting.co.za> Message-ID: <1362408893.19.0.729204972383.issue16575@psf.upfronthosting.co.za> Eli Bendersky added the comment: A minimal fix would be to update the documentation. A more comprehensive fix would be to tweak ctypes to reject unions and bit-fields when running on non-x86 (does this work for ARM and other non-Intel archs?) An even more comprehensive fix would be to make this work, but that would require forking libffi and should presumably be first implemented upstream. ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, eli.bendersky stage: -> needs patch versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 16:12:58 2013 From: report at bugs.python.org (Armin Rigo) Date: Mon, 04 Mar 2013 15:12:58 +0000 Subject: [docs] [issue16575] ctypes: unions as arguments In-Reply-To: <1354163044.21.0.431588472559.issue16575@psf.upfronthosting.co.za> Message-ID: <1362409977.96.0.812954271836.issue16575@psf.upfronthosting.co.za> Armin Rigo added the comment: See also http://bugs.python.org/issue16576. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 17:49:07 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 16:49:07 +0000 Subject: [docs] [issue14123] Indicate that there are no current plans to deprecate printf-style formatting In-Reply-To: <1330202928.96.0.727285588049.issue14123@psf.upfronthosting.co.za> Message-ID: <1362415747.39.0.627983522551.issue14123@psf.upfronthosting.co.za> Ezio Melotti added the comment: The only issue seems about the use of the word "deprecate", but I think it's fine, so I'll close this issue. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From ezio.melotti at gmail.com Mon Mar 4 18:15:16 2013 From: ezio.melotti at gmail.com (ezio.melotti at gmail.com) Date: Mon, 04 Mar 2013 17:15:16 -0000 Subject: [docs] os.rename documentation slightly inaccurate (issue 16278) Message-ID: <20130304171516.5695.16867@psf.upfronthosting.co.za> I left a few comments. Most of them apply to several parts of the code, even though I just commented in a single place. http://bugs.python.org/review/16278/diff/7518/Lib/test/test_os.py File Lib/test/test_os.py (right): http://bugs.python.org/review/16278/diff/7518/Lib/test/test_os.py#newcode55 Lib/test/test_os.py:55: # Tests creating TESTFN and os.rename I think it would be better to make a separate class for os.rename. The changes to setUp/tearDown are only needed for the new tests, but they are executed for all the old tests too, and that's not necessary. http://bugs.python.org/review/16278/diff/7518/Lib/test/test_os.py#newcode62 Lib/test/test_os.py:62: self.rename_src_file = "%s_%d_tmp" % ("test_rename_src_file", \ All the \ are useless and should be removed (or possibly replaced by an extra set of ()). http://bugs.python.org/review/16278/diff/7518/Lib/test/test_os.py#newcode85 Lib/test/test_os.py:85: if (os.path.exists(self.rename_dst_directory + "/file.txt")): Shouldn't this use os.path.join()? Also "/file.txt" is repeated over and over -- it would be better to use a variable instead. http://bugs.python.org/review/16278/diff/7518/Lib/test/test_os.py#newcode125 Lib/test/test_os.py:125: os.rmdir(self.rename_src_directory) This could be rewritten as: files = [support.TESTFN, self.rename_src_file, ...] for file in files: if os.path.exists(file): os.unlink(file) for the dirs you can have the same 4 lines with rmdir instead, or check if they are files or dir and use the same loop. http://bugs.python.org/review/16278/diff/7518/Lib/test/test_os.py#newcode161 Lib/test/test_os.py:161: @support.cpython_only Why are this cpython_only? Does the behavior depend on the CPython implementation or on the OS and/or underlying posix function? http://bugs.python.org/review/16278/diff/7518/Lib/test/test_os.py#newcode164 Lib/test/test_os.py:164: (sys.platform == 'win32') ), \ All the \ should be removed, and there are also 4 sets of () that are not necessary and could be removed as well. http://bugs.python.org/review/16278/diff/7518/Lib/test/test_os.py#newcode165 Lib/test/test_os.py:165: 'test specific to windows or linux or darwin only') Is this because you only tested it on these platforms? I would run it on other platforms too, and possibly add specific skips if they fail there (unless of course the failure is caused by a bug that should be fixed). If the skip is really necessary I would create a new skip decorator and use that, instead of repeating this over and over. http://bugs.python.org/review/16278/diff/7518/Lib/test/test_os.py#newcode167 Lib/test/test_os.py:167: if ((sys.platform == 'darwin') or (sys.platform.startswith == "linux")): All the () are unnecessary and should be removed. http://bugs.python.org/review/16278/diff/7518/Lib/test/test_os.py#newcode171 Lib/test/test_os.py:171: [b"beans", b"bacon", b"eggs", b"spam"]) PEP8 says that this should either be indented as self.assertEqual(fobj.read().splitlines(), [b"beans", b"bacon", b"eggs", b"spam"]) or as self.assertEqual( fobj.read().splitlines(), [b"beans", b"bacon", b"eggs", b"spam"]) http://www.python.org/dev/peps/pep-0008/#indentation http://bugs.python.org/review/16278/diff/7518/Lib/test/test_os.py#newcode185 Lib/test/test_os.py:185: os.unlink(self.rename_dst_file) # delete rename_dst_file Shouldn't the setUp/tearDown already take care of this? http://bugs.python.org/review/16278/diff/7518/Lib/test/test_os.py#newcode369 Lib/test/test_os.py:369: self.assertRaises(OSError, os.rename, self.rename_src_file, \ self.assertRaises() can be used as a context manager too, to make the code more readable. http://bugs.python.org/review/16278/diff/7518/Lib/test/test_os.py#newcode396 Lib/test/test_os.py:396: self.assertEqual(os.path.exists(self.rename_dst_directory), True) self.assertTrue(os.path.exists(self.rename_dst_directory)) http://bugs.python.org/review/16278/ From report at bugs.python.org Mon Mar 4 18:27:47 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 17:27:47 +0000 Subject: [docs] [issue16278] os.rename documentation slightly inaccurate In-Reply-To: <1350581776.08.0.668682100781.issue16278@psf.upfronthosting.co.za> Message-ID: <1362418067.39.0.748533119488.issue16278@psf.upfronthosting.co.za> Ezio Melotti added the comment: Adding more tests is good, even though there are still a few things that should be improved (see comments on rietveld). Regarding the documentation I'm not sure it's a good idea to be so detailed. On one hand, if we test the behavior we can make sure that the documentation is accurate, OTOH it might make the docs more confusing and once this behavior is documented it will be difficult to change it (and there might still be exceptions on different platforms/filesystems or if symlinks are involved). Maybe it would be better to suggest a LBYL approach rather trying to document and deal with all the different combinations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 18:29:57 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 17:29:57 +0000 Subject: [docs] [issue17332] typo in json docs - "convered" should be "converted" In-Reply-To: <1362173463.23.0.943587603223.issue17332@psf.upfronthosting.co.za> Message-ID: <1362418197.52.0.895898572871.issue17332@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- keywords: +easy stage: -> needs patch versions: -Python 2.6, Python 3.1, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 18:30:19 2013 From: report at bugs.python.org (moijes12) Date: Mon, 04 Mar 2013 17:30:19 +0000 Subject: [docs] [issue12768] docstrings for the threading module In-Reply-To: <1313548989.72.0.178892692878.issue12768@psf.upfronthosting.co.za> Message-ID: <1362418219.88.0.703328654353.issue12768@psf.upfronthosting.co.za> moijes12 added the comment: Hi I am seen the review comments and made the changes accordingly. I am not sure if my changes apply to 3.2. How do I do that ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 19:00:18 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 18:00:18 +0000 Subject: [docs] [issue16851] Hint about correct ismethod and isfunction usage In-Reply-To: <1357231289.77.0.0608728593688.issue16851@psf.upfronthosting.co.za> Message-ID: <1362420018.31.0.535883482457.issue16851@psf.upfronthosting.co.za> Ezio Melotti added the comment: I checked the tests on 2.7 and found this: # contrary to spec, ismethod() is also True for unbound methods # (see #1785) self.assertIn(('f', B.f), inspect.getmembers(B, inspect.ismethod)) #1785 also has some discussion about this. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 19:20:15 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 18:20:15 +0000 Subject: [docs] [issue12768] docstrings for the threading module In-Reply-To: <1313548989.72.0.178892692878.issue12768@psf.upfronthosting.co.za> Message-ID: <1362421215.52.0.58959940456.issue12768@psf.upfronthosting.co.za> Ezio Melotti added the comment: 3.2$ hg imp --no-c http://bugs.python.org/file29268/12768_2.patch applying http://bugs.python.org/file29268/12768_2.patch patching file Lib/threading.py Hunk #3 FAILED at 58 Hunk #4 FAILED at 79 Hunk #5 FAILED at 92 Hunk #6 FAILED at 125 Hunk #10 FAILED at 252 Hunk #12 succeeded at 386 with fuzz 1 (offset 82 lines). Hunk #13 FAILED at 317 Hunk #17 FAILED at 405 Hunk #22 FAILED at 576 Hunk #23 FAILED at 589 Hunk #30 FAILED at 897 Hunk #33 succeeded at 1124 with fuzz 2 (offset 132 lines). 10 out of 35 hunks FAILED -- saving rejects to file Lib/threading.py.rej abort: patch failed to apply > I am not sure if my changes apply to 3.2. How do I do that ? You have to switch to the 3.2 branch using "hg up 3.2", and then use "hg import" as showed above to apply the patch. You will also need to run configure/make again to build 3.2, so you can run tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 19:24:57 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 18:24:57 +0000 Subject: [docs] [issue12768] docstrings for the threading module In-Reply-To: <1313548989.72.0.178892692878.issue12768@psf.upfronthosting.co.za> Message-ID: <1362421497.07.0.326281456701.issue12768@psf.upfronthosting.co.za> Ezio Melotti added the comment: FWIW it applies cleanly on 3.3, but unless we decide to target 3.3+ only, the patch needs to be adapted for 2.7/3.2. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 05:05:14 2013 From: report at bugs.python.org (Todd Rovito) Date: Tue, 05 Mar 2013 04:05:14 +0000 Subject: [docs] [issue16278] os.rename documentation slightly inaccurate In-Reply-To: <1350581776.08.0.668682100781.issue16278@psf.upfronthosting.co.za> Message-ID: <1362456314.33.0.129592963196.issue16278@psf.upfronthosting.co.za> Todd Rovito added the comment: Ezio, Thank you or the feedback I will continue to polish the test cases. As far as the documentation I really like the table and find it easy to read but I could go either way. If you read the history of this issue other Python Core Developers asked to write test cases and make sure the documentation matches the test cases. It makes no difference to me I just want to contribute!!!! Which approach will produce the best results for the Python community? I think the table is a good compromise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 12:01:03 2013 From: report at bugs.python.org (Kushal Das) Date: Tue, 05 Mar 2013 11:01:03 +0000 Subject: [docs] [issue15465] Improved documentation for C API version info In-Reply-To: <1343372725.26.0.84225170505.issue15465@psf.upfronthosting.co.za> Message-ID: <1362481263.81.0.248568784146.issue15465@psf.upfronthosting.co.za> Changes by Kushal Das : Added file: http://bugs.python.org/file29313/issue15465v4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 12:04:13 2013 From: report at bugs.python.org (Kushal Das) Date: Tue, 05 Mar 2013 11:04:13 +0000 Subject: [docs] [issue15465] Improved documentation for C API version info In-Reply-To: <1343372725.26.0.84225170505.issue15465@psf.upfronthosting.co.za> Message-ID: <1362481452.96.0.502899141571.issue15465@psf.upfronthosting.co.za> Kushal Das added the comment: version 4 of the patch contains a new column in table as Bytes as suggested by Ezio Melotti ---------- _______________________________________ Python tracker _______________________________________ From eliben at gmail.com Tue Mar 5 15:26:24 2013 From: eliben at gmail.com (Eli Bendersky) Date: Tue, 5 Mar 2013 06:26:24 -0800 Subject: [docs] undocumented argtypes magic in ctypes? Message-ID: Hello, While playing with ctypes a bit, I noticed a feature that doesn't appear to be documented. Suppose I import the readdir_r function (assuming DIRENT is a correctly declared ctypes.Structure): DIR_p = c_void_p DIRENT_p = POINTER(DIRENT) DIRENT_pp = POINTER(DIRENT_p) readdir_r = lib.readdir_r readdir_r.argtypes = [DIR_p, DIRENT_p, DIRENT_pp] readdir_r.restype = c_int It seems that I can then call it as follows: dirent = DIRENT() result = DIRENT_p() readdir_r(dir_fd, dirent, result) Note that while readdir_r takes DIRENT_p and DIRENT_pp as its second and third args, I pass in just DIRENT and DIRENT_p, accordingly. What I should have done is use byref() on both, but ctypes seems to have some magic applied when argtypes declares pointer types. If I use byref, it still works. However, if I keep the same call and comment out the argtypes declaration, I get a segfault. So, is it a feature that should be documented, explicitly discouraged or is it a bug? Eli -------------- next part -------------- An HTML attachment was scrubbed... URL: From report at bugs.python.org Tue Mar 5 19:12:15 2013 From: report at bugs.python.org (Vladimir Rutsky) Date: Tue, 05 Mar 2013 18:12:15 +0000 Subject: [docs] [issue17356] Invalid link to repr() built-in function description Message-ID: <1362507135.12.0.423032726441.issue17356@psf.upfronthosting.co.za> New submission from Vladimir Rutsky: References to built-in function repr() links to repr module (http://docs.python.org/2/library/repr.html#module-repr), but must link to description in http://docs.python.org/2/library/functions.html. It can be at least in http://docs.python.org/2/library/functions.html (link in table at page top). ---------- assignee: docs at python components: Documentation messages: 183538 nosy: docs at python, vrutsky priority: normal severity: normal status: open title: Invalid link to repr() built-in function description type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 19:50:29 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 05 Mar 2013 18:50:29 +0000 Subject: [docs] [issue14489] repr() function link on the built-in function documentation is incorrect In-Reply-To: <1333520679.63.0.90940412535.issue14489@psf.upfronthosting.co.za> Message-ID: <1362509429.26.0.22786968807.issue14489@psf.upfronthosting.co.za> R. David Murray added the comment: Confirm that this is not fixed. ---------- resolution: fixed -> stage: committed/rejected -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 19:51:23 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 05 Mar 2013 18:51:23 +0000 Subject: [docs] [issue17356] Invalid link to repr() built-in function description In-Reply-To: <1362507135.12.0.423032726441.issue17356@psf.upfronthosting.co.za> Message-ID: <1362509483.56.0.232116337658.issue17356@psf.upfronthosting.co.za> R. David Murray added the comment: Closing in favor of re-opening issue 14489, which tried to fix this and apparently failed. ---------- nosy: +r.david.murray resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> repr() function link on the built-in function documentation is incorrect _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 19:51:48 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 05 Mar 2013 18:51:48 +0000 Subject: [docs] [issue14489] repr() function link on the built-in function documentation is incorrect In-Reply-To: <1333520679.63.0.90940412535.issue14489@psf.upfronthosting.co.za> Message-ID: <1362509508.68.0.718886368437.issue14489@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- nosy: +vrutsky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 20:01:10 2013 From: report at bugs.python.org (Ezio Melotti) Date: Tue, 05 Mar 2013 19:01:10 +0000 Subject: [docs] [issue14489] repr() function link on the built-in function documentation is incorrect In-Reply-To: <1333520679.63.0.90940412535.issue14489@psf.upfronthosting.co.za> Message-ID: <1362510070.19.0.205950491087.issue14489@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 20:40:25 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 05 Mar 2013 19:40:25 +0000 Subject: [docs] [issue17359] python modules.zip is not documented Message-ID: <1362512425.64.0.937549165034.issue17359@psf.upfronthosting.co.za> New submission from Marc-Andre Lemburg: The feature to run a ZIP file containing Python modules is not documented. It was implemented in Python 2.6: * http://bugs.python.org/issue1739468 and mentioned in the "What's new": * http://docs.python.org/2/whatsnew/2.6.html?highlight=python%20run%20zip%20files#other-language-changes but searching the documentation for "__main__.py" returns 0 hits in the docs (for Python 2.7 and 3.4). I guess "python dir" should also be mentioned somewhere... ---------- assignee: docs at python components: Documentation messages: 183550 nosy: docs at python, lemburg priority: normal severity: normal status: open title: python modules.zip is not documented versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 20:48:45 2013 From: report at bugs.python.org (Eli Bendersky) Date: Tue, 05 Mar 2013 19:48:45 +0000 Subject: [docs] [issue17359] python modules.zip is not documented In-Reply-To: <1362512425.64.0.937549165034.issue17359@psf.upfronthosting.co.za> Message-ID: <1362512925.34.0.75235502308.issue17359@psf.upfronthosting.co.za> Eli Bendersky added the comment: >From http://docs.python.org/3/using/cmdline.html: Package names are also permitted. When a package name is supplied instead of a normal module, the interpreter will execute .__main__ as the main module. This behaviour is deliberately similar to the handling of directories and zipfiles that are passed to the interpreter as the script argument. This is for "-m" Also: