[issue42628] binascii doesn't work on some base64

2021-01-29 Thread Kent Watsen
Kent Watsen added the comment: I see. There are two issues: 1) my `base64` and `openssl` CLI commands were flipped, as you point out, giving a false positive - oops ;) 2) more importantly, the base64 value "ue==" is invalid (there is no binary input that could possibl

[issue42628] binascii doesn't work on some base64

2021-01-23 Thread Kent Watsen
Change by Kent Watsen : -- nosy: -kwatsen2 ___ Python tracker <https://bugs.python.org/issue42628> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42628] binascii doesn't work on some base64

2021-01-23 Thread Kent Watsen
Kent Watsen added the comment: No activity in 3 weeks. Selecting a couple components to give it a bump. -- components: +C API, Library (Lib) nosy: +kwatsen ___ Python tracker <https://bugs.python.org/issue42

[issue42628] binascii doesn't work on some base64

2020-12-12 Thread Kent Watsen
New submission from Kent Watsen : [Tested on 3.8.2 and 3.9.0, bug may manifest in other versions too] The IETF sometimes uses the dummy base64 value "base64encodedvalue==" in specifications in lieu of a block of otherwise meaningless b64. Even though it is a dummy value, the va

[issue36011] ssl - tls verify on Windows fails

2020-11-15 Thread Tom Kent
Tom Kent added the comment: Christian's message indicated that a workaround was possible by adding mozilla's certs to windows cert store. I'm sure there are sysadmins who will really hate this idea, but I've successfully implemented it in a windows docker image, and wanted to document

[issue42252] Embeddable Python indicates that it uses PYTHONPATH

2020-11-03 Thread Tom Kent
Tom Kent added the comment: A couple things... >> One possible use-case is to package it along with another program to use the >> interpreter. > This is the primary use case. If you're doing something else with it, you're > probably misusing it :) Interesting,

[issue42252] Embeddable Python indicates that it uses PYTHONPATH

