[issue8144] muliprocessing shutdown infinite loop
New submission from brandon : Multiprocessing goes into an infinite loop during shutdown, trying to connect to a remote queue - I *think* during finalization. The actual loop appears to be the while(1) in connection.py line 251, and I think it is being called initially from manager.py finalization. I can reliably reproduce but my code base is large and ugly, and I am still trimming down to a nice clean sample to submit. -- messages: 101078 nosy: drraid severity: normal status: open title: muliprocessing shutdown infinite loop type: behavior versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue8144> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8144] muliprocessing shutdown infinite loop
brandon added the comment: After getting into the infinite loop, here's exception from CTRL-C (posted just to show stack trace -- i am still working on getting come sample code together -- meant to show it is infact in that while(1) a 251 in connection.py): KeyboardInterrupt ^CError in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/lib/python2.6/atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "/home/drraid/code/fuzzer/fuzznet/multiprocessing/util.py", line 260, in _exit_function _run_finalizers(0) File "/home/drraid/code/fuzzer/fuzznet/multiprocessing/util.py", line 235, in _run_finalizers finalizer() File "/home/drraid/code/fuzzer/fuzznet/multiprocessing/util.py", line 174, in __call__ res = self._callback(*self._args, **self._kwargs) File "/home/drraid/code/fuzzer/fuzznet/multiprocessing/managers.py", line 773, in _decref conn = _Client(token.address, authkey=authkey) File "/home/drraid/code/fuzzer/fuzznet/multiprocessing/connection.py", line 134, in Client c = SocketClient(address) File "/home/drraid/code/fuzzer/fuzznet/multiprocessing/connection.py", line 258, in SocketClient time.sleep(0.01) KeyboardInterrupt Error in sys.exitfunc: Traceback (most recent call last): File "/usr/lib/python2.6/atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "/home/drraid/code/fuzzer/fuzznet/multiprocessing/util.py", line 260, in _exit_function _run_finalizers(0) File "/home/drraid/code/fuzzer/fuzznet/multiprocessing/util.py", line 235, in _run_finalizers finalizer() File "/home/drraid/code/fuzzer/fuzznet/multiprocessing/util.py", line 174, in __call__ res = self._callback(*self._args, **self._kwargs) File "/home/drraid/code/fuzzer/fuzznet/multiprocessing/managers.py", line 773, in _decref conn = _Client(token.address, authkey=authkey) File "/home/drraid/code/fuzzer/fuzznet/multiprocessing/connection.py", line 134, in Client c = SocketClient(address) File "/home/drraid/code/fuzzer/fuzznet/multiprocessing/connection.py", line 258, in SocketClient time.sleep(0.01) KeyboardInterrupt -- ___ Python tracker <http://bugs.python.org/issue8144> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40332] RegEx for numbers in documentation (easy fix - solution provided)
New submission from Brandon : The regular expression used for matching numbers in the documentation for the regular expressions module (the tokenizer section) doesn't match the string ".5", but does match the string "3.". Here's a link to the tokenizer section of the documentation: https://docs.python.org/3/library/re.html#writing-a-tokenizer The tokenizer example uses r'\d+(\.\d*)?' for matching numbers. I would personally match ".5" as a number before I would match "3." as a number. In order to do this, I would use r'(\d*\.)?\d+' instead of r'\d+(\.\d*)?'. Python 3's interpreter matches both "3." and ".5" as numbers when interpreting code, so you could use a different regex example for matching both if you wanted to be consistent with Python's own interpreter. -- components: Regular Expressions messages: 366801 nosy: TheBrandonGuy, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: RegEx for numbers in documentation (easy fix - solution provided) type: behavior versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue40332> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42316] Walrus Operator in list index
New submission from Brandon : Reading the PEP 572 document I don't see anything stating that Walrus operator in list indexes must be enclosed in parenthesis. Minimal Example: ''' In [1]: a = list(range(10)) In [2]: idx = -1 In [3]: a[idx := idx +1] File "", line 1 a[idx := idx +1] ^ SyntaxError: invalid syntax ''' If you enclose in parenthesis it works as expected: ''' In [4]: a[(idx := idx +1)] Out[4]: 0 In [5]: a[(idx := idx +1)] Out[5]: 1 In [6]: a[(idx := idx +1)] Out[6]: 2 ''' Is this a bug or am I misreading the PEP 572 document somewhere? It's not a top-level assignment nor is it a list comprehension so I would expect it to work in the first example. -- components: asyncio messages: 380691 nosy: Brando753, asvetlov, yselivanov priority: normal severity: normal status: open title: Walrus Operator in list index versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue42316> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21570] String being confused with datetime.datetime object.
New submission from Brandon: Observe the following code: import MySQLdb, MySQLdb.cursors, datetime """ ... mysqlCursor is a cursor object from a connection to database from the MySQLdb module ... """ mysqlCursor.execute("SELECT NOW()") timeRow = mysqlCursor.fetchall() currentDateTime = datetime.datetime.strptime(timeRow[0]["NOW()"], "%Y-%m-%d %H:%M:%S") I get the following error: TypeError: must be string, not datetime.datetime HOWEVER, when I cast timeRow[0]["NOW()"] to a string like: str(timeRow[0]["NOW()"]) , it works fine. For whatever reason the Python interpreter seems to interpret the string from the row of the MySQLdb cursor result as a datetime.datetime object. I have no explanation for this, besides it looking like a date time in the format of -mm-dd HH:MM:SS. I have not tried this in Python 3.x, but the bug is in the latest compile of version 2.7.6 from the FTP distribution site. -- components: Interpreter Core messages: 219041 nosy: brandon priority: normal severity: normal status: open title: String being confused with datetime.datetime object. type: compile error versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue21570> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21570] String being confused with datetime.datetime object.
Brandon added the comment: Type returned as datetime, I was not familiar with the MySQLdb code. Sorry for the bad report. -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue21570> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21570] String being confused with datetime.datetime object.
Changes by Brandon : -- resolution: -> not a bug ___ Python tracker <http://bugs.python.org/issue21570> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1519638] Unmatched Group issue - workaround
Brandon Mintern <[EMAIL PROTECTED]> added the comment: Looking at your code example, that solution seems quite obvious now, and I wouldn't even call it a "workaround". Thanks for figuring this out. Now if I could only remember what code I was using that for... ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1519638> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1519638] Unmatched Group issue
Brandon Mintern added the comment: This is still a problem which has just given me a headache, because using re.sub now requires gymnastics instead of just using a simple string as I did in Perl. -- nosy: +BMintern _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1519638> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1661] re.match ignores optional flags when receiving a compiled regex pattern
New submission from Brandon Corfman: Python's documentation for the re.match function is match(pattern, string, [flags]) where pattern can be either a regex string or a compiled regex object. If it's a compiled regex object, then supplying an optional flag to re.match (in my case, re.IGNORECASE) doesn't work and, more to the point, fails silently. I think this should throw an exception if it's not going to work. See http://mysite.verizon.net/bcorfman/2007/12/something-i-hate-about-pythons-re.html for a discussion. A possible change (proposed by effbot) is below: Index: re.py === --- re.py (revision 52330) +++ re.py (working copy) @@ -224,6 +224,7 @@ return p pattern, flags = key if isinstance(pattern, _pattern_type): +assert not flags return pattern if not sre_compile.isstring(pattern): raise TypeError, "first argument must be string or compiled pattern" -- components: Regular Expressions messages: 58808 nosy: bcorfman severity: normal status: open title: re.match ignores optional flags when receiving a compiled regex pattern type: behavior versions: Python 2.5 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1661> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2660] 2to3 throws a utf8 decode error on a iso-8859-1 string
New submission from Brandon Ehle <[EMAIL PROTECTED]>: While running the 2to3 script on the scons codebase, I ran into an UnicodeDecodeError. Attached is just the portion of the script that causes the error. 2to3 throws an error on the string regardless of whether the unicode string literal is prepended on the front. RefactoringTool: Skipping implicit fixer: buffer RefactoringTool: Skipping implicit fixer: idioms RefactoringTool: Skipping implicit fixer: ws_comma Traceback (most recent call last): File "/usr/local/bin/2to3", line 5, in sys.exit(refactor.main()) File "/usr/local/lib/python3.0/lib2to3/refactor.py", line 81, in main rt.refactor_args(args) File "/usr/local/lib/python3.0/lib2to3/refactor.py", line 188, in refactor_args self.refactor_file(arg) File "/usr/local/lib/python3.0/lib2to3/refactor.py", line 217, in refactor_file input = f.read() + "\n" # Silence certain parse errors File "/usr/local/lib/python3.0/io.py", line 1611, in read decoder.decode(self.buffer.read(), final=True)) File "/usr/local/lib/python3.0/io.py", line 1199, in decode output = self.decoder.decode(input, final=final) File "/usr/local/lib/python3.0/codecs.py", line 300, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf8' codec can't decode bytes in position 59-60: invalid data -- assignee: collinwinter components: 2to3 (2.x to 3.0 conversion tool) files: 2to3bug.py messages: 65637 nosy: azverkan, collinwinter severity: normal status: open title: 2to3 throws a utf8 decode error on a iso-8859-1 string versions: Python 3.0 Added file: http://bugs.python.org/file10063/2to3bug.py __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2660> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2660] Py3k fails to parse a file with an iso-8859-1 string
Brandon Ehle <[EMAIL PROTECTED]> added the comment: Someone on the #python IRC channel suggested that the default for python 3.0 for unicode string literals is reversed from python 2.5. If you remove the unicode string literal (u'') from the front of the string, it runs fine under python 3.0 and fails under 2.5 and 2.6 instead. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2660> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2660] Py3k fails to parse a file with an iso-8859-1 string
Brandon Ehle <[EMAIL PROTECTED]> added the comment: Also, I can confirm that running 2to3 with Python 2.6 correctly converts the script but running 2to3 with Python 3.0 results in a UnicodeDecodeError exception. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2660> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4212] email.LazyImporter does not use absolute imports
New submission from Brandon Bloom <[EMAIL PROTECTED]>: I have a package with a module called "email". If I try to use the standard email package, it fails to load email.Utils because email.LazyImporter is looking in my email module instead of the top- level email package. -- components: Library (Lib) messages: 75251 nosy: brandonbloom severity: normal status: open title: email.LazyImporter does not use absolute imports type: behavior versions: Python 2.5.3 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4212> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4691] IDLE Code Caching Windows
New submission from Brandon Dixon : I made changes to my code and hit F5 to run it through IDLE. The code appeared to run without any errors, but when I closed everything out and ran it again it turned out to be full of errors. I am able to replicate this problem with my code and have seen others have the same problem, but its unclear when and what causes the caching to take place. I created a test file that only contained "print hello". I ran this, made changes and then ran it again. The changes were reflected, but after testing my code, it still cached. Attached is a simple python file I used to test everything out. Run the test, then comment out the Struct class and run it again. No errors should appear, but if you close the code, reopen it and then run it again it will error. -- components: IDLE files: bug-test.py messages: 78010 nosy: brandon.dixon severity: normal status: open title: IDLE Code Caching Windows type: behavior versions: Python 2.5, Python 2.6 Added file: http://bugs.python.org/file12392/bug-test.py ___ Python tracker <http://bugs.python.org/issue4691> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4691] IDLE Code Caching Windows
Brandon Dixon added the comment: I tested this issue in Linux using the IDLE package (packed separately) from Python. I was not able to reproduce this error, so it appears to be with the Windows version of Python. ___ Python tracker <http://bugs.python.org/issue4691> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5105] sqlite3.Row class, handling duplicate column names resulting from a SQL join
New submission from Brandon Adams : When using sqlite3.Row as the row_factory for a sqlite3 connection and performing a SQL join that returns rows from two or more tables with identical column names, the returned sqlite3.Row object contains duplicate keys. Subsequently, when trying to access values by key, only the value contained in the lowest numbered index matching the key is returned. Additionally, attempting to use the keys returned to create a new table in the database fails due to a duplicate column name error. A better behavior would be for the sqlite3.Row object's indices to be prefixed with table names for cases in which a query produces results from two or more tables. -- components: Library (Lib) messages: 80798 nosy: sockonafish severity: normal status: open title: sqlite3.Row class, handling duplicate column names resulting from a SQL join type: behavior versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue5105> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5105] sqlite3.Row class, handling duplicate column names resulting from a SQL join
Brandon Adams added the comment: Ah, that's it. Thanks for the tip, this issue can be closed now. ___ Python tracker <http://bugs.python.org/issue5105> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38820] Make Python compatible with OpenSSL 3.0.0
Change by Brandon Weeks : -- nosy: +bweeks ___ Python tracker <https://bugs.python.org/issue38820> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44159] mimetypes - "strict" on Windows
Change by Brandon Schabell : -- keywords: +patch nosy: +brandonschabell nosy_count: 5.0 -> 6.0 pull_requests: +25636 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27088 ___ Python tracker <https://bugs.python.org/issue44159> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44564] DeprecationWarning in test_enum over formatting
Change by Brandon Schabell : -- keywords: +patch nosy: +brandonschabell nosy_count: 2.0 -> 3.0 pull_requests: +25638 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27090 ___ Python tracker <https://bugs.python.org/issue44564> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39068] Base 85 encoding initialization race conditiong
New submission from Brandon Stansbury : Under multi-threading scenarios a race condition may occur where a thread sees an initialized `_b85chars` table but an uninitialized `_b85chars2` table due to the guard only checking the first table. This causes an exception like: ``` File "/usr/lib/python3.6/base64.py", line 434, in b85encode return _85encode(b, _b85chars, _b85chars2, pad), File "/usr/lib/python3.6/base64.py", line 294, in _85encode for word in words], File "/usr/lib/python3.6/base64.py", line 294, in for word in words], "TypeError: 'NoneType' object is not subscriptable ``` -- components: Library (Lib) messages: 358495 nosy: drmonkeysee priority: normal pull_requests: 17096 severity: normal status: open title: Base 85 encoding initialization race conditiong type: crash versions: Python 3.6 ___ Python tracker <https://bugs.python.org/issue39068> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39068] Base 85 encoding initialization race condition
Change by Brandon Stansbury : -- title: Base 85 encoding initialization race conditiong -> Base 85 encoding initialization race condition ___ Python tracker <https://bugs.python.org/issue39068> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37749] ipaddress - is_global method all multicast addresses and networks return true
New submission from Brandon James : When using the ipaddress library, all multicast addresses and networks return True when using the is_global method for their respective classes. I believe their are two possible fixes for this. 1) In practice no multicast addresses are globally routable. If our definition of is_global means the address is globally routable, then I propose adding not is_multicast to each class's is_global logic. 2) RFC 5771 (IPv4) and RFCs 4291 and 7346 (IPv6) both have guidelines for what MAY be routed on the public internet (as mentioned above multicast is not routed globally in practice). Logic following those guidelines should be added. IPv4: 224.0.1.0/24, AD-HOC I, II and III addresses 224.0.2.0 - 224.0.255.255, 224.3.0.0 - 224.4.255.255, and 233.252.0.0 - 233.255.255.255 IPv6: Multicast addresses with 0xE in the SCOPE field The current logic is inaccurate when looking at the relevant RFCs and worse when looking at how routing is actually implemented. Github PR submitted for option 1 above. I've also submitted a thread to NANOG's mailing list (currently pending moderator approval) posing a few questions regarding the RFCs above. I think it's unlikely that multicast will ever be publicly routed on the internet, so really we just need to define global here. My definition would be addresses that are routed on the public internet. -- components: Library (Lib) messages: 348942 nosy: bjames priority: normal severity: normal status: open title: ipaddress - is_global method all multicast addresses and networks return true ___ Python tracker <https://bugs.python.org/issue37749> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37749] ipaddress - is_global method all multicast addresses and networks return true
Change by Brandon James : -- keywords: +patch pull_requests: +14833 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15088 ___ Python tracker <https://bugs.python.org/issue37749> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21075] fileinput should use stdin.buffer for "rb" mode
New submission from Brandon Rhodes: In Python 3, fileinput.input() returns str lines whether the data is coming from stdin or from a list of files on the command line. But if input(mode='rb') is specified, then its behavior becomes inconsistent: lines from stdin are delivered as already-decoded strings, but data from files is delivered (correctly) as bytes. The solution may be that, if a "b" is anywhere in the mode, then input() should read from the bytes stdin.buffer data source instead of from stdin. Otherwise the "rb" mode is rather useless since you can wind up getting text from it anyway depending on how you are invoked. -- components: Library (Lib) messages: 214952 nosy: brandon-rhodes priority: normal severity: normal status: open title: fileinput should use stdin.buffer for "rb" mode type: behavior versions: Python 3.4 ___ Python tracker <http://bugs.python.org/issue21075> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21079] EmailMessage.is_attachment == False if filename is present
New submission from Brandon Rhodes: Most attachments (in my inbox, at least) specify a filename, and thus have a Content-Disposition header that looks like: Content-Disposition: attachment; filename="attachment.gz" In fact, this sample header was generated by the new add_attachment() method in Python itself. Unfortunately, the is_attachment property currently does this test: c_d.lower() == 'attachment' Which means that it returns False for almost all attachments in my email archive. I believe that the test should instead be: c_d.split(';', 1)[0].lower() == 'attachment' -- components: email messages: 214969 nosy: barry, brandon-rhodes, r.david.murray priority: normal severity: normal status: open title: EmailMessage.is_attachment == False if filename is present versions: Python 3.4 ___ Python tracker <http://bugs.python.org/issue21079> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21079] EmailMessage.is_attachment == False if filename is present
Brandon Rhodes added the comment: Oh - this also, happily, explains why iter_attachments() is ignoring all of the attachments on my email: because it internally relies upon is_attachment to make the decision. So this fix will also make iter_attachments() usable! -- ___ Python tracker <http://bugs.python.org/issue21079> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21079] EmailMessage.is_attachment == False if filename is present
Brandon Rhodes added the comment: Okay, having looked at the source a bit more it would probably make more sense to use _splitparam() instead of doing the split manually. -- ___ Python tracker <http://bugs.python.org/issue21079> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21079] EmailMessage.is_attachment == False if filename is present
Brandon Rhodes added the comment: Given that methods like get_param() already exist for pulling data out of the right-hand-side of the ';' in a parameterized email header, would it be amiss for EmailMessage to also have a method that either returns everything to the left of the semicolon, or returns something like: ('attachment', [('filename', 'example.txt')]) thus doing all the parsing in one place that everything else can then steadily rely upon, including users that want to pull the parsed values for their own inspection? -- ___ Python tracker <http://bugs.python.org/issue21079> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21079] EmailMessage.is_attachment == False if filename is present
Brandon Rhodes added the comment: Understood. I wonder where in the documentation the ability to get the content disposition should wind up? I am almost tempted to suggest a get_content_disposition() method that parallels get_content_type(), mostly to avoid having to document the asymmetry between how users should go about getting these two pieces of information. :) -- ___ Python tracker <http://bugs.python.org/issue21079> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21079] EmailMessage.is_attachment == False if filename is present
Brandon Rhodes added the comment: I agree that is_attachment supports the most common use-case of people who need to inspect the content disposition! But people implementing heavyweight tools and email clients might additionally need to distinguish between a MIME part whose disposition is explicitly "inline" and a MIME part whose disposition is simply unspecified — since the RFC seems to allow clients quite a bit of freedom in the case where it is entirely unspecified: "Content-Disposition is an optional header field. In its absence, the MUA may use whatever presentation method it deems suitable." — RFC 2183 And a three-possibility 'inline'|'attachment'|None return value from get_content_disposition() would perfectly reflect the three possibilities envisioned in the standard. -- ___ Python tracker <http://bugs.python.org/issue21079> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21083] Add get_content_disposition() to email.message.Message
New submission from Brandon Rhodes: "Content-Disposition is an optional header field. In its absence, the MUA may use whatever presentation method it deems suitable." — RFC 2183 The email.message.Message class should gain a get_content_disposition() method with the three possible return values 'inline', 'attachment', and None so that email clients can easily distinguish between the three states described in the RFC. See also the discussion at http://bugs.python.org/issue21079 -- components: email messages: 215036 nosy: barry, brandon-rhodes, r.david.murray priority: normal severity: normal status: open title: Add get_content_disposition() to email.message.Message type: enhancement versions: Python 3.5 ___ Python tracker <http://bugs.python.org/issue21083> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21079] EmailMessage.is_attachment == False if filename is present
Brandon Rhodes added the comment: Thanks — done! http://bugs.python.org/issue21083 -- ___ Python tracker <http://bugs.python.org/issue21079> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21091] EmailMessage.is_attachment should be a method
New submission from Brandon Rhodes: I love properties and think they should be everywhere. But consistency is more important, so I suspect that EmailMessage.is_attachment should be demoted to a normal method. Why? Because if it remains a property then I am likely to first write: if msg.is_attachment: ... and then later, when doing another bit of email logic, write: if msg.is_multipart: ... Unfortunately this second piece of code will give me no error and will appear to run just fine, because bool(a_method) always returns True without a problem or warning or error. But the result will not be what I expect: the if statement's true block will always run, regardless of whether the message is multipart. Since EmailMessage is still provisional, and since no one can use is_attachment yet anyway because it is broken for nearly all attachments, mightn't we make these two features consistent before calling it official? -- components: email messages: 215104 nosy: barry, brandon-rhodes, r.david.murray priority: normal severity: normal status: open title: EmailMessage.is_attachment should be a method versions: Python 3.4 ___ Python tracker <http://bugs.python.org/issue21091> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21095] EmailMessage should support Header objects
New submission from Brandon Rhodes: Currently, the new wonderful EmailMessage class ignores the encoding specified in any Header objects that are provided to it. import email.message, email.header m = email.message.Message() m['Subject'] = email.header.Header('Böðvarr'.encode('latin-1'), 'latin-1') print(m.as_string()) Subject: =?iso-8859-1?q?B=F6=F0varr?= m = email.message.EmailMessage() m['Subject'] = email.header.Header('Böðvarr'.encode('latin-1'), 'latin-1') print(m.as_string()) Traceback (most recent call last): ... TypeError: 'Header' object does not support indexing If the EmailMessage came to recognize and support Header objects, then Python programmers under specific constraints regarding what encodings their customers' email clients will recognize and support would be able to hand-craft the selection of the correct encoding instead of being forced to either ASCII or UTF-8 with binary as the two predominant choices that EmailMessage makes on its own. -- components: email messages: 215112 nosy: barry, brandon-rhodes, r.david.murray priority: normal severity: normal status: open title: EmailMessage should support Header objects versions: Python 3.4 ___ Python tracker <http://bugs.python.org/issue21095> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19536] MatchObject should offer __getitem__()
New submission from Brandon Rhodes: Regular expression re.MatchObject objects are sequences. They contain at least one “group” string, possibly more, which are integer-indexed starting at zero. Today, groups can be accessed in one of two ways. (1) You can call the method match.group(N). (2) You can call glist = match.groups() and then access each group as glist[N-1]. Note the obvious off-by-one error: .groups() does not include “group zero”, which contains the entire match, and therefore its indexes are off-by-one from the values you would pass to .group(). I propose that MatchObject gain a __getitem__(N) method whose return value for every N is the same as .group(N) as I think that match[N] is a quite obvious syntax for asking for one particular group of an RE match. The only objection I can see to this proposal is the obvious asymmetry between Group Zero and all subsequent groups of a regular expression pattern: zero means “the whole thing” whereas each of the others holds the content of a particular explicit set of parens. Looping over the elements match[0], match[1], ... of a pattern like this: r'(\d\d\d\d)/(\d\d)/(\d\d)' will give you *first* the *entire* match, and only then turn its attention to the three parenthesized substrings. My retort is that concentric groups can happen anyway: that Group Zero, holding the entire match, is not really as special as the newcomer might suspect, because you can always wind up with groups inside of other groups; it is simply part of the semantics of regular expressions that groups might overlap or might contain one another, as in: r'((\d\d)/(\d\d)) Description: (.*)' Here, we see that concentricity is not a special property of Group Zero, but in fact something that can happen quite naturally with other groups. The caller simply needs to imagine every regular expression being surrounded by an “automatic set of parentheses” to understand where Group Zero comes from, and how it will be ordered in the resulting sequence of groups relative to the subordinate groups within the string. If one or two people voice agreement here in this issue, I will be very happy to offer a patch. -- components: Regular Expressions messages: 202480 nosy: brandon-rhodes, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: MatchObject should offer __getitem__() type: enhancement versions: Python 3.5 ___ Python tracker <http://bugs.python.org/issue19536> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19536] MatchObject should offer __getitem__()
Changes by Brandon Rhodes : -- versions: +Python 3.4 -Python 3.5 ___ Python tracker <http://bugs.python.org/issue19536> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21956] Deleted document should not appear in 3.4 docs
New submission from Brandon Rhodes: There was an old document in the "howto" folder whose advice was in many cases flat-out wrong, so Raymond Hettinger performed a wonderful public service by deleting it back in 2011: http://hg.python.org/cpython/rev/80ff78425419 Unfortunately it looks like the process for publishing Python documentation only adds documents, but never deletes them, so a copy of the documentation is still available under the "3.4" document tree: https://docs.python.org/3.4/howto/doanddont.html It should be deleted as soon as possible. Because it is presumed that only the most accurate and up-to-date documentation lives under the URL "3.4", people are reading and debating this document's bad advice as though it is official guidance as to how to use the language. (The only hint that something is wrong, alas, is the tiny detail that the top-left of the page says “Python v3.3a0 documentation”). The advice is currently being debated on Twitter and people are sad that they are supposed to stop using “from foo import bar” in Python. -- messages: 222741 nosy: brandon-rhodes priority: normal severity: normal status: open title: Deleted document should not appear in 3.4 docs ___ Python tracker <http://bugs.python.org/issue21956> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21956] Deleted document should not appear in 3.4 docs
Changes by Brandon Rhodes : -- assignee: -> docs@python components: +Documentation nosy: +docs@python versions: +Python 3.4 ___ Python tracker <http://bugs.python.org/issue21956> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21956] Deleted document should not appear in 3.4 docs
Brandon Rhodes added the comment: The question of whether the document ought to be removed is not at issue here. The document was already deleted, in 2011, by Raymond Hettinger, with the consent of its author. I told that story merely as background. The issue here is that the Python web site is out of date with the documentation in the Mercurial source repository, which is clear because what is clearly marked as an old 3.3-alpha document is being served out of the /3.4/ directory. This is probably because the documentation “push” script does not remove documents from the site, and can be corrected through a simple "rm" by anyone with access to the server. -- ___ Python tracker <http://bugs.python.org/issue21956> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21956] Doc files deleted from repo are not deleted from docs.python.org.
Brandon Rhodes added the comment: I do not find it unreasonable, on a page of Python idioms, the we would call an example that explicitly says "Don't" in its title an "anti-idiom." -- ___ Python tracker <http://bugs.python.org/issue21956> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21956] Doc files deleted from repo are not deleted from docs.python.org.
Brandon Rhodes added the comment: Now that I am back at a full keyboard, I see that my previous response to @BreamoreBoy about this issue is too short and too cryptic to really serve as a fair answer to his question. And, with some embarrassment, I note that my words did not even achieve the dignity of forming an actual English sentence. Alas for cramped travel laptop keyboards and airport wi-fi! Might I be allowed another try? If so, then: @BreamoreBoy, I think that your confusion ("How does that translate?") can be blamed squarely on the document in question. Instead of introducing and maintaining a consistent terminology, it manages to burden the reader with two parallel and redundant sets of terms for exactly the same idea. In short, the document title does not match the document itself. The title of the document sets forth the terms "Idiom" and "Anti-idiom" as its subject. But then it completely drops the ball. The terms are not defined in the document itself. They are not clarified anywhere in its text. Nor are they even *used* anywhere in its body, with a single lonely exception buried down somewhere around the middle (second paragraph under "Exceptions"). Instead, the body uses the simpler phrases "Do", "do not", and "should not." It is running in its "do not" / "don't" mode when it reaches the sentence you quote, Mark, about "from...import" statements. So the answer to your "How does that translate" question is that what the title promises as "Idioms" and "Anti-idioms" actually come out verbally in the text as "do" and "don't" instead. When someone jumps into the middle of the document without context, they see only "do" or "don't" and are left wondering where the terminology of "idioms" is even coming from. But it comes directly from the title, as the only possible mapping between the document's terms and those of its title. So when the document says: from module import name1, name2. - This is a "don’t"... the careful reader who has noticed and remembered the title will simultaneously read: from module import name1, name2. - This is an anti-idiom... Which is almost exactly the text of Audrey's tweet. -- ___ Python tracker <http://bugs.python.org/issue21956> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: In order to fix the issue I added on to the WindowsDefault class so that it is the main browser class for windows platforms as opposed to being a default when no other browser is given. I gave the class an init where it specifies specific flags for firefox, chrome, and internet explorer (from what I could find there aren't really new window or new tab flags for internet explorer). If the flags for other browsers are known they should be easy to add to this section. def __init__(self,browser = "windows-default"): # Grab the different flags for the different browser types browser.lower() self.browsername = browser # If get() is used without arguments browser will be passed None if browser == "windows_default" or browser == None: self.cmd = "start" elif browser == 'iexplore' or browser == 'internet explorer': self.cmd = "start iexplore" self.newwindow = "" self.newtab = "" elif browser == "chrome": self.cmd = "start chrome.exe" self.newwindow = "-new-window" self.newtab = "-new-tab" elif browser == "firefox": self.cmd = "start firefox.exe" self.newwindow = "-new-window" self.newtab = "-new-tab" else: raise Error('The browser you entered (%s) is not currently supported on windows' % browser) In the open method of the WindowsDefault class I changed how the browser is opened by building a command from the flags and the cmd for the specific browser and used subprocess,call. # Format the command for optional arguments and add the url if new == 1: self.cmd += " " + self.newwindow elif new == 2: self.cmd += " " + self.newtab self.cmd += " " + url subprocess.call(self.cmd,shell = True) This allows the user to input different new arguments to open a new window or new tab like the documentation says they should be able to do. I added a little bit to the beginning of the get function so that it passes its argument to the WindowsDefault class and returns that object on Windows systems. # Let the windows default class handle different browsers on windows if sys.platform[:3] == "win": return WindowsDefault(using) This adds some of the desired compatibility but does not completely address the module's issues. I did not see a way to open a web page in a currently open page on any of the browsers, just new windows and new tabs (when no flags are passed the browsers default to one of these two options). Also the _isexecutable function's attempt at windows compatibility is still not working because I was unsure of how to use just a string of a browser name like 'chrome' to determine if a file is on a system. This leaves _tryorder not properly containing the browsers on the system. This leaves the module's open, open_new and open_new_tab not properly working either just the WindowsDefault open method. Any feed back and direction from here is most welcome. -- nosy: +jbmilam Added file: http://bugs.python.org/file36110/webbrowserdebug.py ___ Python tracker <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: How the _isexecutable function is set up now it would require a full path name in order to be able to tell if a specific browser is on the system. The area under platform support for windows checks for multiple browsers using this function but only passes it browser names and so it always returns false and does not add any browsers to _tryorder. I found a way to fix this using os.walk so that the simple strings of the browser names like "firefox.exe" is able to actually able to be found on the system. This method is rather slow though and the module wants to check for 8 browsers when imported. -- ___ Python tracker <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: I got rid of the __init__ for the WindowsDefault class that I asked about earlier and changed it to match the sub-classing model that the Unix browsers use. This caused some changes in the get function too. Due to the _isexecutable still not completely working, the get function is hard coded for chrome, internet explorer and firefox for windows systems. This is my first attempt at making a patch file so if it is incorrect please bear with me. -- keywords: +patch Added file: http://bugs.python.org/file36265/webbrowserfix.patch ___ Python tracker <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4691] IDLE Code Caching Windows
Brandon Dixon added the comment: Can you guys let me know when this is fixed or thought to be fixed. I would like to test from my end just to ensure. On Sun, Aug 2, 2009 at 11:27 PM, Guilherme Polo wrote: > > Guilherme Polo added the comment: > > Amaury, from what I remember your suggestion has been applied some time > ago. Can you check if the newest Windows installer still adds an '-n' by > default ? > > -- > > ___ > Python tracker > <http://bugs.python.org/issue4691> > ___ > -- Added file: http://bugs.python.org/file14636/unnamed ___ Python tracker <http://bugs.python.org/issue4691> ___Can you guys let me know when this is fixed or thought to be fixed. I would like to test from my end just to ensure. On Sun, Aug 2, 2009 at 11:27 PM, Guilherme Polo <mailto:rep...@bugs.python.org";>rep...@bugs.python.org> wrote: Guilherme Polo <mailto:ggp...@gmail.com";>ggp...@gmail.com> added the comment: Amaury, from what I remember your suggestion has been applied some time ago. Can you check if the newest Windows installer still adds an '-n' by default ? -- ___ Python tracker <mailto:rep...@bugs.python.org";>rep...@bugs.python.org> <http://bugs.python.org/issue4691"; target="_blank">http://bugs.python.org/issue4691> ___ -- Brandon Dixon - CCNA, OSCP, WebSphere DataPower Solution DeveloperInformation Systems Security Engineerhttp://www.dueyesterday.net";>www.dueyesterday.net - Documentation for the masses ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6861] bytearray.__new__ doesn't subclass
Brandon Height added the comment: This behavior is also found inside of version 2.6.2 -- nosy: +lasko ___ Python tracker <http://bugs.python.org/issue6861> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7250] wsgiref.handlers.CGIHandler caches os.environ, leaking info between requests
New submission from Brandon Bloom : This issue came up while doing Google App Engine development. Apparently the default wsgi handler logic is to cache os.environ into os_environ at import time. This is reasonable behavior for wsgi, but when using cgi, this is a serious security hole which leaks information between requests. See this related bug at GAE: http://code.google.com/p/googleappengine/issues/detail? id=2040&q=cookies%20dev_appserver.py&colspec=ID%20Type%20Status%20Priority %20Stars%20Owner%20Summary%20Log%20Component -- components: Library (Lib) messages: 94819 nosy: snprbob86 severity: normal status: open title: wsgiref.handlers.CGIHandler caches os.environ, leaking info between requests type: security versions: Python 2.5 ___ Python tracker <http://bugs.python.org/issue7250> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7250] wsgiref.handlers.CGIHandler caches os.environ, leaking info between requests
Brandon Bloom added the comment: > That is, in a true CGI environment, there can't be *multiple* requests > made to CGIHandler, and so it can't leak. In "normal" (i.e. pre-GAE) > long-running web environments, os.environ would not contain any request > information, only the process startup environment. That's fair. In this case the CGIHandler should raise an exception on subsequent requests to prevent this programming error. > If someone wants to provide a GAEHandler class, great; otherwise, the > documented way to run a WSGI app under GAE is the > google.appengine.ext.webapp.util.run_wsgi_app function. I'm not sure if run_wsgi_app was available right from the start, as some early tutorials and samples show using CGIHandler. That's how we ran into this issue. -- ___ Python tracker <http://bugs.python.org/issue7250> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7250] wsgiref.handlers.CGIHandler caches os.environ, leaking info between requests
Brandon Bloom added the comment: > Hm. In retrospect, CGIHandler should probably just set os_environ to an > empty dictionary in its class body (thereby not using the cached > environ), and this would then work correctly for repeated uses. > > This would be a clean bugfix and wouldn't affect behavior for any > existing uses of CGIHandler that weren't already worse broken than the > GAE case. ;-) Yup, rock on with that :-) -- ___ Python tracker <http://bugs.python.org/issue7250> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7297] Releasing FamousFoodFinder.com
For the past 2 months a friend and I have been working on a site (http://www.famousfoodfinder.com";>www.famousfoodfinder.com) that would allow users to search for famous restaurants. The idea initially came from the fact that I love food and have been considering traveling around the US for quite some time. I couldn't think of a better way to enjoy good food and travel than to hit up all the places that I saw on all my favorite shows. Searching online didn't reveal any site that contained multiple shows and allowed me to filter my searches. Rather then wait for someone to add the shows I wanted or the searching capabilities I felt were necessary, I decided to create my own. The site currently supports 5 popular shows:"Diners, Drive-Ins and Dives""Feasting on Asphalt 1""Feasting on Asphalt 2""The Best Thing I Ever Ate""Throwdown with Bobby Flay" We are currently working on adding more details to each show as well as a few other shows that feature more restaurants. The site is still in beta, but we wanted to release it in it's current state so that users could suggest ideas on how to improve the design/functionality. We hope you find it as useful as we do. Please send any feedback, comments, or requests to: mailto:bran...@famousfoodfinder.com";>bran...@famousfoodfinder.com. -- Brandon Dixon - CCNA, OSCP, WebSphere DataPower Solution DeveloperInformation Systems Security Engineerhttp://www.dueyesterday.net"; target="_blank">www.dueyesterday.net - Documentation for the masses http://www.famousfoodfinder.com"; target="_blank">www.famousfoodfinder.com - Search for famous restaurants around you! For the past 2 months a friend and I have been working on a site (http://www.famousfoodfinder.com";>www.famousfoodfinder.com) that would allow users to search for famous restaurants. The idea initially came from the fact that I love food and have been considering traveling around the US for quite some time. I couldn't think of a better way to enjoy good food and travel than to hit up all the places that I saw on all my favorite shows. Searching online didn't reveal any site that contained multiple shows and allowed me to filter my searches. Rather then wait for someone to add the shows I wanted or the searching capabilities I felt were necessary, I decided to create my own. The site currently supports 5 popular shows:"Diners, Drive-Ins and Dives""Feasting on Asphalt 1""Feasting on Asphalt 2""The Best Thing I Ever Ate""Throwdown with Bobby Flay" We are currently working on adding more details to each show as well as a few other shows that feature more restaurants. The site is still in beta, but we wanted to release it in it's current state so that users could suggest ideas on how to improve the design/functionality. We hope you find it as useful as we do. Please send any feedback, comments, or requests to: mailto:bran...@famousfoodfinder.com";>bran...@famousfoodfinder.com. -- Brandon Dixon - CCNA, OSCP, WebSphere DataPower Solution DeveloperInformation Systems Security Engineerhttp://www.dueyesterday.net"; target="_blank">www.dueyesterday.net - Documentation for the masses http://www.famousfoodfinder.com"; target="_blank">www.famousfoodfinder.com - Search for famous restaurants around you! ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5501] Update multiprocessing docs re: freeze_support
New submission from Brandon Corfman : Indicate in docs whether freeze_support() can be called without issues on Unix or OS X, so the user knows whether they can have a single code base that works correctly on all platforms. -- assignee: georg.brandl components: Documentation messages: 83690 nosy: bcorfman, georg.brandl, jnoller severity: normal status: open title: Update multiprocessing docs re: freeze_support type: feature request versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue5501> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: I kept the changes to the WindowsDefault.open() method and used and extended eryksun's code to build the browser list using the registry. Also I added support for a few more browsers. Some of the browsers I could not find ways to differentiate between opening a new window or new tab using command line flags. This also removed the hardcoding I had put in the get function. -- Added file: http://bugs.python.org/file39525/webbrowserfix2.patch ___ Python tracker <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: I went ahead and took the assert statement out and added support for vista using a union of sets for both the 32 bit and 64 bit locations. -- Added file: http://bugs.python.org/file39533/webbrowserfix3.patch ___ Python tracker <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: On second thought no type testing is required if sets are used because the union will take out duplicates anyways and so I removed the type testing and left in the set union code. -- Added file: http://bugs.python.org/file39534/webbrowserfix3.patch ___ Python tracker <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24147] Dialect class defaults are not documented.
Brandon Milam added the comment: Hi all, I've been looking at this bug and am ready to start putting in some work on it but I have some questions about what is wanting to be done. From what I can tell these are the possible tasks for this issue. - Add to the docs under the dialect section the excel attributes vs. the dialect class attributes and explain how the excel dialect is the default and this is the functionality you'd be changing by creating a new dialect. - Add code to make sure that a certain number of attributes are set before the dialect can be accessed. (Though this might be C code and not really a C programmer nor do I know where _Dialect is in the repository) - Change the defaults in the dialects class because currently the documentation for "double quote" and "skip initial space" says that the default is False when in the code it is None. Also I did not find the "strict" dialect in the module at all. (maybe its part of that C code that I don't know how to find. - Add an example to the documentation on sub-classing dialect under the example on registering a new dialect If someone could clarify which of these is the desired direction for this issue it would be much appreciated. -- nosy: +jbmilam ___ Python tracker <http://bugs.python.org/issue24147> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23659] csv.register_dialect doc string
Brandon Milam added the comment: I believe this was the requested change. Let me know if more was desired. -- keywords: +patch nosy: +jbmilam Added file: http://bugs.python.org/file39540/register_dialect_docstring_fix.patch ___ Python tracker <http://bugs.python.org/issue23659> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23659] csv.register_dialect doc string
Brandon Milam added the comment: Sorry, I forgot an end parentheses in the doc string of the last patch. -- Added file: http://bugs.python.org/file39541/register_dialect_docstring_fix.patch ___ Python tracker <http://bugs.python.org/issue23659> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24147] Dialect class defaults are not documented.
Brandon Milam added the comment: Here I added on to the Dialects and Formatting Parameters paragraph explaining that the defaults listed are for the excel dialect and that all the attributes need to be specified if the user is wanting to create custom dialects through sub-classing. I will also include the html file this produces for those who do not want to look at the .rst file. Also I can go in and change the defaults of the Dialect class on the parameters that expect Boolean values if desired but I would open a separate issue for it. Let me know if there are any errors or desired changes in document change. -- keywords: +patch Added file: http://bugs.python.org/file39552/csv_dialect_doc_clarify.patch ___ Python tracker <http://bugs.python.org/issue24147> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24147] Dialect class defaults are not documented.
Changes by Brandon Milam : Added file: http://bugs.python.org/file39553/csv.html ___ Python tracker <http://bugs.python.org/issue24147> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21297] csv.skipinitialspace only skips spaces, not "whitespace" in general
Brandon Milam added the comment: This code shows what Daniel Andersson was talking about. I changed the "whitespace" references in the documentation that Daniel mentioned to say spaces. Also I changed "ignore space at the start of the field" to "ignore spaces at the start of the field" due to Terry's confusion. Let me know of any errors or extra changes that are needed. -- nosy: +jbmilam Added file: http://bugs.python.org/file39558/csv_skipinitialspace_testing.py ___ Python tracker <http://bugs.python.org/issue21297> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21297] csv.skipinitialspace only skips spaces, not "whitespace" in general
Changes by Brandon Milam : Added file: http://bugs.python.org/file39559/csv_skipinitialspace_testing.csv ___ Python tracker <http://bugs.python.org/issue21297> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21297] csv.skipinitialspace only skips spaces, not "whitespace" in general
Changes by Brandon Milam : -- keywords: +patch Added file: http://bugs.python.org/file39560/csv_skipinitialspace_docfix.patch ___ Python tracker <http://bugs.python.org/issue21297> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: Forgive me the excessive number of patch submissions as I am still getting my feet wet in contributing to Python. I'm posting another patch that is not functionally different from the last patch but should better adhere to the PEP8 style guide. Please let me know of any additional changes that need to be made or if a different functionality is preferred. -- Added file: http://bugs.python.org/file39590/webbrowserfix4.patch ___ Python tracker <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12020] Attribute error with flush on stdout,stderr
Brandon Milam added the comment: I've been looking over the issue and the error is just raised by the stdout change not the stderr change (when the stdout line is commented out in the setAutoFlush function no error is raised). The flush method doesn't seem to be required as Serhiy pointed out since the script still is able to run. This is the cause for the error, however and I think that the required subset of methods for stdout objects to avoid errors could be clarified in the documentation. This documentation addition I think would be best under the sys.stdout info rather than under io.TextIOBase since the error can be raised without going through this class at all like in the original post. I would like to add this documentation under sys.stdout as required subset of methods that must be defined and was wondering if there were any other methods than flush() that would need to be defined. -- nosy: +jbmilam ___ Python tracker <http://bugs.python.org/issue12020> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: Here's a patch addressing all of the comments in the review. Changing the browsers from a set to a list though resulted in duplicates in the _tryorder list that were not present before because the set had filtered the duplicates before the partial string comparisons. The _browsers dictionary did not contain the duplicates so I don't think this will have any functional changes. -- Added file: http://bugs.python.org/file39626/webbrowserfix5.patch ___ Python tracker <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24148] 'cum' not a valid sort key for pstats.Stats.sort_stats
Brandon Milam added the comment: They are correct. 'cum' is not one of the available keywords and so here is the fix changing it to say 'cumulative' for consistency as ramiro suggested. -- keywords: +patch nosy: +jbmilam Added file: http://bugs.python.org/file39627/profile_example_fix.patch ___ Python tracker <http://bugs.python.org/issue24148> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: Moved the 64 bit browser list to its own loop and switched to browsers.append rather than +=. -- Added file: http://bugs.python.org/file39650/webbrowserfix6.patch ___ Python tracker <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24452] Make webbrowser support Chrome on Mac OS X
Brandon Milam added the comment: Boštjan Mejak the windows issue has been addressed in issue 8232 and recently patched for 3.5. http://bugs.python.org/issue8232 -- nosy: +jbmilam ___ Python tracker <http://bugs.python.org/issue24452> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21297] csv.skipinitialspace only skips spaces, not "whitespace" in general
Brandon Milam added the comment: This is my first attempt at working with the test suite but I believe this is what you were asking for. Due to this being my first attempt at writing tests I have included it as a separate patch file. Any further changes just let me know. -- Added file: http://bugs.python.org/file39732/skipinitialspace_test.patch ___ Python tracker <http://bugs.python.org/issue21297> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: applying 25005_1.patch patching file Lib/webbrowser.py Hunk #1 FAILED at 498 Hunk #2 FAILED at 524 Hunk #3 FAILED at 532 Hunk #4 FAILED at 540 Hunk #5 FAILED at 548 I'm trying to apply your patch after applying webbrowserfix6.patch but I am encountering problems. I first tried "hg import --no-commit file.patch" for both patches but it wouldn't let me use the command two times in a row without committing the changes for the first one so I tried committing the webbrowserfix6.patch changes and then using the import command and I get this error message. I would like to try to make sure the code still does what it is supposed to but I can't check until I can get both patches in. Hunk #6 FAILED at 556 6 out of 6 hunks FAILED -- saving rejects to file Lib/webbrowser.py.rej patching file Modules/posixmodule.c Hunk #1 FAILED at 10522 Hunk #2 FAILED at 10578 Hunk #3 FAILED at 10590 Hunk #4 FAILED at 10606 Hunk #5 FAILED at 10616 5 out of 5 hunks FAILED -- saving rejects to file Modules/posixmodule.c.rej abort: patch failed to apply -- ___ Python tracker <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: Ok I've been able to test the new patch now and I'm not sure that os.startfile is going to work. I've been able to get os.startfile() to open a specified browser (>>> os.startfile("chrome.exe", "open")), however, the function does not allow additional arguments(>>> os.startfile("chrome.exe", "open", "www.yahoo.com") Traceback (most recent call last): File "", line 1, in TypeError: startfile() takes at most 2 arguments (3 given))) so not even a url will be allowed to be specified as the code is written in the patch let alone specifying new window or new tab. Is this an error on os.startfile's part? The documentation for it seems to indicate that it should take multiple inputs. I don't have much experience with C to be able to find out figure out what the rest of your patch accomplished. -- ___ Python tracker <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: Finally got it rebuilt after having trouble with visual studio for awhile. I've tested the new patch and it is still able to properly find both chrome and firefox and is able to differentiate between new window and new tab for those two browsers so it appears to still be working. -- ___ Python tracker <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25884] inspect.getmro() fails when base class lacks __bases__ attribute.
New submission from Brandon Zerbe: I am using a possibly non-standard python package called Forthon, and when I inspect an object that is dependent on the Forthon class, I get the following error: File "/Users/zerbeb/homemade_programs/config2class/src/method_parsing.py", line 18, in get_all_init_args inherited_classes = inspect.getmro(class_obj) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/inspect.py", line 346, in getmro if hasattr(cls, "__bases__"): File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/inspect.py", line 337, in _searchbases for base in cls.__bases__: AttributeError: 'Forthon' object has no attribute '__bases__' This was easy enough to fix, simply add "if not hasattr(cls,'__bases__'): return" to the _searchbases function: def _searchbases(cls, accum): # Simulate the "classic class" search order. if cls in accum: return if not hasattr(cls, "__bases__"): #Additional code. return accum.append(cls) for base in cls.__bases__: _searchbases(base, accum) Maybe you have a better solution, but I think this edge case can be trivially solved however you decide to edit the code. Thanks! -- messages: 256525 nosy: billyziege priority: normal severity: normal status: open title: inspect.getmro() fails when base class lacks __bases__ attribute. versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue25884> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25884] inspect.getmro() fails when base class lacks __bases__ attribute.
Brandon Zerbe added the comment: I am using Python 2.7.5. The segment of code from inspect that I previously extracted came from line 332 although you may also find it by "finding" _searchbases. This is really an issue with Forthon: http://hifweb.lbl.gov/Forthon/ Specifically the Forthon class, which I think is older than current standards. If you guys want this Forthon class to flag an error (I can work around that too), than the proposed fix I sent can be rejected, and this ticket can be closed. I just wanted to bring this case to you attention just in case. Thanks again, Brandon Quoting "R. David Murray" : > > R. David Murray added the comment: > > Which version of python are you running? I can't match that > traceback up to the code in the current 2.7 inspect module. > > That said, the same issue probably exists in the current code. A 2.7 > class is expected to have either an __mro__ or a __bases__ attribute, > and if it has neither inspect probably *should* throw an error, since > it can't know what to do with the class. The error could be clearer, > though. > > But, let's see what others think. > > -- > nosy: +r.david.murray > > ___ > Python tracker > <http://bugs.python.org/issue25884> > ___ > -- ___ Python tracker <http://bugs.python.org/issue25884> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: I've tested the new patch and it is still able to properly find both chrome and firefox and is able to differentiate between new window and new tab for those two browsers so it is still working. Would someone review the patch? -- ___ Python tracker <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26780] Illustrate both binary operator conventions in PEP-8
New submission from Brandon Rhodes: I am delighted to see that PEP-8 has pivoted to breaking long formulae before, rather than after, each binary operator! But I would like to pivot the PEP away from citing my own PyCon Canada talk as the authority on the matter, and toward citing Knuth himself. It would also be an enhancement for the PEP to show both options and make an argument for the practice, instead of simply asserting that one is better than the other. I therefore propose the attached patch. -- assignee: docs@python components: Documentation files: pep8-knuth.patch keywords: patch messages: 263554 nosy: barry, brandon-rhodes, docs@python, gvanrossum priority: normal severity: normal status: open title: Illustrate both binary operator conventions in PEP-8 Added file: http://bugs.python.org/file42487/pep8-knuth.patch ___ Python tracker <http://bugs.python.org/issue26780> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26780] Illustrate both binary operator conventions in PEP-8
Changes by Brandon Rhodes : Removed file: http://bugs.python.org/file42487/pep8-knuth.patch ___ Python tracker <http://bugs.python.org/issue26780> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26780] Illustrate both binary operator conventions in PEP-8
Changes by Brandon Rhodes : Added file: http://bugs.python.org/file42489/pep8-knuth.patch ___ Python tracker <http://bugs.python.org/issue26780> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26780] Illustrate both binary operator conventions in PEP-8
Brandon Rhodes added the comment: Another important objection against the current text is that it stacks a series of `and` and `or` operators at the same level of indentation, as though they naturally evaluate in the order the programmer writes them. In fact, they have different levels of precedence, and the code example violates the other sections of PEP-8 that ask for the creation of a visual distinction in code between different precedence levels. The example needs to pivot towards a series of operators which belong at the same precedence level. I have used `+` and `-` because they seemed more natural to form an example from than something like division and multiplication. -- ___ Python tracker <http://bugs.python.org/issue26780> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26780] Illustrate both binary operator conventions in PEP-8
Changes by Brandon Rhodes : -- type: -> enhancement ___ Python tracker <http://bugs.python.org/issue26780> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1947] Exception exceptions.AttributeError '_shutdown' in
Brandon Craig Rhodes added the comment: In case Google brings anyone else to this bug: this error typically indicates that a `threading.py` which is not actually the Standard Library's `threading` module has somehow wound up on an earlier path in `sys.path` and is therefore shadowing the Standard Library module. This upsets the Python exit logic, which tries to run `threading._shutdown()` if `threading` exists in `sys.modules`. I just helped someone on Stack Overflow with a situation like this, which in that case resulted from an error in how `pylint` works. -- nosy: +brandon-rhodes ___ Python tracker <http://bugs.python.org/issue1947> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13477] tarfile module should have a command line
New submission from Brandon Craig Rhodes : The tarfile module should have a simple command line that allows it to be executed with "-m" — even if its only ability was to take a filename and extract it to the current directory, it could be a lifesaver on Windows machines where Python has been installed but nothing else. Would such a patch be welcome if I could write one up? -- messages: 148300 nosy: brandon-rhodes priority: normal severity: normal status: open title: tarfile module should have a command line ___ Python tracker <http://bugs.python.org/issue13477> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes added the comment: Éric, I think your points are good ones. (And, as I return to this patch after three months, I should thank the PSF for sponsoring the CPython sprint here at PyOhio, and creating this opportunity for me to continue trying to land this patch!) I am attaching a fourth version of the patch. It incorporates your two suggestions, Éric. It also applies cleanly once against today's trunk; besides the usual line number changes as code has come and gone, I am happy to see that my change of an "assertTrue" for an "assertIs" in the test suite has already taken place thanks to another patch in the meantime. -- Added file: http://bugs.python.org/file22822/test_copy4.patch ___ Python tracker <http://bugs.python.org/issue11572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11561] "coverage" of Python regrtest cannot see initial import of libs
Brandon Craig Rhodes added the comment: Éric, I think your suggestions are all good ones, and I have incorporated them into the file. (But do note that the departures we are now making from Ned's own copy of the tracer code — removing the commented-out debugging statement, and the long comment, and the inheritance from object — might make it harder to bring in changes from his own copy if he should ever further improve it.) I have tried to write the comments to be more informative, while also addressing your own ideas; let me know if you like the result! Oh: and, I am continuing to use this new file in my own work on the Python core, and it has been working fine — so no problems with the actual code have developed over these first 3+ months of use. -- Added file: http://bugs.python.org/file22823/fullcoverage2.patch ___ Python tracker <http://bugs.python.org/issue11561> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes added the comment: Ezio and Sandro, thank you very much for your attention to this issue, and for helping me split it into manageable chunks! To answer the question about why "coverage" does not show as high a total as it ought: it's because coverage normally can't see the outer, global scope execution of modules that are already imported by the time "coverage" itself can take control and install a tracer. I have another patch outstanding that fixes this — we are still working on it, but the code works fine — if you want to run "coverage" and see a more accurate number: http://bugs.python.org/issue11561 -- ___ Python tracker <http://bugs.python.org/issue11572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11561] "coverage" of Python regrtest cannot see initial import of libs
Brandon Craig Rhodes added the comment: Brett, yes, you are welcome to close this issue — Ned quite handily convinced me that coverage code belongs in the "coverage" distribution, not languishing about in the CPython source tree. That solution also quite beautifully solves the copyright problem. So I happily withdraw my request for this feature. Nick, Brett is working on exactly the sort of devguide improvement that you suggest — not least because the devguide will now need to instruct people in how to build "coverage" so that its C-accelerated tracer is available, which Ned's own patch to "coverage" to cover stdlib tracing uses instead of the Python tracer that I cut-and-pasted into this patch. Finally, it would be wonderful to have a more formal mechanism for boot-time interventions. I have mentioned before my wish that Python's first action be to open() the executable, check its tail to see if it's a valid zipfile, and if so to try loading and running "startup.py" from that zipfile. Among other things, that would allow single-file distribution of pure-Python applications without the py2exe/py2app mess that prevails in the projects I work with today. But since the whole issue of grabbing control at boot time raises hackles ("why would you want to do that!?"), and I needed something working immediately during the PyCon sprint, I elected to simply adopt "encodings.py" as my way in. It works great, and "coverage" can evolve to an even better mechanism as soon as one becomes available, should anyone want to take the bootup option and run with it. One final thought: should PyPy etc also implement the same boot protocol, should one be invented, so that all mainline interpreters can be instrumented the same way? -- ___ Python tracker <http://bugs.python.org/issue11561> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9723] pipes.quote() needs to be documented
New submission from Brandon Craig Rhodes : The only way to safely build shell command lines from inside of Python — which is necessary when sending commands across SSH, since that behaves like os.system() rather than like subprocess.call() — is to use the wonderful pipes.call() method to turn possibly-dangerous arguments, like filenames that might have spaces, special characters, and embedded "rm -r" calls, into perfectly quoted strings for an "sh"-like shell (say, bash or zsh). This call is already recommended on mailing lists, blog posts, and Stack Overflow — and since it doesn't start with a "_", I think its public use is fair game. But the "pipes" documentation itself doesn't officially mention or support it. I think it should be added to the Standard Library documentation for "pipes". So. Yeah. -- assignee: d...@python components: Documentation messages: 115263 nosy: brandon-rhodes, d...@python priority: normal severity: normal status: open title: pipes.quote() needs to be documented type: feature request versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker <http://bugs.python.org/issue9723> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11561] "coverage" of Python regrtest cannot see initial import of libs
New submission from Brandon Craig Rhodes : When running the Python regression tests in "coverage", the initial outer level of interpreted code in several standard library modules shows as not having been covered by the tests, because they were imported during the Python boot process and were already loaded when the "coverage" command got control. -- messages: 131051 nosy: brandon-rhodes priority: normal severity: normal status: open title: "coverage" of Python regrtest cannot see initial import of libs ___ Python tracker <http://bugs.python.org/issue11561> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11561] "coverage" of Python regrtest cannot see initial import of libs
Brandon Craig Rhodes added the comment: Here is a module that solves this problem if the tests are run with the "fullcoverage" directory at the front of the PYTHONPATH, like this: PYTHONPATH=Tools/fullcoverage ./python -m coverage run --pylib Lib/test/regrtest.py test_copy -- keywords: +patch Added file: http://bugs.python.org/file21232/fullcoverage.patch ___ Python tracker <http://bugs.python.org/issue11561> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
New submission from Brandon Craig Rhodes : The attached patch will bring Lib/copy.py to 100% test coverage. A bug in "coverage" results in its only reporting 99% at the moment; see coverage issue #122 on bitbucket: https://bitbucket.org/ned/coveragepy/issue/122/for-else-always-reports-missing-branch This patch makes several minor improvements to "copy": when doing getattr lookups with a default of "None", it now uses an "is" comparison against None which is both faster and more correct; several special cases have been removed since Python 3 always has "CodeType" available; and an ancient obsolete test suite that had been appended to copy.py in ancient times has been removed. -- files: test_copy.patch keywords: patch messages: 131135 nosy: brandon-rhodes priority: normal severity: normal status: open title: bring Lib/copy.py to 100% coverage versions: Python 3.3 Added file: http://bugs.python.org/file21244/test_copy.patch ___ Python tracker <http://bugs.python.org/issue11572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue502085] pickle problems (with Boost.Python)
Brandon Craig Rhodes added the comment: Benjamin, I would like some way to know when our tests achieve 100% coverage because otherwise I will keep coming back to this module to add more tests and have to re-discover code that is not CPython relevant. But for now I have removed the pragmas. The attached patch also changes assertIs() and assertIsNot(), and uses self.fail() instead of the exception inside of "support". Thanks for those pointers! -- keywords: +patch nosy: +brandon-rhodes Added file: http://bugs.python.org/file21245/test_copy2.patch ___ Python tracker <http://bugs.python.org/issue502085> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue502085] pickle problems (with Boost.Python)
Changes by Brandon Craig Rhodes : Removed file: http://bugs.python.org/file21245/test_copy2.patch ___ Python tracker <http://bugs.python.org/issue502085> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes added the comment: Benjamin, thanks for the pointers! The attached patch now uses assertIs() and assertIsNot(), and calls self.fail() instead of using the exception from "support". In the future I would like some way to determine when test coverage is fully achieved, so that I do not come back to this module every few months and have to re-discover why it is not 100%. But for the moment I have indeed removed the pragmas, pending a better approach! -- Added file: http://bugs.python.org/file21246/test_copy2.patch ___ Python tracker <http://bugs.python.org/issue11572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes added the comment: Éric, the Makefile in Python trunk seems to include Objects/complexobject.o in the build unilaterally without any way to turn it off. What is leading you to believe that Python 3 can conditionally turn the "complex" type off during a build? I do not understand your question about Unicode — could you reference the line number in the patch file that is worrying you? -- ___ Python tracker <http://bugs.python.org/issue11572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes added the comment: Antoine, neither this issue, nor either version of my patch, was intended to assert that 100% test coverage indicates that a test of tests are complete. If you will point out where in the text this is implied, I will correct it. Thanks! -- ___ Python tracker <http://bugs.python.org/issue11572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes added the comment: Éric, after checking line 112 of the two patches and then of the new file, I figured out that you meant line 112 of the old file — and, yes, that test can go away too since in python3 "complex" always exists and "unicode" never exists. A further improved patch (#3) is attached. -- Added file: http://bugs.python.org/file21276/test_copy3.patch ___ Python tracker <http://bugs.python.org/issue11572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes added the comment: Nick Coghlan writes: > Nick Coghlan added the comment: > > Regarding "__reduce__", other readers will have the same question Éric > did, so that point should definitely go in a comment after the > "__reduce_ex__" check. I had initially wanted to make a comment, but feared the objection that a comment would eventually fall out of sync with the implementation of object.__reduce_ex__ over the years (just as copy.py currently has all sorts of cruft that is no longer applicable). But I think that you are right that a comment that's at least true today is better than no comment at all; so I will add one on Monday. -- ___ Python tracker <http://bugs.python.org/issue11572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11572] bring Lib/copy.py to 100% coverage
Brandon Craig Rhodes added the comment: Nick Coghlan writes: > Regarding "__reduce__", other readers will have the same question Éric > did, so that point should definitely go in a comment after the > "__reduce_ex__" check. I just sat down to review this issue, and, looking at test_copy3.patch, isn't there already a comment next to each __reduce_ex__ check that reminds the reader that object.__reduce_ex__ will itself call __reduce__? Does the comment just need to be more elaborate or something? Finally, Éric wants me to replace this: > self.assertTrue(issubclass(copy.Error, Exception)) with self.assertIsInstance(). But surely the question is not whether copy.Error is an *instance* of Exception? They are both instances of *type*, right? What I would need is something like assertIsSubclass or assertInheritsFrom, neither of which exists. So I think that test_copy3.patch already includes all of the valid improvements on the table; if I'm missing one, just point it out and I'll fix it! -- ___ Python tracker <http://bugs.python.org/issue11572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com