[issue3874] documentation bug: HTMLParser needs to document unknown_decl
New submission from jeff <[EMAIL PROTECTED]>: the unknown_decl function is critical to dealing with MS Office generated HTML files. There's no documentation of that. The default behavior of the function is to error, which is reasonable, but it should be stated in the documentation. -- components: Library (Lib) messages: 73282 nosy: freyley severity: normal status: open title: documentation bug: HTMLParser needs to document unknown_decl type: behavior versions: Python 2.5 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3874> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3874] documentation bug: HTMLParser needs to document unknown_decl
jeff added the comment: On Wed, Jun 16, 2010 at 5:55 PM, Terry J. Reedy wrote: > > Terry J. Reedy added the comment: > > Documentation issues should be component: documentation rather than library. > When submitting one, please at least indicate the module or class concerned. > I have never heard of 'unknown_decl' function. It's your bug tracker. This sort of statement that says that I should know exactly how you want bugs reported only serves to tell people like me not to even try. In addition, it's inaccurate in this case, as the title of the bug is that HTMLParser, which is a module in the standard library, needs a function documented. HTMLParser runs over HTML and calls internal functions when certain events occur. unknown_decl is called when an unknown declaration is found, and by default, it throws an exception. Thus, to correctly use HTMLParser, when subclassing it, you need to override unknown_decl if there are any unknown declarations in your HTML (or if you think there might be). > Preferably, indicate the specific section you want modified, by version, > number and name. Best is to submit a suggested text to be inserted. You may > know better than most issue reviewers what should be said. Someone else will > add markup and possibly edit. It's been almost 2 years since I submitted this bug. I don't know if it applies to Python 3, and at this point I find it difficult to care. Thanks, Jeff -- status: pending -> open ___ Python tracker <http://bugs.python.org/issue3874> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3874] documentation bug: HTMLParser needs to document unknown_decl
jeff added the comment: On Thu, Jun 17, 2010 at 3:30 PM, Terry J. Reedy wrote: > In order for the doc maintainers to add an entry, someone knowledgeable must > write it. Your paragraph of explanation is a start, but more editing is > needed. > > Looking at dir(html.parser.HTMLParser) and help(...), I see that there are > several public internal methods. Some have doc strings that show up with > help(), some do not. I thing all should. Some are defined on HTMLParser and > some inherited from the undocumented (I believe) _markupbase.ParserBase. > > I see that there are also several (completely undocumented except fir dir()) > private ('_xyz') internal methods. This implies to me that the public > internal methods were made public rather than private because there might be > reason to override them. If so, perhaps there should be a new subsection on > public internal methods to explain what is what with them. What do you think? > Document just one, some, or all? Terry, I'm looking at the HTMLParser code, and I only see unknown_decl as a method in there that is: a) not marked as internal or doing a lot, b) not documented. There are a number of methods which should probably be refactored to be _methodname rather than methodname, but that's beyond the scope of this report. HTMLParser.unknown_decl(data)¶ Method called when an unrecognized SGML declaration is read by the parser. The data parameter will be the entire contents of the declaration inside the markup. It is sometimes useful to be be overridden by a derived class; the base class implementation throws an HTMLParseError. There may be other undocumented methods showing up, but if so they're part of a parent class. Thanks, Jeff -- ___ Python tracker <http://bugs.python.org/issue3874> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46830] Add Find functionality to Squeezed Text viewer
New submission from Jeff Cagle : Squeezed text output currently opens in a viewer whose only functionality is scrolling. Adding the Find widget a la IDLE would make the viewer much more useful. -- assignee: terry.reedy components: IDLE messages: 413761 nosy: Jeff.Cagle, terry.reedy priority: normal severity: normal status: open title: Add Find functionality to Squeezed Text viewer type: enhancement versions: Python 3.11 ___ Python tracker <https://bugs.python.org/issue46830> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12890] cgitb displays tags when executed in text mode
Jeff McNeil added the comment: Is there anything else needed here? -- ___ Python tracker <http://bugs.python.org/issue12890> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12890] cgitb displays tags when executed in text mode
Jeff McNeil added the comment: I didn't add one initially as I was just changing output format and not actual behavior. I guess I could add something to ensure it doesn't regress? I'll make sure there's coverage to begin with. -- ___ Python tracker <http://bugs.python.org/issue12890> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12890] cgitb displays tags when executed in text mode
Jeff McNeil added the comment: Test to ensure html isn't included when the formatting is text. I don't seem to be able to update the stage. -- Added file: http://bugs.python.org/file23731/head-cgitb-display-tests.patch ___ Python tracker <http://bugs.python.org/issue12890> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12890] cgitb displays tags when executed in text mode
Jeff McNeil added the comment: Added everything to one file. Updated tests to also include a logdir argument as that is required to trigger the original bug. Weeded out a spurious write that occurred when format was set to text. -- Added file: http://bugs.python.org/file23737/head-cgitb-display.patch ___ Python tracker <http://bugs.python.org/issue12890> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12890] cgitb displays tags when executed in text mode
Changes by Jeff McNeil : Added file: http://bugs.python.org/file23743/head-cgitb-display.patch ___ Python tracker <http://bugs.python.org/issue12890> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13685] argparse does not sanitize help strings for % signs
New submission from Jeff Yurkiw : I discovered this while programming the command line interface for a python program that can take a passed argument and throw it into the 'where like' clause of a SQL expression (intended for a postgresql database). The wildcard character for where-like statements is generally the percent sign, which is how I found this ("WHERE %s LIKE '%--value%')". If you use any single '%' signs in an ArgumentParser.new_argument(help=)'s help description Python 3.2 will throw an error. Workaround: You can avoid this issue by doubling up on all % signs that you want to display in your help text. parser.add_argument(('--foo', action='store',help='%bar') throws an error. parser.add_argument(('--foo', action='store',help='%%bar') displays '--foo FOO %bar'. Suggested fix: When assigning help strings from add_argument(), throw them through a sanitizer and replace all occurrences of '%' with '%%' behind the scenes. Example code (argparseBug.py): from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument('--foo', action='store', help='%bar') args = parser.parse_args('-h'.split()) You get the following stacktrace: Traceback (most recent call last): File "/path/to/script/argparseBug.py", line 6, in args = parser.parse_args('-h'.split()) File "/usr/lib/python3.2/argparse.py", line 1701, in parse_args args, argv = self.parse_known_args(args, namespace) File "/usr/lib/python3.2/argparse.py", line 1733, in parse_known_args namespace, args = self._parse_known_args(args, namespace) File "/usr/lib/python3.2/argparse.py", line 1939, in _parse_known_args start_index = consume_optional(start_index) File "/usr/lib/python3.2/argparse.py", line 1879, in consume_optional take_action(action, args, option_string) File "/usr/lib/python3.2/argparse.py", line 1807, in take_action action(self, namespace, argument_values, option_string) File "/usr/lib/python3.2/argparse.py", line 994, in __call__ parser.print_help() File "/usr/lib/python3.2/argparse.py", line 2331, in print_help self._print_message(self.format_help(), file) File "/usr/lib/python3.2/argparse.py", line 2305, in format_help return formatter.format_help() File "/usr/lib/python3.2/argparse.py", line 279, in format_help help = self._root_section.format_help() File "/usr/lib/python3.2/argparse.py", line 209, in format_help func(*args) File "/usr/lib/python3.2/argparse.py", line 209, in format_help func(*args) File "/usr/lib/python3.2/argparse.py", line 515, in _format_action help_text = self._expand_help(action) File "/usr/lib/python3.2/argparse.py", line 601, in _expand_help return self._get_help_string(action) % params ValueError: unsupported format character 'b' (0x62) at index 1 -- components: None files: argparseBug.py messages: 150404 nosy: Jeff.Yurkiw priority: normal severity: normal status: open title: argparse does not sanitize help strings for % signs type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file24115/argparseBug.py ___ Python tracker <http://bugs.python.org/issue13685> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13685] argparse does not sanitize help strings for % signs
Jeff Yurkiw added the comment: That would probably work too. -- ___ Python tracker <http://bugs.python.org/issue13685> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11802] filecmp.cmp needs a documented way to clear cache
jeff deifik added the comment: There are many possible solutions to this problem. Personally, I think mine is the simplest, though it changes the API. However, there have been several suggestions on simple fixes that don't change the API, all of which fix the resource leak. Doing nothing will not fix the resource leak. How about a simple fix right now, using a lru cache, fixing all versions of Python, and perhaps come up with a superior solution at a later date? -- ___ Python tracker <http://bugs.python.org/issue11802> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12365] URLopener should support context manager protocol
New submission from Jeff McNeil : Per discussion within Issue10050, URLopener ought to support the context manager protocol. That allows more idiomatic usage and doesn't require calls to contextlib.closing for use with the 'with' statement. If agreed, I'll create a patch. -- components: Library (Lib) messages: 138649 nosy: mcjeff priority: normal severity: normal status: open title: URLopener should support context manager protocol versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue12365> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12365] URLopener should support context manager protocol
Changes by Jeff McNeil : -- type: -> feature request ___ Python tracker <http://bugs.python.org/issue12365> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12365] URLopener should support context manager protocol
Jeff McNeil added the comment: In looking at this again, I may have spoken too soon. It seems that addinfobase & HTTPResponse already handle this. As this is what's returned by the opener, then what I was shooting for should already be handled. -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue12365> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12365] URLopener should support context manager protocol
Jeff McNeil added the comment: Isn't that snippet (contextlib.closing(...)) passing the result of urllib.urlopen to closing? The urlopen call is a factory function of sorts, so there's really no context to manage on its part? Maybe it's just a matter of making that clear? If you can share what you've got in mind, I'd love to give it a go. The urllib stuff I've done thus far has been a great way to get my feet wet! -- ___ Python tracker <http://bugs.python.org/issue12365> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12013] file /usr/local/lib/python3.1/lib-dynload/_socket.so: symbol inet_aton: referenced symbol not found
Jeff Blaine added the comment: FWIW, this same problem exists with 2.7.1, compiled by myself, and only on some Solaris 10 boxes of ours that have not had a lot of recent patching. == On an old-ish Solaris 10 box: % /tmp/py271test/bin/python -m test.regrtest Traceback (most recent call last): File "/tmp/py271test/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/tmp/py271test/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/tmp/py271test/lib/python2.7/test/regrtest.py", line 211, in from test import test_support File "/tmp/py271test/lib/python2.7/test/test_support.py", line 10, in import socket File "/tmp/py271test/lib/python2.7/socket.py", line 47, in import _socket ImportError: ld.so.1: python: fatal: relocation error: file /tmp/py271test/lib/python2.7/lib-dynload/_socket.so: symbol inet_aton: referenced symbol not found == On a modern Solaris 10 box patched 2 months ago: % /tmp/py271test/bin/python -m test.regrtest [ runs, takes too long, so we'll test the stuff that ] [ imports socket ... ] ^C Python-2.7.1:cairo> for i in `grep -l "import socket" /tmp/py271test/lib/python 2.7/test/*py | sed 's/\.py//g'`; do echo "RUNNING $i"; /tmp/py271test/bin/pytho n -m test.`basename $i`; done 2>&1 | /usr/sfw/bin/ggrep -E '(OK|RUNNING)' RUNNING /tmp/py271test/lib/python2.7/test/test_asyncore OK (skipped=2) RUNNING /tmp/py271test/lib/python2.7/test/test_docxmlrpc OK RUNNING /tmp/py271test/lib/python2.7/test/test_epoll RUNNING /tmp/py271test/lib/python2.7/test/test_ftplib OK RUNNING /tmp/py271test/lib/python2.7/test/test_httplib OK (skipped=1) RUNNING /tmp/py271test/lib/python2.7/test/test_import OK RUNNING /tmp/py271test/lib/python2.7/test/test_kqueue RUNNING /tmp/py271test/lib/python2.7/test/test_logging OK RUNNING /tmp/py271test/lib/python2.7/test/test_mailbox OK RUNNING /tmp/py271test/lib/python2.7/test/test_multiprocessing ...etc... -- nosy: +Jeff.Blaine ___ Python tracker <http://bugs.python.org/issue12013> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12013] file /usr/local/lib/python3.1/lib-dynload/_socket.so: symbol inet_aton: referenced symbol not found
Changes by Jeff Blaine : -- versions: +Python 2.7 ___ Python tracker <http://bugs.python.org/issue12013> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12890] cgitb displays tags when executed in text mode
New submission from Jeff McNeil : If cgitb.enable is ran with a logdir set and a format='text' argument, then a trailing message is printed that includes tags. This should only happen if the format requested is HTML. The following tiny script shows the problem: import cgitb cgitb.enable(format='text', logdir='/tmp') 1/0 Attaching a small patch which addresses. This is against tip on the default branch. mcjeff@macbook:~/cpython$ ./python.exe --version Python 3.3.0a0 -- components: Library (Lib) files: head-cgitb-display.patch keywords: patch messages: 143449 nosy: mcjeff priority: normal severity: normal status: open title: cgitb displays tags when executed in text mode versions: Python 3.3 Added file: http://bugs.python.org/file23091/head-cgitb-display.patch ___ Python tracker <http://bugs.python.org/issue12890> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1429] FD leak in SocketServer
Jeff McNeil added the comment: I'll see if I can get it to reproduce and put a patch together. -- ___ Python tracker <http://bugs.python.org/issue1429> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6327] [mimetext] long lines get cut with exclamation mark and newline
Jeff Hull added the comment: I also have this problem with text getting replaced with the exclamation point. I am using this class. from email.MIMEText import MIMEText Perhaps it didn't work for you because you didn't send it via email. try this code msgAlternative = MIMEMultipart('alternative') msgText = MIMEText(text, 'html') msgAlternative.attach(msgText) msg.attach(msgAlternative) mailServer = smtplib.SMTP() mailServer.connect(serverURL) mailServer.login(user, pass) mailServer.sendmail(sender,to, msg.as_string()) mailServer.quit() -- nosy: +Jeff.Hull ___ Python tracker <http://bugs.python.org/issue6327> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1429] FD leak in SocketServer
Jeff McNeil added the comment: I entirely forgot I had signed up to look, my apologies. I'm going through this w/ what's lying on Mercurial's tip, I can't reproduce it at all. I can raise exceptions of various flavors from within the handle method of a StreamRequestHandler and there are no leaking file descriptors. The only thing worthy of discusion, IMO, is the fact that raising an exception in a handle_error method of a subclass of BaseServer *does* cause the the self.shutdown_request to not run. Unless I'm mistaken, that does then leave the cleanup of that open socket to GC (but, at that point, anyone overriding handle_error method should know that). Does it make sense to run shutdown_request, even if handle_error throws an Exception? If anyone thinks that's worthwhile, I can do that. -- ___ Python tracker <http://bugs.python.org/issue1429> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6911] Document changes in asynchat
Jeff Ramnani added the comment: This patch could no longer be applied cleanly on the 2.7 branch. I have updated the patch so it applies cleanly to commit 22f991bb9b0b on the 2.7 branch. -- nosy: +jramnani Added file: http://bugs.python.org/file21116/asynchat-docs.patch ___ Python tracker <http://bugs.python.org/issue6911> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11254] distutils doesn't byte-compile .py files to __pycache__ during installation
Jeff Ramnani added the comment: This patch applies cleanly as of rev 89af3880ca57 on branch default. After applying the patch, I had two unit test failures when running, "/python.exe -m test -v test_distutils", on OS X 10.6. The tests were failing because they were not looking in the __pycache__ directory for byte-compiled or optimized files. Attaching an updated patch that fixes the unit tests that were breaking. -- nosy: +jramnani Added file: http://bugs.python.org/file21146/issue11254.patch ___ Python tracker <http://bugs.python.org/issue11254> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8158] Docstring of optparse.OptionParser incomplete
Jeff Ramnani added the comment: I've read through the doc and the code. All keyword arguments for OptionParser.__init__() are in the documentation for branches 2.7 and default (as of ecc176488349). Does that mean this issue can be closed? -- nosy: +jramnani ___ Python tracker <http://bugs.python.org/issue8158> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9362] Make exit/quit hint more novice friendly
Jeff Ramnani added the comment: I've checked Lib/site.py and it tells the user to use 'Ctrl-Z' to exit the prompt when they are running Windows. Perhaps this means we can close the ticket, since discussion on this issue seems to have dissipated? -- nosy: +jramnani ___ Python tracker <http://bugs.python.org/issue9362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11563] test_urllibnet is triggering a ResourceWarning
Changes by Jeff McNeil : -- nosy: +mcjeff ___ Python tracker <http://bugs.python.org/issue11563> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11563] test_urllibnet is triggering a ResourceWarning
Jeff McNeil added the comment: So, I've been meaning to get more into contributing back to Python and I found this one somewhat interesting. As it turns out, even the following simple script raises the same warning: [jeff@martian cpython]$ ./python -c 'import urllib.request; urllib.request.urlretrieve("http://www.python.org";)' /home/jeff/cpython/Lib/socket.py:340: ResourceWarning: unclosed self._sock = None [64388 refs] [jeff@martian cpython]$ The close method of Socket.SocketIO simply sets the underlying socket object to None, which causes that warning. Explicitly calling the close method on the underlying socket clears that up (and it's protected by that reference counter). The _decref_socketios just drops the internal ref count and never actually closes -- it won't unless self.__closed is True. So, when self._sock is set to None, that error bubbles up. As SocketIO is the foundation used in socket.makefile, I think just adding that close call ought to be correct. I can do the simple patch if you agree. -- ___ Python tracker <http://bugs.python.org/issue11563> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11563] test_urllibnet is triggering a ResourceWarning
Jeff McNeil added the comment: So, it turned out to be more complicated than that. The HTTPConnection object returns an HTTPResponse, but never closes the underlying socket after calling makesock. Since persistent connections aren't supported, nothing actually closes the socket itself, it's just set to None. Explicitly calling a close turns out not to be correct either. I went down the same path as AbstractHTTPHandler and added a Connection: close header. That ensures that the remote host will close the underlying connection (more importantly, setting the HTTP Response object's will_close to True). That ensures HTTPConnection performs in a "fire and forget" mode, causing everything to close out as it should. I contemplated changing urlretrieve to use build_opener as urlopen does, but I figure that would have been done by now if it was a trivial operation. I'd be happy to take a whack at it if it's just a matter of getting around to it. -- keywords: +patch Added file: http://bugs.python.org/file21273/11562.patch ___ Python tracker <http://bugs.python.org/issue11563> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11563] test_urllibnet is triggering a ResourceWarning
Jeff McNeil added the comment: Sounds good. I'll look at doing that, too. -- versions: +Python 3.3 ___ Python tracker <http://bugs.python.org/issue11563> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10050] urllib.request still has old 2.x urllib primitives
Changes by Jeff McNeil : -- nosy: +mcjeff ___ Python tracker <http://bugs.python.org/issue10050> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10050] urllib.request still has old 2.x urllib primitives
Jeff McNeil added the comment: Alright, attaching a patch that reworks urlretrieve to use urlopen internal to urllib.request. 1. I dropped the local caching as it isn't turned on by default anyway (and isn't really documented). 2. Updated documentation to reflect caching changes & make urlretrieve part of the official API again. 3. Kept the urlcleanup function, but use a global list to track temporary files. I'd be happy to change this functionality if that makes sense. 4. After moving the urlretrieve stuff out of test_urllibnet, I realized that file didn't serve much of a purpose any longer, so I just removed it. 5. Updated NEWS. I'd be happy to rework any of this in order to bring it up to stuff. Comments and suggestions are very much welcomed. -- keywords: +patch Added file: http://bugs.python.org/file21285/issue10050.patch ___ Python tracker <http://bugs.python.org/issue10050> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10050] urllib.request still has old 2.x urllib primitives
Jeff McNeil added the comment: Made recommended changes. Moved to NamedTemporaryFile. I don't think the spooled file makes sense here as the existing protocol provides a filename in the returned tuple, not a f.l.o. As far as the description? Here are a couple suggestions: 1. URL Retrieval Library 2. URL Access Module Updated the module documentation as well as the howto. -- Added file: http://bugs.python.org/file21286/issue10050.patch ___ Python tracker <http://bugs.python.org/issue10050> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10050] urllib.request still has old 2.x urllib primitives
Jeff McNeil added the comment: Made requested change to Synopsis/Description. -- Added file: http://bugs.python.org/file21287/issue10050.patch ___ Python tracker <http://bugs.python.org/issue10050> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10050] urllib.request still has old 2.x urllib primitives
Jeff McNeil added the comment: I'll make those changes, sure. I had the same thought re: block size, but I was trying to keep inline with what the current function did. -- ___ Python tracker <http://bugs.python.org/issue10050> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10050] urllib.request still has old 2.x urllib primitives
Jeff McNeil added the comment: Take four! Includes Antoine's suggestions. I changed the callback to return (block num, read size, file size) as opposed to (block num, block size, file size) as this seems to make more sense. I appreciate the back and forth. I'd be happy to create issues & handle the other things that have been moved out of this patch. -- Added file: http://bugs.python.org/file21299/issue10050.patch ___ Python tracker <http://bugs.python.org/issue10050> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10050] urllib.request still has old 2.x urllib primitives
Jeff McNeil added the comment: I'm not exactly sure what the steps are with respect to the DeprecationWarning. Is the common case just to raise the warning in the __init__ method? Are there related documentation changes? Thanks again! Learning a ton. Hopefully the next patch I submit will go much smoother. -- ___ Python tracker <http://bugs.python.org/issue10050> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10050] urllib.request still has old 2.x urllib primitives
Jeff McNeil added the comment: Just wanted to check so this doesn't sit with people waiting on me. Is there anything else I need/should do to this patch? Little unclear on how to handle the deprecation process. -- ___ Python tracker <http://bugs.python.org/issue10050> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11254] distutils doesn't byte-compile .py files to __pycache__ during installation
Jeff Ramnani added the comment: I've reviewed your patch and it looks good. I appreciate the review and cleanup. The tests succeed for me after applying your patch. I also tested with PYTHONOPTIMIZE and PYTHONDONTWRITEBYTECODE and got the output I expected. -- ___ Python tracker <http://bugs.python.org/issue11254> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10050] urllib.request still has old 2.x urllib primitives
Jeff McNeil added the comment: I'd be happy to pick some of that stuff up. I'd like to address separately as it keeps fewer concerns in this one patch. I'll grab them once they're created. -- ___ Python tracker <http://bugs.python.org/issue10050> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8158] Docstring of optparse.OptionParser incomplete
Jeff Ramnani added the comment: You are correct. I have added 'description' to the docstring of the OptionParser class for 2.7 and default (python3 tip). Here is the patch for python3 tip. -- keywords: +patch Added file: http://bugs.python.org/file21486/issue8151-default.patch ___ Python tracker <http://bugs.python.org/issue8158> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8158] Docstring of optparse.OptionParser incomplete
Jeff Ramnani added the comment: Attaching the same patch for 2.7. -- Added file: http://bugs.python.org/file21487/issue8151-2.7.patch ___ Python tracker <http://bugs.python.org/issue8158> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7443] test.support.unlink issue on Windows platform
Jeff Dean added the comment: > * Patch Py_DeleteFileW in posixmodule.c so that it renames before > deleting: should solve the problem overall but obviously has a > possible wider impact, in general and on performance in particular. > This rename might be a simple rename-to-guid or something more > sophisticated such as the rename-to-recycler which cygwin uses. > > * Patch support.unlink in the test package to do the rename dance on > the basis that it'll fix at least some of the problems with less > impact overall. > > Opinions? I'm willing to do either. I vote for fixing the test package. File system "extensions" may track and record this activity. To use DropBox as an example, doing the rename and delete will cause the renamed and deleted file to be recorded. Just my opinion, but the code path to delete a file should be as short as possible. Making lots of other OS calls just doesn't seem right. I understand the wish to have a reliable unlink call but I'd be uncomfortable with a workaround that may be visible around the edges. -- nosy: +jdigital ___ Python tracker <http://bugs.python.org/issue7443> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11802] filecmp.cmp needs a documented way to clear cache
New submission from jeff deifik : I have a program which calls filecmp.cmp a lot. It runs out of memory. I read the source to filecmp, and then I periodically set filecmp._cache = {} Without doing this, filecmp's cache uses up all the memory in the computer. There needs to be a documented interface to clear the cache. I suggest a function def clear_cache: _cache = {} Without a documented interface, there is no standard way to clear the cache. It is possible different versions of python will require different methods to clear the cache, which will reduce python code portability and is a bad idea. Alternatively, one might disable the caching code. One shouldn't have to look at the source code of a library function to see why it is consuming memory. -- messages: 133290 nosy: lopgok priority: normal severity: normal status: open title: filecmp.cmp needs a documented way to clear cache versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue11802> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2624] swig support in distutils should use the build and temp dirs
Changes by Jeff Laughlin : -- nosy: +Jeff.Laughlin ___ Python tracker <http://bugs.python.org/issue2624> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1016626] distutils support for swig is under par
Changes by Jeff Laughlin : -- nosy: +Jeff.Laughlin ___ Python tracker <http://bugs.python.org/issue1016626> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3472] Updates to "Macintosh Library Modules" Section 1.1
New submission from Jeff Rodman <[EMAIL PROTECTED]>: Change current introduction in 1.1 WAS: Mac OS X 10.4 comes with Python 2.3 pre-installed by Apple. However, you are encouraged to install the most recent version of Python from the Python website (http://www.python.org). A ``universal binary'' build of Python 2.5, which runs natively on the Mac's new Intel and legacy PPC CPU's, is available there. IS: Mac OS X 10.5 comes with Python 2.5.1 pre-installed by Apple. If you wish, you are invited to install the most recent version (currently 2.5.2) of Python from the Python website (http://www.python.org). A current "universal binary'' build of Python, which runs natively on the Mac's new Intel and legacy PPC CPU's, is available there. And then, to line: The Apple-provided build of Python is installed in /System/Library/Frameworks/Python.framework and /usr/bin/python, respectively. You should never modify or delete these, as they are Apple-controlled and are used by Apple- or third-party software. ADD: Remember that if you choose to install a newer Python version like this, you will have two different but functional Python installations on your computer, so it will be important that your paths and usages are consistent with what you want to do. -- assignee: georg.brandl components: Documentation messages: 70437 nosy: georg.brandl, jrodman severity: normal status: open title: Updates to "Macintosh Library Modules" Section 1.1 versions: Python 2.5 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3472> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3689] reversed() not working as intended on lists
New submission from Jeff Hall <[EMAIL PROTECTED]>: reversed() built in is not functioning correctly with list (specifically with len() ) l = [1,2,3,4] rl = reversed(l) type(rl) vs. strings and tuples which just return 'reverse' objects listreverseiterators apparently have a len() defined that changes with each .next() call -- messages: 71993 nosy: laxrulz777 severity: normal status: open title: reversed() not working as intended on lists type: behavior versions: Python 2.5 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3689> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8311] wave module sets data subchunk size incorrectly when writing wav file
New submission from Jeff Pursell : I tried to create a 4 second file and only heard the first 2 seconds. The file size was correct for a 44.1 kHz, 16 bit mono file at 4 seconds, but both aplay and audactiy ignored the second half of the file. I went to this page https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ and opened the output with a hex editor in little endian mode. I found that at offset 40, the data chunk size was wrong. It looked like it was just set to the number of samples. It should be the number of samples times bytes-per-sample (2) times number-of-channels (1 in my case). I manually set the number from 176400 to 352800 and that solved the problem for that wav file. I'm guessing this was just an oversight and the fix will be simple. I'll attach the code I used to generate the test tone. Just run python -i testTone.py and it will generate out.wav with the incorrect field. I am using pything 2.6.4 in ubuntu. -- components: Extension Modules files: testTone.zip messages: 102342 nosy: Jeff.Pursell severity: normal status: open title: wave module sets data subchunk size incorrectly when writing wav file type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file16757/testTone.zip ___ Python tracker <http://bugs.python.org/issue8311> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8311] wave module sets data subchunk size incorrectly when writing wav file
Jeff Pursell added the comment: Here's my fix. The left file is the original and the right file is my version. Perhaps someone should check this patch on a big endian machine to make sure there are no issues there. I do not anticipate any issues. 416c416 < nframes = len(data) // (self._sampwidth * self._nchannels) --- > nframes = len(data) // self._nchannels 427c427 < self._datawritten = self._datawritten + len(data) --- > self._datawritten = self._datawritten + len(data) * > self._sampwidth 463c463 < self._nframes = initlength / (self._nchannels * self._sampwidth) --- > self._nframes = initlength // self._nchannels -- ___ Python tracker <http://bugs.python.org/issue8311> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8548] Building on CygWin 1.7: PATH_MAX redefined
New submission from Jeff Binder : Building Python 3.1.2 on Cygwin 1.7, I got errors in main.c stemming from a warning: PATH_MAX redefined (see attached log). I got around this by commenting out the #define. I don't know if the best solution is #ifndef, #undef, or something else. . . . I know CygWin has changed the value of PATH_MAX in 1.7 (see: http://www.cygwin.com/cygwin-ug-net/ov-new1.7.html), though I'm not sure why that would cause this problem. -- components: Installation files: python-build-logs.tar.gz messages: 104334 nosy: jbinder priority: normal severity: normal status: open title: Building on CygWin 1.7: PATH_MAX redefined type: compile error versions: Python 3.1 Added file: http://bugs.python.org/file17107/python-build-logs.tar.gz ___ Python tracker <http://bugs.python.org/issue8548> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8556] Confusing string formatting examples
New submission from Jeff McNeil : I was going through the string formatting examples this evening and noticed this: print '%(language)s has %(#)03d quote types.' % \ {'language': "Python", "#": 2} The example uses a '#' as a map key. This is somewhat misleading as if we had simply left the parenthesis off, the '#' would have been interpreted as an alternate conversion flag. Should be updated to use a more verbose (and less confusing) dictionary key. -- assignee: d...@python components: Documentation files: stdtypes.rst.2.6.5.patch keywords: patch messages: 104410 nosy: d...@python, mcjeff priority: normal severity: normal status: open title: Confusing string formatting examples versions: Python 2.6 Added file: http://bugs.python.org/file17115/stdtypes.rst.2.6.5.patch ___ Python tracker <http://bugs.python.org/issue8556> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't preserve directory permissions
Changes by Jeff McNeil : -- nosy: +mcjeff -j_mcneil ___ Python tracker <http://bugs.python.org/issue1666318> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8556] Confusing string formatting examples
Jeff McNeil added the comment: Attaching a patch against the trunk, unified format, changed to 'number' as per suggestion. -- versions: +Python 2.7 -Python 2.6 Added file: http://bugs.python.org/file17155/stdtypes.rst.trunk.patch ___ Python tracker <http://bugs.python.org/issue8556> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1429] FD leak in SocketServer
Jeff McNeil added the comment: I was toying with adding Unix Socket support for one of our internal tools and I thought I ran into a leak in my own code. Searched the bug tracker and found this. I tried to reproduce, but wasn't able to. Though, if you look at the ThreadingMixIn class, you'll see this: self.handle_error(request, client_address) self.close_request(request) An exception in handle_error, most likely from a subclass, would cause close_request to never fire. Though, the socket.accept'd channel would probably be shut down implicitly when leaving _handle_request_nonblock. -- nosy: +mcjeff ___ Python tracker <http://bugs.python.org/issue1429> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1918] weak references are removed before __del__ is called.
New submission from Jeff Foran: Not sure where to put example code, but here it goes: import weakref class MyObj(object): def __init__(self): self.ref = weakref.ref(self) def __del__(self): print "HERE123", self.ref() o = MyObj() o = None -- components: Interpreter Core messages: 61597 nosy: jforan severity: normal status: open title: weak references are removed before __del__ is called. type: behavior versions: Python 2.5 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1918> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2282] TextIOWrapper.seekable() always returns False
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a patch that fixes this issue and adds a regression test. -- keywords: +patch nosy: +jbalogh Added file: http://bugs.python.org/file9690/issue2282.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2282> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2091] file accepts 'rU+' as a mode
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a patch that checks for '+' in the mode string, updates the docs, and tests bad mode strings. -- keywords: +patch nosy: +jbalogh Added file: http://bugs.python.org/file9697/issue2091.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2091> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2359] A Py3K warning for array.array.{read,write} is needed
Jeff Balogh <[EMAIL PROTECTED]> added the comment: I've got this one. -- nosy: +jbalogh __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2359> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2359] A Py3K warning for array.array.{read,write} is needed
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a patch that adds the deprecation warnings. It's a bit dirty because there isn't a read or write function anymore, so I had to make stubs that contain the warnings. -- keywords: +patch Added file: http://bugs.python.org/file9702/issue2359.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2359> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2358] Using sys.exc_clear should raise a Py3K warning
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a patch that raises the warning. Should the method documentation metion the deprecation as well? -- keywords: +patch nosy: +jbalogh Added file: http://bugs.python.org/file9707/issue2358.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2358> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2358] Using sys.exc_clear should raise a Py3K warning
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a fixed patch that follows PEP 7 and updates Misc/NEWS. Added file: http://bugs.python.org/file9708/issue2358-stylefix.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2358> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2359] A Py3K warning for array.array.{read,write} is needed
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a fixed patch that follows PEP 7. Added file: http://bugs.python.org/file9709/issue2359-stylefix.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2359> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2348] Py3K warn using file.softspace
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a patch that adds {get,set}_attr wrappers for fileobject which warn about softspace usage. -- keywords: +patch nosy: +jbalogh Added file: http://bugs.python.org/file9717/issue2348.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2348> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2370] operator.{isCallable,sequenceIncludes} needs a fixer
Jeff Balogh <[EMAIL PROTECTED]> added the comment: I'll get this one. -- nosy: +jeff.balogh __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2370> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2370] operator.{isCallable,sequenceIncludes} needs a fixer
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a patch that operator.{isCallable,sequenceIncludes}, including tests. -- keywords: +patch Added file: http://bugs.python.org/file9736/issue2370.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2370> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2357] sys.exc_{type, values, traceback} should raise a Py3K warning
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a patch that provides fixers for sys.exc_ {type,value,traceback} Added file: http://bugs.python.org/file9749/issue2357.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2357> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2409] regrtest should not just skip imports that fail
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a patch that implements optional_import(). The only arg included from __import__ is fromfile, as it's the only one I needed to fix up the stdlib. -- keywords: +patch nosy: +jeff.balogh Added file: http://bugs.python.org/file9756/optional_import.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2409> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2409] regrtest should not just skip imports that fail
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a patch that removes ``from _winreg import *`` in test_winreg.py, which will allow usage of optional_import. Added file: http://bugs.python.org/file9757/winreg-refactor.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2409> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2409] regrtest should not just skip imports that fail
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a patch that refactors the test_sunaudiodev.py imports. Added file: http://bugs.python.org/file9758/sunaudiodev-refactor.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2409> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2409] regrtest should not just skip imports that fail
Jeff Balogh <[EMAIL PROTECTED]> added the comment: The previous winreg refactor patch didn't catch all the changes; attaching a new patch that fixes everything, with help from Trent Nelson. Added file: http://bugs.python.org/file9759/winreg-refactor.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2409> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2409] regrtest should not just skip imports that fail
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a patch, based on the previous patches, that fixes the stdlib to use optional_import where ImportError was raised. These need testing on various platforms to make sure all the ImportErrors are caught. I'm on x86 Linux. Added file: http://bugs.python.org/file9760/issue2409.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2409> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2354] cmp argument to list.sort()/sorted() should raise a Py3K warning
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Fixing the compare to raise the warning when cmp != NULL, and adding a test -- keywords: +patch nosy: +jeff.balogh Added file: http://bugs.python.org/file9769/sort-cmp.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2354> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2425] test_py3kwarn doesn't use sys.py3kwarning
New submission from Jeff Balogh <[EMAIL PROTECTED]>: This patch fixes the TODO in test_py3kwarn -- components: Tests files: py3kwarn-refactor.diff keywords: patch messages: 64073 nosy: brett.cannon, jeff.balogh severity: normal status: open title: test_py3kwarn doesn't use sys.py3kwarning versions: Python 2.6 Added file: http://bugs.python.org/file9770/py3kwarn-refactor.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2425> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2358] Using sys.exc_clear should raise a Py3K warning
Changes by Jeff Balogh <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9707/issue2358.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2358> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2348] Py3K warn using file.softspace
Changes by Jeff Balogh <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9717/issue2348.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2348> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2348] Py3K warn using file.softspace
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Here's a new patch that uses PyErr_WarnEx, has a test, and even updates Misc/NEWS. Added file: http://bugs.python.org/file9774/issue2348.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2348> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2381] test_subprocess fails if your sys.executable is on a path with a space in it
Jeff Balogh <[EMAIL PROTECTED]> added the comment: The patch works for me, and doesn't change anything except the test strings. Not having spaces in your path also helps. ;) -- nosy: +jeff.balogh __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2381> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2370] operator.{isCallable,sequenceIncludes} needs a fixer
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a revised patch that has a ``warnsunchanged`` test case. Added file: http://bugs.python.org/file9779/issue2370.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2370> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2370] operator.{isCallable,sequenceIncludes} needs a fixer
Changes by Jeff Balogh <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9736/issue2370.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2370> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2359] A Py3K warning for array.array.{read,write} is needed
Changes by Jeff Balogh <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9702/issue2359.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2359> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2370] operator.{isCallable,sequenceIncludes} needs a fixer
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Attaching a patch that adds deprecation warnings in trunk. Added file: http://bugs.python.org/file9787/operator-warnings.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2370> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2640] "excel" csv option generates multiple lines
New submission from Jeff Hall <[EMAIL PROTECTED]>: Current: csv.py indicates lineterminator = '\r\n' Issue: looks fine in notepad but when pulled into excel (office 2003) extra lines are added Resolution: should read lineterminator = '\r' -- components: Extension Modules messages: 65523 nosy: laxrulz777 severity: normal status: open title: "excel" csv option generates multiple lines versions: Python 2.5 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2640> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2640] "excel" csv option generates multiple lines
Jeff Hall <[EMAIL PROTECTED]> added the comment: you're absolutely correct, i apologize. On Tue, Apr 15, 2008 at 7:40 PM, Skip Montanaro <[EMAIL PROTECTED]> wrote: > > Skip Montanaro <[EMAIL PROTECTED]> added the comment: > > What platform are you on? Did you open the output file in > binary mode? I sort of suspect you failed to add 'b' to the > file mode and are getting a text file. > > -- > nosy: +skip.montanaro > > __ > Tracker <[EMAIL PROTECTED]> > <http://bugs.python.org/issue2640> > __ > Added file: http://bugs.python.org/file10042/unnamed __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2640> __you're absolutely correct, i apologize. On Tue, Apr 15, 2008 at 7:40 PM, Skip Montanaro <mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]> wrote: Skip Montanaro <mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]> added the comment: What platform are you on? Did you open the output file in binary mode? I sort of suspect you failed to add 'b' to the file mode and are getting a text file. -- nosy: +skip.montanaro __ Tracker <mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]> <http://bugs.python.org/issue2640"; target="_blank">http://bugs.python.org/issue2640> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2370] operator.{isCallable,sequenceIncludes} needs a fixer
Changes by Jeff Balogh <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9779/issue2370.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2370> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2370] operator.{isCallable,sequenceIncludes} needs a fixer
Jeff Balogh <[EMAIL PROTECTED]> added the comment: doh! Attaching a new patch that actually contains a fixer. Added file: http://bugs.python.org/file10205/issue2370.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2370> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2370] operator.{isCallable,sequenceIncludes} needs a fixer
Changes by Jeff Balogh <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9787/operator-warnings.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2370> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2370] operator.{isCallable,sequenceIncludes} needs a fixer
Jeff Balogh <[EMAIL PROTECTED]> added the comment: Updating the deprecation warnings patch to use PyErr_WarnPy3k and apply correctly against current trunk. Added file: http://bugs.python.org/file10206/operator-warnings.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2370> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4534] problem with str.join
New submission from jeff deifik <[EMAIL PROTECTED]>: I compiled python 3.0 on a cygwin platform. Here is my modest function: def List_to_String(lis): #return str.join(lis, '') # This is fast, but seems broke in 3.0 s = '' # This is really slow, but works in 3.0 for l in lis: s = s + l return s Here is my test case: def test_List_to_String(self): inp = ['f', 'r', 'e', 'd', ' ', 'i', 's'] out = 'fred is' self.assertEqual(jefflib.List_to_String(inp), out) Here is what happens when I try to run the commented out version (the one with the join): ERROR: test_List_to_String (__main__.TestJefflibFunctions) -- Traceback (most recent call last): File "./jefflib_test.py", line 96, in test_List_to_String self.assertEqual(jefflib.List_to_String(inp), out) File "/cygdrive/c/documents and settings/deifikj/jeff/scripts/jefflib.py", lin e 256, in List_to_String return str.join(lis) TypeError: descriptor 'join' requires a 'str' object but received a 'list' Of course, it worked fine in python 2.6. I am baffled. -- components: None messages: 76924 nosy: lopgok severity: normal status: open title: problem with str.join type: crash versions: Python 3.0 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4534> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4534] problem with str.join - should work with list input, error says requires 'str' object
Changes by jeff deifik <[EMAIL PROTECTED]>: -- title: problem with str.join -> problem with str.join - should work with list input, error says requires 'str' object ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4534> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4534] problem with str.join - should work with list input, error says requires 'str' object
jeff deifik <[EMAIL PROTECTED]> added the comment: Thanks. I want to learn what is wrong with the code I have though. My main goal is to understand python 3.0 better, rather than fixing a specific problem. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4534> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4534] problem with str.join - should work with list input, error says requires 'str' object
jeff deifik <[EMAIL PROTECTED]> added the comment: Yes, it was import string string.join(lis, '') I am still a bit confused though. Why doesn't my code of str.join(lis, '') work? I don't think str is a reserved word. I suppose that python might be able to deduce that str is of type string, based on join being called on it. Is the problem that python thinks my str is of type list? ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4534> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4534] problem with str.join - should work with list input, error says requires 'str' object
jeff deifik <[EMAIL PROTECTED]> added the comment: I fixed the code as follows: return str.join('',lis) I think it is readable, and I understand it. Thanks everyone for clarifying everything ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4534> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4557] array('c') in python 3.0 produces error, doc says it is ok
New submission from jeff deifik <[EMAIL PROTECTED]>: def char_sieve(): char_data = array('c') ... produces: File ".../prime.py", line 78, in char_sieve char_data = array('c') ValueError: bad typecode (must be b, B, u, h, H, i, I, l, L, f or d) However, http://docs.python.org/3.0/library/array.html?highlight=array#module-array says that 'c' is a legal value. -- assignee: georg.brandl components: Documentation messages: 77094 nosy: georg.brandl, lopgok severity: normal status: open title: array('c') in python 3.0 produces error, doc says it is ok type: crash versions: Python 3.0 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4557> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4571] write to stdout in binary mode - is it possible?
New submission from jeff deifik <[EMAIL PROTECTED]>: I have a program that needs to output binary data to stdout. I don't want to convert it to a string. for example something like sys.stdout.write('0o377') to write a byte with all the bits turned on. When I try this, I get an error like: sys.stdout.write(data) File "/usr/local/lib/python3.0/io.py", line 1484, in write s.__class__.__name__) TypeError: can't write bytes to text stream I know I can open a file in 'wb' mode and write to it, but what I want to do is somehow switch the mode of stdout to 'wb' mode. I read lots of python 3 documentation, as well as searched without finding a way. -- components: Interpreter Core messages: 77208 nosy: lopgok severity: normal status: open title: write to stdout in binary mode - is it possible? type: crash versions: Python 3.0 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4571> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4571] write to stdout in binary mode - is it possible?
jeff deifik <[EMAIL PROTECTED]> added the comment: I don't consider sys.stdout.buffer.write(b'abc') to be an acceptable solution. There are many programs that need to produce binary output with standard output. Consider uudecode and similar programs. There needs to be a standard, portable, documented way to put stdout into binary mode in order to write binary output. For example, all the flavors of the print command need to be able to send binary data to standard output. I don't have a problem changing open statements to support binary file i/o, but I do have a problem changing every print or write statement in order to support binary file i/o. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4571> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4588] Need a way to make my own bytes
New submission from jeff deifik <[EMAIL PROTECTED]>: I want to make my own data of types bytes in order to write it out. For example, I want to write out the bytes 0..9 #!/usr/bin/env python3.0 foo = b'' for i in range (0,10): foo += i #sys.stdout.buffer.write(foo) Here is the error: Traceback (most recent call last): File "./x.py", line 4, in foo += i TypeError: can't concat bytes to int I cannot find any function to convert the int i into something that I can append to foo. I tried chr, which produced a string typeerror. byte() was not defined. There must be a way to convert an integral value to a bytes type. -- components: Interpreter Core messages: 77286 nosy: lopgok severity: normal status: open title: Need a way to make my own bytes type: crash versions: Python 3.0 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4588> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4588] Need a way to make my own bytes
jeff deifik <[EMAIL PROTECTED]> added the comment: Doesn't work. #!/usr/bin/env python3.0 import sys foo = b'' for i in range (0,10): foo += bytes(i) sys.stdout.buffer.write(foo) produces a binary file of 45 bytes. Here is a hex dump (the '.' represent unprintable characters): +00000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01600 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +03200 00 00 00 00 00 00 00 00 00 00 00 00 . that is 45 bytes of 0. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4588> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4755] Common path prefix
Changes by Jeff Hall : -- nosy: +laxrulz777 ___ Python tracker <http://bugs.python.org/issue4755> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37886] PyStructSequence_UnnamedField not exported
New submission from Jeff Robbins : Python 3.8.0b3 has the fixed https://docs.python.org/3/c-api/tuple.html#c.PyStructSequence_NewType, but one of the documented features of PyStructSequence is the special https://docs.python.org/3/c-api/tuple.html#c.PyStructSequence_UnnamedField which is meant to be used for unnamed (and presumably also "hidden") fields. However, this variable is not "exported" (via __declspec(dllexport) or the relevant Python C macro) and so my C extension cannot "import" it and use it. My guess is that this passed testing because the only tests using it are internal modules linked into python38.dll, which are happy with the `extern` in the header: Include\structseq.h:extern char* PyStructSequence_UnnamedField; -- components: Windows messages: 349956 nosy: je...@livedata.com, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: PyStructSequence_UnnamedField not exported type: compile error versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue37886> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com