2020-11-03 Thread Tom Kent
Tom Kent added the comment: I'm not sure I agree with that. One possible use-case is to package it along with another program to use the interpreter. In this case they could use the other program's native language features (e.g. .Net's Process.Start(), Win32 API's CreateProcess(), Even

[issue42252] Embeddable Python indicates that it uses PYTHONPATH

2020-11-03 Thread Tom Kent
New submission from Tom Kent : According to the documentation https://docs.python.org/3/using/windows.html#windows-embeddable > When extracted, the embedded distribution is (almost) fully isolated > from the user’s system, including environment variables, system registry >

My Python programming book for kids is free for 48 hours

2020-02-02 Thread Kent Tong
Hi, If you're interested, please get it for free at: https://www.amazon.com/Yes-Kids-can-learn-Python-ebook/dp/B084CY2L43/ref=sr_1_3 This is a set of training materials I used to successfully teach Python to kids as little as 10 years old. The online learning environment are freely available

[issue18233] SSLSocket.getpeercertchain()

2020-01-31 Thread Kent Watsen
Kent Watsen added the comment: I agree that having both would be best, but there is a world of difference between a must-have (peer_cert_chain) and what seems to be a nice-to-have (authed_peer_cert_chain). My request for clarification was not that I don't understand bags, etc. (see my

[issue18233] SSLSocket.getpeercertchain()

2020-01-30 Thread Kent Watsen
Kent Watsen added the comment: It seems that we're talking about the same thing, but I want the cert-chain the peer sent without any smarts, exactly how OpenSSL's SSL_get_peer_cert_chain() works and, importantly, without stapling any root chain certs the client did not send itself (though

[issue18233] SSLSocket.getpeercertchain()

2020-01-30 Thread Kent Watsen
Kent Watsen added the comment: I don't understand the concern issues being raised for this patch, and also may have a use-case not mentioned yet. For the concern issue, as I understand it, the ability to call getpeercert() or the proposed getpeercertchain() is only after the TLS session has

Interactively online Python learning environment freely available

2020-01-28 Thread Kent Tong
Hi, I've made an online python learning environment available at https://p4kweb.appspot.com Please take a look and let me know what you think :-) -- https://mail.python.org/mailman/listinfo/python-list

[issue31242] Add SSLContext.set_verify_callback()

2020-01-03 Thread Kent Watsen
Kent Watsen added the comment: Very much needing this! My situation is a mutli-tenant asynchio-based server whereby each tenant is able to configure other clients that can connect. The current strategy requires all certs to be known up-front that, for now, necessitates a painful restart

[issue31242] Add SSLContext.set_verify_callback()

2020-01-03 Thread Kent Watsen
Change by Kent Watsen : -- nosy: +kwatsen ___ Python tracker <https://bugs.python.org/issue31242> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34028] Python 3.7.0 wont compile with SSL Support 1.1.0 > alledged missing X509_VERIFY_PARAM_set1_host() support

2019-02-01 Thread Kent Scheidegger
Kent Scheidegger added the comment: I was unable to get it working even with all the suggestions in this thread. I have a shared account on a system with only Python 2.7 and an old version of openssl. I have write access only to my user directory. I installed a new openssl in a local

training materials and learning environment for teaching kids python available

2018-08-31 Thread Kent Tong
Hi all, This is a set of training materials I used to successfully teach Python to kids as little as 10 years old. It was a success because the kids didn't just finish the course, they independently completed most of the coding challenges by applying the knowledge they had learned. The first

[issue31884] subprocess set priority on windows

2017-10-27 Thread Mr JG Kent
Change by Mr JG Kent <james_...@hotmail.co.uk>: -- keywords: +patch pull_requests: +4117 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31884] subprocess set priority on windows

2017-10-27 Thread Mr JG Kent
Change by Mr JG Kent <james_...@hotmail.co.uk>: -- components: Library (Lib) nosy: JamesGKent priority: normal severity: normal status: open title: subprocess set priority on windows type: enhancement ___ Python tracker <rep...@bugs.p

free python course materials for high school students available

2016-08-09 Thread Kent Tong
Hi, I've taught a python course with some positive results to high school students with zero experience in programming. Now I am making these course materials (slides in English and lecture videos in Cantonese) freely available as a contribution back to the community

Re: Why not allow empty code blocks?

2016-07-22 Thread Kent Tong
On Saturday, July 23, 2016 at 9:49:51 AM UTC+8, Steven D'Aprano wrote: > Because it cannot tell the difference between an empty code block and > failing to indent the code block: > > for x in sequence: > print('loop') Thanks for the excellent answer! --

Why not allow empty code blocks?

2016-07-22 Thread Kent Tong
Hi I'm aware that we can use 'pass' as an empty code block. But why doesn't python allow a code block to be empty and thus eliminate the need for this null statement? thanks in advance -- https://mail.python.org/mailman/listinfo/python-list

Re: can't add variables to instances of built-in classes

2016-07-17 Thread Kent Tong
Hi Peter, Thanks a lot for your excellent explanation! -- https://mail.python.org/mailman/listinfo/python-list

can't add variables to instances of built-in classes

2016-07-17 Thread Kent Tong
Hi, I can add new variables to user-defined classes like: >>> class Test: ... pass ... >>> a=Test() >>> a.x=100 but it doesn't work if the instances belong to a built-in class such as str or list: >>> a='abc' >>> a.x=100 Traceback (most recent call last): File "", line 1, in

Re: pygtk beginner script not working

2015-11-15 Thread kent nyberg
On Sat, Nov 14, 2015 at 05:00:59PM -0800, ja...@imagewebdesign.co.uk wrote: > Hi guys > > I'm new to Python so please bare with me :) > > I'm using python 2.7.10 as advised (more tools apparently over 3.x) > > Trying to use this script > > [CODE] > #!/usr/bin/env python > > # example base.py

Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread kent nyberg
ssure that its fed with correct data? I have filled the file with data of size '>HH' and first command reads that. So next read should read the next duplicate of that data that has been written to the file? I understand its hard to read, and a long email. So well, its just a cry out in the

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread kent nyberg
On Fri, Nov 13, 2015 at 12:36:22PM -0700, Ian Kelly wrote: > On Fri, Nov 13, 2015 at 12:20 PM, kent nyberg <k...@z-sverige.nu> wrote: > > def LoadCommandAndReact(place_to_read): > > global RegisterAX > > > > tmp = place_to_read.read()[RegisterAX:calcsize

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread kent nyberg
The main problem was that I forgot to do seek(0). Thanks alot people. Though, as many times before, the problem was due to misunderstanding of how python works. I assumed file.read()[xx:yy] was to be understood as, in the file, read from index xx to place yy. That is, [10:20] was the same

Re: using binary in python

2015-11-10 Thread kent nyberg
On Mon, Nov 09, 2015 at 10:20:25PM -0800, Larry Hudson via Python-list wrote: > Your questions are somewhat difficult to answer because you misunderstand > binary. The key is that EVERYTHING in a computer is binary. There are NO > EXCEPTIONS, it's all binary ALL the time. The difference comes

bitwise operator, bits dont go into bitbucket..?

2015-11-10 Thread kent nyberg
Im reading about bitwise operators and is it true to say they dont work 100% as in C? bitwise operators in C seem to result in bits going to the so called bitbucket. For example, 0b0001. Shifting it >> 1 in C it seems to add on zero to the left and the 1 to the right gets throwned away.

Re: bitwise operator, bits dont go into bitbucket..?

2015-11-10 Thread kent nyberg
On Wed, Nov 11, 2015 at 09:33:38AM +1100, Chris Angelico wrote: > On Wed, Nov 11, 2015 at 9:27 AM, kent nyberg <k...@z-sverige.nu> wrote: > > If you want to check specific bits (in C or Python, either way), it's > much more common to use bitwise AND than bit shifts: > >

using binary in python

2015-11-09 Thread kent nyberg
hanks alot, and forgive me for my stupid questions. :) /Kent Nyberg -- https://mail.python.org/mailman/listinfo/python-list

AssertionError (3.X only) when calling Py_Finalize with threads

2015-01-08 Thread Tom Kent
with no affect, each with_thread() call results in the error output. Thanks, Tom Kent -- https://mail.python.org/mailman/listinfo/python-list

[issue22168] Turtle Graphics RawTurtle problem

2014-08-07 Thread Kent D. Lee
New submission from Kent D. Lee: This is either a turtle graphics or tkinter problem. In Python 3.4 it appears that something in Turtle Graphics broke or at least changed. I get the following error when trying to run a program that works in Python 3.1 and 3.2. Kent's Mac python3.4 c4.py

[issue17390] display python version on idle title bar

2014-06-04 Thread Kent Johnson
Changes by Kent Johnson k...@kentsjohnson.com: -- nosy: -kjohnson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17390 ___ ___ Python-bugs-list

[issue21244] distutils fails to build C extensions with XCode 5.1 and OS X 10.9 (Mavericks)

2014-04-15 Thread Kent Frazier
New submission from Kent Frazier: Using the stock Python shipped by Apple with OS X 10.9 Mavericks and XCode 5.1, Mercurial (and other Python extensions) encounter an error like: cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd

Re: script uses up all memory

2014-03-14 Thread Kent Engström
://docs.djangoproject.com/en/dev/faq/models/#why-is-django-leaking-memory Regards, / Kent Engström, Lysator -- https://mail.python.org/mailman/listinfo/python-list

[issue11508] Virtual Interfaces cause uuid._find_mac to raise a ValueError under Linux

2013-10-29 Thread Kent Frazier
Kent Frazier added the comment: Serhiy, I signed the form. Let me know if you need anything else. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11508

[issue16754] Incorrect shared library extension on linux

2013-04-20 Thread kent
Changes by kent fuzzba...@comcast.net: -- nosy: +Thekent ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16754 ___ ___ Python-bugs-list mailing list

[issue17390] display python version on idle title bar

2013-04-13 Thread Kent Johnson
Kent Johnson added the comment: issue17390_editor_title.patch is not correct, it changes the title on any window that inherits from EditorWindow, including the shell window. Here is a new patch that changes short_title() instead of saved_change_hook(), so it can be overridden by derived

[issue17719] IDLE help text refers to incorrect Python version

2013-04-13 Thread Kent Johnson
New submission from Kent Johnson: The IDLE help text says, Running without a subprocess: (DEPRECATED in Python 3.5 see Issue 16123). According to the referenced issue, this feature is scheduled to be deprecated in *3.4* and *removed* in 3.5. The attached patch corrects the help text

[issue17719] IDLE help text refers to incorrect Python version

2013-04-13 Thread Kent Johnson
Kent Johnson added the comment: Note: this text does not appear in Doc/library/idle.rst so it does not have to be corrected there. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17719

Re: Obtaining a full path name from file

2011-05-24 Thread Michael Kent
If a filename does not contain a path component, os.path.abspath will prepend the current directory path onto it. -- http://mail.python.org/mailman/listinfo/python-list

Re: portable multiprocessing code

2011-05-17 Thread Michael Kent
You could also install Python 2.7 on that RedHat machine. It can be done without interfering with the 2.5 that RedHat depends on. -- http://mail.python.org/mailman/listinfo/python-list

Re: skipping one unittest assertion?

2011-05-01 Thread Michael Kent
I agree that each test should test only one 'thing', but it's also true that testing one 'thing' sometimes/often involves multiple assertions. But in the OP's case, it does sound like the assertion he wants to skip should be broken out into its own test. --

Re: optparse eats $

2011-04-19 Thread Michael Kent
Try this on your *nix command line: echo $100 On a *nix command line, the '$1' part of $100 will be seen as 'give me the value of the shell variable 1', and since it has no value, will result in an empty string. So it's not optparse, or Python, because the literal string you intend to pass as

[issue11820] idle3 shell os.system swallows shell command output

2011-04-16 Thread kent
kent fuzzba...@comcast.net added the comment: I had kind of figured it might be something like this. I ran the following code in the xterm interpreter: x=subprocess.call('ls') bin Documents eclipse local Pictures tmp workspace Desktop Downloads hamlib Music Templates

[issue11820] idle3 shell os.system swallows shell command output

2011-04-16 Thread kent
kent fuzzba...@comcast.net added the comment: The getoutput and getstatusoutput provide the expect output which can be captured x=subprocess.getoutput('ls') print(x) hs_err_pid28274.log LP4E-examples mydir.pth mydir.pth~ PP4E-Examples-1.2 ProgMan Python_dir Would it be a good thing to have

[issue11820] idle3 shell os.system swallows shell command output

2011-04-15 Thread kent
kent fuzzba...@comcast.net added the comment: I tried using subprocess.Popen and subprocess.call, both of which did the same behavior. Under the interpreter I get the desired string output: subprocess.call('ls') bin Documents eclipse local Pictures tmp workspace Desktop

[issue11820] idle3 shell os.system swallows shell command output

2011-04-10 Thread kent
New submission from kent fuzzba...@comcast.net: attempting to run an os.system command under the idle 3 shell swallows the out put. Idle 3 is running on a 32 bit kde mandriva linux. import os os.system('ls') 0 os.system('pwd') 0 as you can see it returns a 0 indicating successful

[issue11820] idle3 shell os.system swallows shell command output

2011-04-10 Thread kent
kent fuzzba...@comcast.net added the comment: running it as a file from idle gives the same result. import os print (os.system('pwd')) 0 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11820

[issue11820] idle3 shell os.system swallows shell command output

2011-04-10 Thread kent
kent fuzzba...@comcast.net added the comment: When starting idle from a terminal the output from the command is sent to the terminal. When starting idle from the desktop, the output disappears except for the exit status. Same behavior with 2.65

Re: Generators and propagation of exceptions

2011-04-09 Thread Kent Johnson
. I don't know if this really works when you start nesting but perhaps it is worth a try. Kent -- http://mail.python.org/mailman/listinfo/python-list

[issue11508] Virtual Interfaces cause uuid._find_mac to raise a ValueError under Linux

2011-03-14 Thread Kent Frazier
New submission from Kent Frazier kentfraz...@gmail.com: If a virtual interface is present in the system, such as if the user is connected to a VPN, then there may be entries in ifconfig that do not conform to the expected `HWAddr 01:23:45:67:89:ab` MAC address format expected by uuid

[issue11508] Virtual Interfaces cause uuid._find_mac to raise a ValueError under Linux

2011-03-14 Thread Kent Frazier
Changes by Kent Frazier kentfraz...@gmail.com: Removed file: http://bugs.python.org/file21136/uuid_ValueError_fix.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11508

[issue11508] Virtual Interfaces cause uuid._find_mac to raise a ValueError under Linux

2011-03-14 Thread Kent Frazier
Kent Frazier kentfraz...@gmail.com added the comment: I was mistaken about the issues with mocking. I am submitting a new patch with a test included. -- Added file: http://bugs.python.org/file21143/uuid_ValueError_fix.diff ___ Python tracker rep

Re: PEP: possibility of inline using of a symbol instead of import

2011-01-06 Thread Mike Kent
On Jan 6, 11:02 am, Duncan Booth duncan.bo...@invalid.invalid wrote: Your complaint seems to be that:    r1 = myFunc1(...) is unclear when you don't know where myfunc1 originates, so why don't you write:    r1 = MyModule1.myFunc1(...) -- Duncan Boothhttp://kupuguy.blogspot.com My

Re: Python 2.7.1

2010-11-29 Thread Kent Johnson
. Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list

Sqlalchemy access to Firefox's places.sqlite

2010-11-17 Thread Kent Tenney
','moz_bookmarks_itemindex', 'moz_bookmarks',3,'CREATE INDEX moz_bookmarks_itemindex ON moz_bookmarks (fk, type)'); ... Is there an easy way to go from this sql to Sqlalchemy code? Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list

[issue10303] small inconsistency in tutorial

2010-11-07 Thread Kent Johnson
Kent Johnson k...@kentsjohnson.com added the comment: Attached patch deletes the referenced sentence. -- keywords: +patch nosy: +kjohnson Added file: http://bugs.python.org/file19536/issue10303.diff ___ Python tracker rep...@bugs.python.org http

Re: what happens to Popen()'s parent-side file descriptors?

2010-10-13 Thread Mike Kent
You might want to check out the Python 2.7 'pipes' standard library module: http://docs.python.org/library/pipes.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Ordering tests in a testsuite

2010-10-08 Thread Mike Kent
But sometimes you just wanna do it the way you wanna do it. If you name your tests like 'test_01_yadda' and test_02_whatever', then they will be run in the order you want, as given by the numbers. -- http://mail.python.org/mailman/listinfo/python-list

Re: python database

2010-09-03 Thread Mike Kent
On Sep 3, 2:36 am, shai garcia melodybel...@gmail.com wrote: can you pls help me to make a database program in python? It's better if you do your homework yourself. You learn more that way. Now, if you have a specific question about some detail of your assignment, and can show us that you've

Re: Does MySQLdb rollback on control-C? Maybe not.

2010-09-03 Thread Mike Kent
On Sep 3, 12:22 am, John Nagle na...@animats.com wrote:     I would expect MySQLdb to rollback on a control-C, but it doesn't seem to have done so.   Something is broken. I wouldn't expect it to, I'd expect to roll back on an exception, or commit if not. Perhaps this will help you. I use it

Re: New to python - parse data into Google Charts

2010-09-03 Thread Mike Kent
On Sep 3, 1:52 pm, alistair alistair.cal...@gmail.com wrote: I'm new to python and my programming years are a ways behind me, so I was looking for some help in parsing a file into a chart using the Google Charts API. Try this: http://pygooglechart.slowchop.com/ --

Re: Python -Vs- Ruby: A regexp match to the death!

2010-08-09 Thread Mike Kent
On Aug 8, 8:43 pm, rantingrick rantingr...@gmail.com wrote: Hello folks, You all know i been forced to use Ruby and i am not happy about that. ***Blablabla cut long rant*** Xah, this is really you, isn't it. Come on, confess. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie problem with str.replace

2010-08-04 Thread Mike Kent
On Aug 4, 9:10 am, BobAalsma bob.aal...@aalsmacons.nl wrote: I'm working on a set of scripts and I can't get a replace to work in the script - please help.                         bestandsnaam_nieuw.replace(KLANTNAAM_OUT,KLANTNAAM_IN) I'm not sure what you are intending to do here, but

python setup.py install_data question

2010-05-26 Thread Kent Tenney
': Permission denied Am I missing something? If it works for you, I suppose it's somewhere in my versioning. I have bull in a china shop tendencies when it comes to installing stuff. Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: Reactive programming in Python ?

2010-04-16 Thread Mike Kent
On Apr 16, 11:18 am, pca pcarb...@yooper.be wrote: Dear all, Could “reactive programming” still increase the productivity and joy of Python programming?  I’d like to hear your thoughts on the idea that object-oriented “programming by formula”, as in a spreadsheet, would simplify our work,

SEC apparently about to mandate Python for a particular financial use

2010-04-16 Thread Mike Kent
http://jrvarma.wordpress.com/2010/04/16/the-sec-and-the-python/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Relocatable python install

2010-04-14 Thread Mike Kent
On Apr 14, 4:50 pm, Michel michel.metz...@gmail.com wrote: Hi, I would like to create a binary package of python that we will ship with our product. I need to be able to install the package anywhere in the file system. The interpreter seems to be ok with that, but a few other tools that

Re: Pythonic list reordering

2010-04-10 Thread Kent Engström
Ben Racine i3enha...@gmail.com writes: I have a list... ['dir_0_error.dat', 'dir_120_error.dat', 'dir_30_error.dat', 'dir_330_error.dat'] I want to sort it based upon the numerical value only. Does someone have an elegant solution to this? I use code like the hack below to sort

[issue8329] select.select() can return lists with identical id()'s

2010-04-06 Thread Mike Kent
New submission from Mike Kent mike.k...@sage.com: If select.select() returns two or more empty lists, these empty lists will all refer to the same list; that is, they will have identical id()'s. If you then have reason to alter one of the returned empty lists, you are altering all

[issue8329] select.select() can return lists with identical id()'s

2010-04-06 Thread Mike Kent
Changes by Mike Kent mike.k...@sage.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8329 ___ ___ Python-bugs-list mailing

Re: (a==b) ? 'Yes' : 'No'

2010-03-30 Thread Mike Kent
On Mar 30, 11:40 am, gentlestone tibor.b...@hotmail.com wrote: Hi, how can I write the popular C/JAVA syntax in Python? Java example:     return (a==b) ? 'Yes' : 'No' My first idea is:     return ('No','Yes')[bool(a==b)] Is there a more elegant/common python expression for this? return

[issue8267] Tutorial secion on dictionary keys recommends sort instead of sorted

2010-03-30 Thread Kent Engström
New submission from Kent Engström k...@lysator.liu.se: The 2.[567] documentation recommends the use of the sort() method to get a sorted list of dictionary keys. If would be less confusing to new users if we recommended the sorted() functions instead. The corresponding piece of Python 3

[issue8267] Tutorial section on dictionary keys recommends sort instead of sorted

2010-03-30 Thread Kent Engström
Changes by Kent Engström k...@lysator.liu.se: -- title: Tutorial secion on dictionary keys recommends sort instead of sorted - Tutorial section on dictionary keys recommends sort instead of sorted ___ Python tracker rep...@bugs.python.org http

Re: A scopeguard for Python

2010-03-05 Thread Mike Kent
On Mar 4, 8:04 pm, Robert Kern robert.k...@gmail.com wrote: No, the try: finally: is not implicit. See the source for contextlib.GeneratorContextManager. When __exit__() gets an exception from the with: block, it will push it into the generator using its .throw() method. This raises the

Re: A scopeguard for Python

2010-03-04 Thread Mike Kent
On Mar 3, 10:56 am, Alf P. Steinbach al...@start.no wrote: * Mike Kent: What's the compelling use case for this vs. a simple try/finally? if you thought about it you would mean a simple try/else. finally is always executed. which is incorrect for cleanup by the way, that's one advantage

Re: A scopeguard for Python

2010-03-04 Thread Mike Kent
On Mar 4, 12:30 pm, Robert Kern robert.k...@gmail.com wrote: He's ignorant of the use cases of the with: statement, true. humor Ouch! Ignorant of the use cases of the with statement, am I? Odd, I use it all the time. /humor Given only your example of the with: statement, it is hard to fault

Re: A scopeguard for Python

2010-03-04 Thread Mike Kent
On Mar 3, 12:00 pm, Robert Kern robert.k...@gmail.com wrote: On 2010-03-03 09:39 AM, Mike Kent wrote: What's the compelling use case for this vs. a simple try/finally?     original_dir = os.getcwd()     try:         os.chdir(somewhere)         # Do other stuff     finally

Re: A scopeguard for Python

2010-03-03 Thread Mike Kent
What's the compelling use case for this vs. a simple try/finally? original_dir = os.getcwd() try: os.chdir(somewhere) # Do other stuff finally: os.chdir(original_dir) # Do other cleanup -- http://mail.python.org/mailman/listinfo/python-list

[issue7935] Cross-reference ast.literal_eval() from eval() docs

2010-02-15 Thread Kent Johnson
New submission from Kent Johnson k...@kentsjohnson.com: eval() is a known security hole. Since Python 2.6 ast.literal_eval() provides a better alternative in many cases. literal_eval() is not as well known as eval() and not easy to find even if you know it exists (but don't remember the name

[issue7738] IDLE hang when tooltip comes up in Linux

2010-01-19 Thread Kent Yip
New submission from Kent Yip yes...@gmail.com: IDLE will hang when a tooltip shows in a Linux system (Ubuntu). do this: t = (1,2,3) len(t) it will hang after the closing ')', when you press return nothing will happen or when you press any keys, it won't show up. However, you can work

Re: Trying to run a sudo command from script

2010-01-03 Thread Kent Tenney
On Fri, Jan 1, 2010 at 5:08 PM, Diez B. Roggisch de...@nospam.web.de wrote: Kent Tenney schrieb: Howdy, A script running as a regular user sometimes wants to run sudo commands. It gets the password with getpass. pw = getpass.getpass() I've fiddled a bunch with stuff like proc

Trying to run a sudo command from script

2010-01-01 Thread Kent Tenney
assorted errors with all variations I try. Googling says use pexpect, but I'd prefer a stdlib solution. Any help appreciated. Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list

[issue7310] Unhelpful __repr__() in os.environ

2009-11-12 Thread Kent Johnson
New submission from Kent Johnson k...@kentsjohnson.com: In Python 2.x, os.environ extends UserDict.IterableUserDict and therefore os.environ.__repr__() shows the environment. This makes it easy and intuitive to view the entire environment in the interactive interpreter. In Python 3.1

Problem building Python from source

2009-09-30 Thread Kent Tenney
: Is there an argument to ./configure or make, or an environment setting which will make cStringIO available without editing Modules/Setup ? Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: nested structure with internal references

2009-09-25 Thread Kent Turbo
On Sep 25, 9:11 pm, Torsten Mohr tm...@s.netic.de wrote: I'd like to refer to another entry and not copy that entry, i need to know later that this is a reference to another entry, i need to find also access that entry then. The references only need to refer to entries in this structure. The

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Mike Kent
On Apr 27, 1:49 am, John Machin sjmac...@lexicon.net wrote: I am having a look at eval and exec WRONG WAY GO BACK +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: WINXP vs. LINUX in threading.Thread

2009-04-23 Thread Kent
Thanx you guys. Now my program is working. I used the Thread subclass. and at the end of the run method, i call wx.CallAfter(mainFrame.somefunction, para) to show the dialog or change some text. I tested in winxplinux. both worked. Kent On Apr 23, 6:16 am, Carl Banks pavlovevide...@gmail.com

WINXP vs. LINUX in threading.Thread

2009-04-22 Thread Kent
hello all, i want to add a new update notification feature to my wxPython appl. The codes below do the job. The logic is simple enough, I don't think it needs to be explained. since sometimes, under windows, proxy setting was a script. and was set in IE. In this case, connecting to the HTML will

Re: ANN: PyGUI 2.0.4

2009-04-21 Thread Kent Johnson
= win_message_map[msg] KeyError: 675 Adding this line to win_message_map in GUI/Win32/Events.py seems to fix it: wc.WM_MOUSELEAVE: ('mouse_leave', None), Kent -- http://mail.python.org/mailman/listinfo/python-list

question about wxpython CtrlList event binder: wx.EVT_LIST_ITEM_RIGHT_CLICK

2009-04-21 Thread Kent
happened, no popup menu. I tested under WINXP, the function was not triggered at all when I right-clicked on the empty area. I tried to bind wx.EVT_RIGHT_DOWN(UP) to the lc, but the function cannot be triggered under Linux. any suggestion? Thanks regards, Kent -- http://mail.python.org/mailman

Re: question about wxpython CtrlList event binder: wx.EVT_LIST_ITEM_RIGHT_CLICK

2009-04-21 Thread Kent
): tagId = event.GetData() # following codes are omitted. just some business logic stuff. checking the tagId, making decision of showing popup menu items... Kent On Apr 21, 11:24 pm, Mike Driscoll kyoso...@gmail.com wrote: On Apr 21, 3:35 pm, Kent kent.y...@gmail.com wrote: Hi

Can I use setup.py to ship and install only .pyc files?

2009-04-16 Thread Mike Kent
I'd like to ship only the .pyc files for a module. I was hoping the standard distutils setup.py could handle this, but so far, I've not figured out how. After a bit of work, I discovered that if I create a MANIFEST.in file, and put 'include mymodule/*.pyc' and 'exclude mymodule/*.py' in it, then

Re: modifying a list element from a function

2009-03-27 Thread Kent
* to do the same modification on the list a within a function * not to hardcode in this function the position of the string in each a = [ [4, toto], [5, cou] ] def assign(element,pos,newValue): ... element[pos]=newValue ... assign(a[0],1,'xxx') print a [[4, 'xxx'], [5, 'cou']] does

Re: how to arrange classes in .py files?

2009-03-27 Thread Kent
On Mar 27, 3:01 pm, David L. Jones david.l.jo...@gmail.com wrote: On Mar 26, 8:51 pm, Kent kent.y...@gmail.com wrote: ... Is there any convention how to manage python classes into .py files? ... In above packages, each .py file contains one python class. And ClassName = Filename

how to arrange classes in .py files?

2009-03-26 Thread Kent
the right code structure of python oop. Can anyone give some hint on it? would be great with reason. Thanks in advance. regards, Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: FTP libs for Python?

2009-02-20 Thread Mike Kent
I use Fabric (http://www.nongnu.org/fab/) as my Python-based deployment tool, but it uses ssh/scp, not sftp. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   7   8   9   >