[issue27859] argparse - subparsers does not retain namespace

2016-09-03 Thread paul j3
paul j3 added the comment: This call used to be namespace, arg_strings = parser.parse_known_args(arg_strings, namespace) But in 2014 (2.7.9) http://bugs.python.org/issue9351 was implemented As noted in the title and comment in the code, the idea was to give more power to the defaults set

[issue27859] argparse - subparsers does not retain namespace

2016-09-04 Thread paul j3
paul j3 added the comment: I've posted a file that runs your code as you expect. It uses a custom Action class (like your test case). It subclasses ._SubParsersAction, and replaces the 9351 namespace use with the original one. I use the registry to change the class

[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2016-09-04 Thread paul j3
paul j3 added the comment: In http://bugs.python.org/issue27859 I've demonstrated how a subclass of _SubParsersAction can be used to revert the behavior to pre 2.7.9, passing the main namespace to the subparser. The only other change is to the parser registry: parser.register(&#

[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2016-09-04 Thread paul j3
Changes by paul j3 : -- Removed message: http://bugs.python.org/msg274336 ___ Python tracker <http://bugs.python.org/issue9351> ___ ___ Python-bugs-list mailin

[issue27998] Add support of bytes paths in os.scandir()

2016-09-07 Thread Paul Moore
Paul Moore added the comment: In the light of Steve Dower's work to "un-deprecate" bytes paths, I agree this should be added. -- ___ Python tracker <http://bugs.pyt

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2016-09-14 Thread paul j3
paul j3 added the comment: Clint, 'nargs=argparser.REMAINDER' ('...') may do what you want p=argparse.ArgumentParser() p.add_argument('--subscipt_args', nargs='...') p.add_argument('pos',nargs='*') p.parse_

[issue28137] Windows sys.path file should be renamed

2016-09-15 Thread Paul Moore
Paul Moore added the comment: You can actually handle this already, with a simple wrapper program (based on the one in PC\WinMain.c): /* Minimal main program -- everything is loaded from the library. */ #include "Python.h" #define WIN32_LEAN_AND_MEAN #include int wmain() {

[issue28137] Windows sys.path file should be renamed

2016-09-15 Thread Paul Moore
Paul Moore added the comment: I'd prefer not to hard code __main__.py, as I'd quite like to be able to have a number of copies of the executable, each running its own script. (I foresee putting all my little Python utility scripts in a directory with a Python installation an

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2016-09-15 Thread paul j3
paul j3 added the comment: Clint, the problem is the argparse uses different argument allocation method than optparse. optparse gives the '--subscipt_args` Action all of the remaining strings, and says - 'consume what you want, and return the rest'. So you consume up to (and

[issue28245] Embeddable Python does not use PYTHONPATH.

2016-09-22 Thread Paul Moore
Paul Moore added the comment: See https://docs.python.org/3/using/windows.html#embedded-distribution - "When extracted, the embedded distribution is (almost) fully isolated from the user’s system, including environment variables, system registry settings, and installed packages."

[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-22 Thread Paul Moore
New submission from Paul Moore: The zipapp module allows users to bundle their application as a single file "executable". On Windows, the file is given a ".pyz" extension which is associated with the Python launcher. However, this approach is not always equivalent to a na

[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-22 Thread Paul Moore
Paul Moore added the comment: (1) It starts an extra process (unless you're running the application from cmd.exe) and (2) in some cases, the system won't recognise a cmd file as an executable. For a simple example, t.cmd: @echo Hello from t example.py: from subprocess import r

[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-27 Thread Paul Moore
Paul Moore added the comment: I'm still unsure whether this would be a good idea. On the plus side, it provides (in conjunction with the "embedded" distribution) a really good way of producing a standalone application on Windows. On the minus side there are some limitations wh

[issue28219] Is order of argparse --help output officially defined?

2016-09-27 Thread paul j3
paul j3 added the comment: The display of the Action help lines is determined by the parser.format_help function https://docs.python.org/3/library/argparse.html#printing-help This function creates a Formatter, and then loads it with a 'stack' of sections. Sections are display

[issue28210] argparse with subcommands difference in python 2.7 / 3.5

2016-09-27 Thread paul j3
paul j3 added the comment: Yes there was/is a bug that made subparsers optional. http://bugs.python.org/issue9253 -- nosy: +paul.j3 ___ Python tracker <http://bugs.python.org/issue28

[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-28 Thread Paul Moore
Paul Moore added the comment: OK, here's a first draft documentation patch. As it's purely a documentation change, I guess it should go into the 3.5, 3.6 and trunk branches? For now it's against trunk (it's not like that file has changed recently anyway), and I'll

[issue28299] DirEntry.is_dir() evaluates True for a file on Windows

2016-09-28 Thread Paul Moore
Paul Moore added the comment: is_dir is a *method*. To find out if an entry is a directory, you need to call it. So you need from os import DirEntry, scandir def test_is_dir(): for item in os.scandir(TEST_DIR): if item.is_dir(): # ^^ note change

[issue16399] argparse: append action with default list adds to list instead of overriding

2016-10-02 Thread paul j3
paul j3 added the comment: It may help to know something about how defaults are handled - in general. `add_argument` and `set_defaults` set the `default` attribute of the Action (the object created by `add_argument` to hold all of its information). The default `default` is `None`. At the

[issue16399] argparse: append action with default list adds to list instead of overriding

2016-10-02 Thread paul j3
paul j3 added the comment: One thing that this default behavior does is allow us to append values to any object, just so long as it has the `append` method. The default does not have to be a standard list. For example, in another bug/issue someone asked for an `extend` action. I could

[issue28365] 3.5.2 syntax issue

2016-10-05 Thread Paul Moore
Paul Moore added the comment: I can recreate this (based on the screenshots from #28366). To reproduce, open IDLE. You get the console banner and prompt. Save that file using File-Save. The close IDLE. Reopen it, do File-Open to open your saved console session, then use the "Run" m

[issue28601] Ambiguous datetime comparisons should use == rather than 'is' for tzinfo comparison

2016-11-03 Thread Paul G
New submission from Paul G: According to PEP495 (https://www.python.org/dev/peps/pep-0495/#aware-datetime-equality-comparison) datetimes are considered not equal if they are an ambiguous time and have different zones. However, currently "interzone comparison" is defined / implemen

[issue28602] `tzinfo.fromutc()` fails when used for a fold-aware tzinfo implementation

2016-11-03 Thread Paul G
New submission from Paul G: After PEP-495, the default value for non-fold-aware datetimes is that they return the DST side, not the STD side (as was the assumption before PEP-495). This invalidates an assumption made in `tz.fromutc()`. See lines 991-1000 of datetime.py: dtdst = dt.dst

[issue28602] `tzinfo.fromutc()` fails when used for a fold-aware tzinfo implementation

2016-11-03 Thread Paul G
Paul G added the comment: Of the `tzinfo` implementations provided by `python-dateutil`, `tzrange`, `tzstr` (GNU TZ strings), `tzwin` (Windows style time zones) and `tzlocal` all satisfy this condition. These are basically all implementations of default system time zone information. With

[issue28602] `tzinfo.fromutc()` fails when used for a fold-aware tzinfo implementation

2016-11-03 Thread Paul G
Paul G added the comment: > After all, how much effort would it save for you in dateutil if you could > reuse the base class fromutc? Realistically, this saves me nothing since I have to re-implement it anyway in in all versions <= Python 3.6 (basically just the exact same algor

[issue28609] argparse claims '*' positional argument is required in error output

2016-11-06 Thread paul j3
paul j3 added the comment: The current error message is the result of http://bugs.python.org/issue10424 and http://bugs.python.org/issue12776 Before the test was just: if positionals: self.error(_('too few arguments')) The 2nd patch reworked the test to include the revise

[issue28609] argparse claims '*' positional argument is required in error output

2016-11-06 Thread paul j3
paul j3 added the comment: Try `nargs='?'` or try providing a `default` along with the '*'. Including your ARGUMENT action in the error message is intentional. The test for this error message is: required_actions = [] for action in self._actions:

[issue28609] argparse claims '*' positional argument is required in error output

2016-11-06 Thread paul j3
paul j3 added the comment: Simply including a `default` parameter, even with the default default None, changes the error message In [395]: parser=argparse.ArgumentParser() In [396]: parser.add_argument('cmd'); In [397]: a=parser.add_argument('args',na

[issue28609] argparse claims '*' positional argument is required in error output

2016-11-06 Thread paul j3
paul j3 added the comment: My suggestion to use `metavar=('A','')` to streamline the usage creates problems with the help code http://bugs.python.org/issue14074 The tuple metavar does not work right for positionals. That's a old issue that should have been fixed l

[issue28641] Describe PEP 495 features in "What's New in Python 3.6" document

2016-11-09 Thread Paul G
Paul G added the comment: I've never written a "What's New" before, but here are the main things I took away from implementing a PEP 495-compliant tzinfo class: - The `fold` attribute is the SECOND occurrence of the time, not the first occurrence of the time. In my first p

[issue28686] py.exe ignored PATH when using python3 shebang

2016-11-14 Thread Paul Moore
Paul Moore added the comment: 1. I don't think searching . should be included - on Unix /usr/bin/env searches PATH, and I believe we should do the same here. 2. The PATH search does happen (from my reading of the code) but it looks for a "python3" command, which isn't avai

[issue28686] py.exe ignored PATH when using python3 shebang

2016-11-14 Thread Paul Moore
Paul Moore added the comment: I agree that the docs are a little confusing on this. Having said that, though, I'm not entirely sure the behaviour needs fixing. The scenario where there's a problem is: 1. User has written a script that needs Python 3 and won't run with Python

[issue34602] python3 resource.setrlimit strange behaviour under macOS

2022-01-05 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: My understanding of the resolution of this ticket is that it is still not possible to use setrlimit with RLIMIT_STACK to raise the soft stack limit. Is that correct? In that case, the original bug report still seems valid and unresolved (and indeed

[issue1598083] Top-level exception handler writes to stdout unsafely

2007-08-28 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: Not likely, given the number of things on my plate already. _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1598083> _ __

[issue1147] string exceptions inconsistently deprecated/disabled

2007-09-11 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone: Python 2.5 deprecated raising string exceptions. It also added the throw method to generator objects which can be used to raise an exception, including a string exception. Raising an exception with this method doesn't issue a deprecation warning

[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Paul F. Dubois
Changes by Paul F. Dubois: __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1165> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mai

[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Paul F. Dubois
Changes by Paul F. Dubois: -- nosy: -esr __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1165> __ ___ Python-bugs-list mailing list Unsubs

[issue1002] Patch to rename HTMLParser module to lower_case

2007-09-24 Thread Paul F. Dubois
Paul F. Dubois added the comment: Testing auditor, this change should get this issue assigned to Collin. -- nosy: +dubois __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/

[issue1002] Patch to rename HTMLParser module to lower_case

2007-09-24 Thread Paul F. Dubois
Paul F. Dubois added the comment: yet another test __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1002> __ ___ Python-bugs-list mailing list Unsubs

[issue1002] Patch to rename HTMLParser module to lower_case

2007-09-24 Thread Paul F. Dubois
Changes by Paul F. Dubois: __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1002> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mai

[issue1002] Patch to rename HTMLParser module to lower_case

2007-09-24 Thread Paul F. Dubois
Changes by Paul F. Dubois: __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1002> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mai

[issue1002] Patch to rename HTMLParser module to lower_case

2007-09-24 Thread Paul F. Dubois
Paul F. Dubois added the comment: Hoping I have learned to spell, another test. -- assignee: -> collinwinter __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.o

[issue1198] Test of 2to3 component auditor

2007-09-24 Thread Paul F. Dubois
New submission from Paul F. Dubois: This is a test issue, please ignore. -- assignee: collinwinter components: 2to3 (2.x to 3.0 conversion tool) messages: 56123 nosy: collinwinter, dubois severity: minor status: open title: Test of 2to3 component auditor

[issue1198] Test of 2to3 component auditor

2007-09-24 Thread Paul F. Dubois
Changes by Paul F. Dubois: -- status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1198> __ ___ Python-bugs-list mailing list Uns

[issue1325] zipimport.zipimporter.archive undocumented and untested

2007-10-25 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone: zipimporter instances have a read-only "archive" attribute, but there is no documentation referring to it, nor any test coverage for its existence. It's quite useful to know what a zipimporter is pointed at (for debugging and other intros

[issue1326] "internal" zipimport.zipimporter feature untested

2007-10-25 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone: It's possible to construct a zipimporter with a "path" which points first to a zip file and then continues to refer to a file within that zip file. For example, /foo/bar.zip/baz where /foo/bar.zip is not a directory, but a zip fil

[issue1325] zipimport.zipimporter.archive undocumented and untested

2007-10-25 Thread Jean-Paul Calderone
Changes by Jean-Paul Calderone: -- nosy: +fijal __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1325> __ ___ Python-bugs-list mailing list Unsubs

[issue1326] "internal" zipimport.zipimporter feature untested

2007-10-25 Thread Jean-Paul Calderone
Changes by Jean-Paul Calderone: -- nosy: +fijal __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1326> __ ___ Python-bugs-list mailing list Unsubs

[issue805194] Inappropriate error received using socket timeout

2007-10-25 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: The APR comment is indeed correct, so this is probably a Python bug. -- nosy: +exarkun Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/is

[issue1367] mkdir+chdir problem in multiple threads

2007-10-31 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: This isn't a bug in Python. Working directory, which os.chdir modifies, is process-global. One of your threads makes a directory, then gets suspended while another one makes a different directory and changes into it, then the first tries to change

[issue12944] Accept arbitrary files for packaging's upload command

2011-09-23 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: > pysetup run upload -f dist/spam-0.2.tar.gz -f dist/spam-0.2.exe I'm not sure why it's "run upload" instead of just "upload", but maybe that's the convention in pysetup. Apart from that, this looks like a v

[issue13556] When tzinfo.utcoffset is out-of-bounds, the exception message is misleading

2011-12-08 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone : When a timezone produces an out-of-bounds utc offset, the resulting exception always claims that the offset was 1440, rather than whatever it was. Example: from datetime import timedelta, datetime, tzinfo class X(tzinfo): def utcoffset(self, time

[issue12443] locale.setlocale(locale.LC_ALL, locale.getlocale()) fails for some locales

2011-06-29 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone : Consider this transcript from OS X 10.6: >>> import locale >>> locale.getlocale() (None, None) >>> locale.setlocale(locale.LC_ALL, _) 'C' >>> locale.setlocale(locale.LC_ALL, 'en_US.UTF-8

[issue2506] Line tracing of continue after always-taken if is incorrect

2011-07-13 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: Since the main argument for not fixing this bug seems to be that it doesn't affect many users, it seems like I should comment here that the issue is affecting me. A recently proposed addition to Twisted gets bitten by this case, resulting in a r

[issue11657] multiprocessing_{send,recv}fd fail with fds > 256

2011-07-28 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: Thanks for the patch Petri. Are you interested in writing a unit test for this as well? -- nosy: +exarkun ___ Python tracker <http://bugs.python.org/issue11

[issue9053] distutils compiles extensions so that Python.h cannot be found

2010-08-27 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: exar...@boson:~/Projects/python-signalfd/trunk$ PYTHONPATH= ~/Projects/python/branches/py3k/python setup.py build_ext -i running build_ext building 'signalfd._signalfd' extension creating build creating build/temp.linux-i686-3.2 creating build/

[issue9053] distutils compiles extensions so that Python.h cannot be found

2010-08-27 Thread Jean-Paul Calderone
Changes by Jean-Paul Calderone : -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/issue9053> ___ ___ Python-bugs-

[issue8685] set(range(100000)).difference(set()) is slow

2010-09-01 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: > I'll be looking at it shortly. Py3.2 is still aways from release so there is > no hurry. I would consider reviewing and possibly apply this change, but I don't want to invade anyone's territory.

[issue8685] set(range(100000)).difference(set()) is slow

2010-09-01 Thread Jean-Paul Calderone
Changes by Jean-Paul Calderone : -- nosy: -exarkun ___ Python tracker <http://bugs.python.org/issue8685> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9875] Garbage output when running setup.py on Windows

2010-09-16 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone : The output of setup.py is polluted with this log message: Importing new compiler from distutils.msvc9compiler on Windows. For example, using pyOpenSSL's setup.py, running "setup.py --version" produces this output: Importing ne

[issue9881] PySSL_SSLRead loops until data is available, even in non-blocking mode

2010-09-16 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone : Here's a transcript which demonstrates the blocking behavior: >>> import socket >>> import time >>> import ssl >>> s = ssl.wrap_socket(socket.socket()) >>> s.connect(('localhost', 8443)) >&g

[issue9881] PySSL_SSLread loops until data is available, even in non-blocking mode

2010-09-16 Thread Jean-Paul Calderone
Changes by Jean-Paul Calderone : -- title: PySSL_SSLRead loops until data is available, even in non-blocking mode -> PySSL_SSLread loops until data is available, even in non-blocking mode ___ Python tracker <http://bugs.python.org/iss

[issue9881] PySSL_SSLread loops until data is available, even in non-blocking mode

2010-09-16 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: Hm. I must have been testing with old versions, since I can't reproduce this now. Sorry for the noise. -- resolution: out of date -> duplicate status: pending -> closed ___ Python tra

[issue9875] Garbage output when running setup.py on Windows

2010-09-16 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: This seems to have been caused by an ill-placed distutils.log.set_verbosity(3) call. With that removed, this output isn't generated by default. So perhaps this is invalid, feel free to close it as so if you

[issue8998] add crypto routines to stdlib

2010-09-17 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: How about nss? As a bonus, this would also avoid making more work for Fedora (<http://fedoraproject.org/wiki/FedoraCryptoConsolidation>). -- ___ Python tracker <http://bugs.python.org/

[issue8998] add crypto routines to stdlib

2010-09-17 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: What it will bring: APIs which aren't absolutely insane; full SSL support; RSA, DSA, ECDSA, Diffie-Hellman, EC Diffie-Hellman, AES, Triple DES, DES, RC2, RC4, SHA-1, SHA-256, SHA-384, SHA-512, MD2, MD5, HMAC: Common cryptographic algorithms us

[issue8998] add crypto routines to stdlib

2010-09-17 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: > I should note that I can't touch anything to do with Elliptic Curve crypto. > I don't know if I can comment on the reasons for that. Hopefully anything ECC related can be done separately. There's certainly no ECC APIs in Pytho

[issue9090] Error code 10035 calling socket.recv() on a socket with a timeout (WSAEWOULDBLOCK - A non-blocking socket operation could not be completed immediately)

2010-09-18 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: > Unfortunately, select doesn't necessarily update the timeout variable with > the remaining time, so we can't rely on this. This would mean having the > select enclosed within gettimeofday and friends, which seems a bit overkill...

[issue9953] 2 scripts running from crontab simultaneously reference the same instance of a variable

2010-09-26 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: You can't rely on id() to return distinct values across different processes. It guarantees uniqueness *within a single process* (at any particular moment). In other words, you're misusing id() here. This is not a Python bug. -- nosy

[issue9961] Identity Crisis! variable assignment using strftime fails comparison test.

2010-09-27 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: You mistakenly used "is" for these comparisons, rather than "==". The strftime involvement is a red herring. The real problem is the use of an /identity/ comparison rather than an /equality/ comparison. -- nosy:

[issue9966] platform : a boolean to know easily when a system is posix

2010-09-27 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: It could, but why introduce this redundancy with `os.name`? -- nosy: +exarkun ___ Python tracker <http://bugs.python.org/issue9

[issue9994] Python becoming orphaned over ssh

2010-09-30 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: fwiw http://mail.python.org/pipermail/python-list/2010-September/1256545.html -- nosy: +exarkun ___ Python tracker <http://bugs.python.org/issue9

[issue10093] Warn when files are not explicitly closed

2010-10-13 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: If the warnings are emitted as usual with the warnings module, you can use -W to control this. -X isn't necessary. -- nosy: +exarkun ___ Python tracker <http://bugs.python.org/is

[issue10169] socket.sendto raises incorrect exception when passed incorrect types

2010-10-21 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone : >>> s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) >>> s.bind(('', 0)) >>> s.sendto(u'hellé', s.getsockname()) Traceback (most recent call last): File "", line 1, in TypeError: se

[issue10377] cProfile incorrectly labels its output

2010-11-09 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone : Consider this transcript: >>> cProfile.run("import time; time.sleep(1)") 4 function calls in 1.012 CPU seconds Ordered by: standard name ncalls tottime percall cumtime percall filename:lineno(function)

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: Trial lets test cases get garbaged collected. When we noticed this wasn't happening, we treated it as a bug and fixed it. No one ever complained about the change. I don't see any obvious way in which an application would even be able t

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: > I thought unittest was just handed a bunch of TestCase instances and couldn't > do much about insuring they were garbage collected. True. But unittest could ensure that it doesn't keep a reference to each TestCase instance after it

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: Here's Trial's implementation: http://twistedmatrix.com/trac/browser/trunk/twisted/trial/runner.py#L138 -- ___ Python tracker <http://bugs.python.o

[issue12126] incorrect select documentation

2011-05-19 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone : http://docs.python.org/py3k/howto/sockets.html#non-blocking-sockets "And if you put a socket in more than one input list, it will only be (at most) in one output list." >>> import socket >>> s = socket.socket() &g

[issue10661] ElementTree QName has a very uninformative repr()

2010-12-09 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone : This is somewhat unfortunate behavior: >>> from xml.etree.ElementTree import QName >>> QName('foo') >>> It becomes even more apparent when encountered in a situation like this: >>> print {QName('foo

[issue10935] wsgiref.handlers.BaseHandler and subclasses of str

2011-01-20 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: > Phillip, your argument about interfacing with code written in C doesn't work > for built-in immutable types like str. Sure it does. Definitely-str is easier to handle in C than maybe-str-subclass. It doesn't matter that str.__n

[issue3051] heapq change breaking compatibility

2008-06-06 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: The heapq documentation isn't very clear about its requirements. It does explicitly say that "Heaps are arrays for which heap[k] <= heap[2*k+1] and heap[k] <= heap[2*k+2] for all k, counting elements from zero

[issue3051] heapq change breaking compatibility

2008-06-11 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: I tried this too and then wrote a couple unit tests for this. The one for the Python implementation which tests the case where only __le__ is defined fails, though. Diff attached. -- keywords: +patch Added file

[issue3051] heapq change breaking compatibility

2008-06-11 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: Thanks for the explanation. Unfortunately, even if we change our code to work with the new requirements, all the old code is still out there. Maybe this doesn't matter, since there are so many other incompatibilities between

[issue3211] warnings.warn_explicit raises SystemError

2008-06-26 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone <[EMAIL PROTECTED]>: Python 2.6b1+ (trunk:64531M, Jun 26 2008, 10:40:14) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> impor

[issue3383] ctypes.util fails to find libc in some environments

2008-07-16 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone <[EMAIL PROTECTED]>: ctypes.util assumes several things of its environment which sometimes don't hold: * It depends on objdump being in $PATH. If it isn't, it will fail to read the SONAME from a library, even if it has determined the pa

[issue3500] unbound methods of different classes compare equal

2008-08-04 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone <[EMAIL PROTECTED]>: If a method is inherited by two different classes, then the unbound method objects which can be retrieved from those classes compare equal to each other. For example: Python 2.6b2+ (trunk:65502M, Aug 4 2008, 15:05:07) [GCC

[issue3500] unbound methods of different classes compare equal

2008-08-04 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: The reason I noticed this is that since they compare and hash equal, if you put two such methods into a set, you end up with a set with one method. Currently, this is preventing me from running two test methods because the method

[issue3500] unbound methods of different classes compare equal

2008-08-05 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: > But you acknowledge they are really the same method attached to > different classes, right? The notion of "unbound method" is mostly an > implementation detail. The term occurs only 4 times in the who

[issue3383] ctypes.util fails to find libc in some environments

2008-08-11 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: Any chance of getting this fixed? ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue3741] DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an exception

2008-08-31 Thread Paul "TBBle" Hampson
New submission from Paul "TBBle" Hampson <[EMAIL PROTECTED]>: Basically, if DISTUTILS_USE_SDK is set in the environment and an extension is attempted to be built from within the Windows SDK shell (ie. MSSdk is set in the environment as well), msvc9compiler.py will raise an ex

[issue3741] DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an exception

2008-08-31 Thread Paul "TBBle" Hampson
Paul "TBBle" Hampson <[EMAIL PROTECTED]> added the comment: The line my patch adds was present originally, and lost when msvccompiler.py was duplicated into msvc9compiler.py in revision 59290. http://svn.python.org/view?rev=59290&view=rev __

[issue3780] No way to write unit tests for warnings

2008-09-04 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone <[EMAIL PROTECTED]>: In Python 2.5 and earlier, the `warnings.warn_explicit` function could be replaced in order to test what warnings were emitted by some code. This allowed unit tests for warnings to be written. Since much of the warnings module

[issue3781] warnings.catch_warnings fails gracelessly when recording warnings but no warnings are emitted

2008-09-04 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone <[EMAIL PROTECTED]>: This example shows the behavior: from warnings import catch_warnings def test(): with catch_warnings(True) as w: assert str(w.message) == "foo", "%r != %r" % (w.message, "foo

[issue3780] No way to write unit tests for warnings

2008-09-04 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: I was aware of it, but I didn't realize adding an "always" filter would make sure all warnings always got noticed. I haven't tried changing Twisted's use of the warnings module yet, but it looks like

[issue3781] warnings.catch_warnings fails gracelessly when recording warnings but no warnings are emitted

2008-09-04 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: The specific exception type isn't that important to me, as long as I can rely on it being something in particular. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.

[issue3781] warnings.catch_warnings fails gracelessly when recording warnings but no warnings are emitted

2008-09-09 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: Exposing a list seems like a great low-level API to me. There are no [-1]s in the Twisted codebase as a result of using this API because we have a higher-level API built on top of it. Having this low-level API that doesn't

[issue3781] warnings.catch_warnings fails gracelessly when recording warnings but no warnings are emitted

2008-09-09 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: There was a discussion on python-dev about using things from the `test` package from code outside the `test` package: http://mail.python.org/pipermail/python-dev/2008-August/081860.html ___

[issue3823] ssl.wrap_socket() is incompatible with servers that drop privileges, due to keyfile requirement

2008-09-10 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: Both M2Crypto and pyOpenSSL expose certificate and key objects and have seen lots of real-world use. Following their lead would be sensible. -- nosy: +exarkun ___ Python tracker &

[issue3823] ssl.wrap_socket() is incompatible with servers that drop privileges, due to keyfile requirement

2008-09-10 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: I'm just suggesting that if the ssl module *is* going to gain certificate and key objects, looking at existing APIs and perhaps emulating them, to the extent that they provide functionality which the ssl module is also going

[issue3823] ssl.wrap_socket() is incompatible with servers that drop privileges, due to keyfile requirement

2008-09-10 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: You can load a private key from a string by creating a memory BIO and using PEM_read_bio_PrivateKey or d2i_PrivateKey_bio. This is how pyOpenSSL implements its load_privatekey API. You can see the code here:

<    23   24   25   26   27   28   29   30   31   32   >