[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-21 Thread Alex Willmer
Change by Alex Willmer : -- nosy: -Alex.Willmer ___ Python tracker <https://bugs.python.org/issue43424> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44724] multiprocessing: the Resource Tracker process is never reaped

2021-11-24 Thread Alex Willmer
Change by Alex Willmer : -- nosy: +Alex.Willmer ___ Python tracker <https://bugs.python.org/issue44724> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31904] Python should support VxWorks RTOS

2021-05-08 Thread Alex Willmer
Change by Alex Willmer : -- nosy: -Alex.Willmer ___ Python tracker <https://bugs.python.org/issue31904> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23740] http.client request and send method have some datatype issues

2021-03-05 Thread Alex Willmer
Alex Willmer added the comment: http_dump.py now covers CPython 3.6-3.10 (via Tox), and HTTPSConnection https://github.com/moreati/bpo-23740 -- ___ Python tracker <https://bugs.python.org/issue23

[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-04 Thread Alex Willmer
Change by Alex Willmer : -- keywords: +patch pull_requests: +23528 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24757 ___ Python tracker <https://bugs.python.org/issu

[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-04 Thread Alex Willmer
Alex Willmer added the comment: Discussion from #python IRC [21:51] Given `a=time.monotonic(); b=time.monotonic(); c=time.monotonic()` is `c-a < delta` a valid comparison? Until this evening I thought so, but I've just read https://docs.python.org/3/library/time.html#time.monoto

[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-04 Thread Alex Willmer
New submission from Alex Willmer : I believe the documentation for time.monotonic() and time.perf_counter() could be misleading. Taken literally they could imply that given delta = 0.1 a = time.monotonic() b = time.monotonic() c = time.monotonic() the comparisons `b - a < delta`, and `c

[issue23740] http.client request and send method have some datatype issues

2021-03-02 Thread Alex Willmer
Alex Willmer added the comment: First stab at characterising http.client.HTTPConnnection.send(). https://github.com/moreati/bpo-23740 This uses a webserver that returns request details, in the body of the response. Raw (TCP level) content is included. It shares a similar purpose to HTTP

[issue23740] http.client request and send method have some datatype issues

2021-03-02 Thread Alex Willmer
Alex Willmer added the comment: A data point found while I researched this MyPy typeshed [1] currently declares _DataType = Union[bytes, IO[Any], Iterable[bytes], str] class HTTPConnection: def send(self, data: _DataType) -> None: ... [1] https://github.com/python/typeshed/b

[issue13559] Use sendfile where possible in httplib

2021-02-26 Thread Alex Willmer
Alex Willmer added the comment: To check my understanding Is the motivation for the closer to 1. using sendfile() will break $X, and we know X 2. there's high probability sendfile() will break something 3. there's unknown probability sendfile() will break something 4. there's low probability

[issue13559] Use sendfile where possible in httplib

2021-02-25 Thread Alex Willmer
Alex Willmer added the comment: I would like to take a stab at this. Giampaolo, would it be okay if I made a pull request updated from your patch? With the appropriate "Co-authored-by: Author Name " line. -- nosy: +Alex.Willmer ___ Pyth

[issue37210] Pure Python pickle module should not depend on _pickle.PickleBuffer

2019-06-11 Thread Alex Willmer
Alex Willmer added the comment: > it is probably not possible to write a pure Python PickleBuffer Fair enough > a usable pure Python Pickler, but without support for the PickleBuffer class. That makes sense. However, for third party packages (e.g. zodbpickle, pikl) wanting a pure

[issue37210] Pure Python pickle module should not depend on _pickle.PickleBuffer

2019-06-11 Thread Alex Willmer
Alex Willmer added the comment: I don't think I can do this. My WIP code is in https://github.com/moreati/cpython/pull/new/bpo-37210, and associated make test output is attached. Principal blockers - `_pickle.PickleBuffer.raw()` can return a contiguous buffer from either a c_contiguous

[issue37218] Default hmac.new() digestmod has not been removed from documentation

2019-06-10 Thread Alex Willmer
Change by Alex Willmer : -- keywords: +patch pull_requests: +13814 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13947 ___ Python tracker <https://bugs.python.org/issu

[issue37218] Default hmac.new() digestmod has not been removed from documentation

2019-06-10 Thread Alex Willmer
Alex Willmer added the comment: Scratch the part about documented signature, it's still `hmac.new(... digestmod=None)`, the check happens in the body of the function -- ___ Python tracker <https://bugs.python.org/issue37

[issue37218] Default hmac.new() digestmod has not been removed from documentation

2019-06-10 Thread Alex Willmer
New submission from Alex Willmer : Until Python 3.8 hmc.new() defaulted the digestmod argument to 'hmac-md5'. This was deperecated, to be removed in Python 3.8. In Python 3.8.0b1 it is gone, e.g. Python 3.8.0b1 (default, Jun 6 2019, 03:44:52) [GCC 7.4.0] on linux Type "help",

[issue37210] Pure Python pickle module should not depend on _pickle.PickleBuffer

2019-06-09 Thread Alex Willmer
Alex Willmer added the comment: Attempting a PR -- ___ Python tracker <https://bugs.python.org/issue37210> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37210] Pure Python pickle module should not depend on _pickle.PickleBuffer

2019-06-09 Thread Alex Willmer
Alex Willmer added the comment: Arggh, typo. I mean maximizing *your* convenience is paramount. -- ___ Python tracker <https://bugs.python.org/issue37

[issue37210] Pure Python pickle module should not depend on _pickle.PickleBuffer

2019-06-09 Thread Alex Willmer
Alex Willmer added the comment: I noticed this because I was experimenting with pickle.py from the 3.8 branch to support protocol 5 in https://github.com/moreati/pikl (and later to https://pypi.org/project/zodbpickle/). However I want to make it clear, if CPython maintainers wish to keep

[issue27701] [posixmodule] [Refactoring patch] Simply call into *at() functions unconditionally when present

2016-08-08 Thread Alex Willmer
Changes by Alex Willmer <a...@moreati.org.uk>: -- nosy: +Alex.Willmer ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27701> ___ _

[issue27336] --without-threads build fails due to undeclared _PyGILState_check_enabled

2016-06-16 Thread Alex Willmer
New submission from Alex Willmer: Building current tip (rev 102062:3d726dbfca31), on Ubuntu 16.04/x86_64, using --without-thread fails; with the following error gcc -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes-Werror=declaration-after-statement

[issue27229] In tree cross-build fails copying Include/graminit.h to itself

2016-06-05 Thread Alex Willmer
New submission from Alex Willmer: While trying a cross compile of Python 3.6 I encountered the following alex@martha:~/src/cpython default☿ hg summary parent: 101753:31ad7885e2e5 Issue #27225: Fixed a reference leak in type_new when setting __new__ fails. branch: default commit: (clean

[issue22625] When cross-compiling, don’t try to execute binaries

2016-03-14 Thread Alex Willmer
Alex Willmer added the comment: On 14 March 2016 at 01:05, Robert Collins <rep...@bugs.python.org> wrote: > There are three platforms in play: target, host, build. > > Host is the platform where what you build should run on. > build is the platform we are building on. > t

[issue26271] freeze.py makefile uses the wrong flags variables

2016-03-07 Thread Alex Willmer
Changes by Alex Willmer <a...@moreati.org.uk>: -- nosy: +Alex.Willmer ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26271> ___ _

[issue26505] [PATCH] Spelling of ANY in the license of Modules/getaddrinfo.c

2016-03-07 Thread Alex Willmer
New submission from Alex Willmer: The license of Modules/getaddrinfo.c misspells ANY as GAI_ANY. I'm assuming a sed invocation was the cause. The same file later uses GAI_ANY as a wildcard for socket type, protocol and port. It looks like this mistake was present when the code was first

[issue26443] cross building extensions picks up host headers

2016-03-01 Thread Alex Willmer
Alex Willmer added the comment: This looks like a duplicate of #20211, and IMO the patch there is more correct. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue22654] issue with PYTHON_FOR_BUILD

2016-03-01 Thread Alex Willmer
Changes by Alex Willmer <a...@moreati.org.uk>: -- nosy: +Alex.Willmer ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22654> ___ _

[issue22699] cross-compilation of Python3.4

2016-03-01 Thread Alex Willmer
Changes by Alex Willmer <a...@moreati.org.uk>: -- nosy: +Alex.Willmer ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22699> ___ _

[issue22625] When cross-compiling, don’t try to execute binaries

2016-03-01 Thread Alex Willmer
Changes by Alex Willmer <a...@moreati.org.uk>: -- nosy: +Alex.Willmer ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22625> ___ _

[issue26443] cross building extensions picks up host headers

2016-03-01 Thread Alex Willmer
Changes by Alex Willmer <a...@moreati.org.uk>: -- nosy: +Alex.Willmer ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26443> ___ _

[issue23670] Modifications to support iOS as a cross-compilation target

2016-03-01 Thread Alex Willmer
Alex Willmer added the comment: I've done my best to rebase Freakboy's patch onto 3.6-dev. The attached applies cleanly, but the testsuite goes into an infinite loop. It's a start at least. At a guess the problem is in Lib/test/libregrtest/ or Lib/test/regrtest.py where the patch changes

[issue25009] queue.Queue() does not validate the maxsize argument

2015-09-05 Thread Alex Willmer
New submission from Alex Willmer: The maxsize argument when initializing a Queue is expected to be an int (technically anything that can be compared to an int). However the class takes any value. In Python 3 this throws "TypeError: unorderable types" once e.g. .put() is called. On

[issue12006] strptime should implement %V or %u directive from libc

2014-09-22 Thread Alex Willmer
Alex Willmer added the comment: Alexander, http://bugs.python.org/file36417/12006_3.5_complete.patch updates the previous patches and is ready for review. Unit tests pass as of today. Regards, Alex W. -- nosy: +Alex.Willmer ___ Python tracker

[issue12006] strptime should implement %V or %u directive from libc

2014-08-19 Thread Alex Willmer
Changes by Alex Willmer a...@moreati.org.uk: Added file: http://bugs.python.org/file36417/12006_3.5_complete.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12006

Coding challenge: Optimise a custom string encoding

2014-08-18 Thread Alex Willmer
A challenge, just for fun. Can you speed up this function? import string charset = set(string.ascii_letters + string.digits + '@_-') byteseq = [chr(i) for i in xrange(256)] bytemap = {byte: byte if byte in charset else '+' + byte.encode('hex') for byte in byteseq} def plus_encode(s):

Re: Coding challenge: Optimise a custom string encoding

2014-08-18 Thread Alex Willmer
On Monday, 18 August 2014 21:16:26 UTC+1, Terry Reedy wrote: On 8/18/2014 3:16 PM, Alex Willmer wrote: A challenge, just for fun. Can you speed up this function? You should give a specification here, with examples. You should perhaps Sorry, the (informal) spec was further down

[issue19796] urllib2.HTTPError.reason is not documented as Added in 2.7

2013-11-26 Thread Alex Willmer
New submission from Alex Willmer: issue13211 added a .reason attribute to urllib2.HTTPError in Python 2.7, issue16634 documented it (http://hg.python.org/cpython/rev/deb60efd32eb). The documentation for Python 2.7 doesn't mention that this attribute was added in that release. This (at least

Re: *.sdf database access

2012-04-21 Thread Alex Willmer
On Apr 19, 9:18 pm, Page3D pag...@gmail.com wrote: Hi, I am trying to connect and access data in a *.sdf file on Win7 system using Python 2.7. I have three questions: 1. What python module should I use? I have looked at sqlite3 and pyodbc. However, I can seem to get the connection to the

Re: trac.util

2012-04-14 Thread Alex Willmer
On Apr 11, 9:52 pm, cerr ron.egg...@gmail.com wrote: Hi, I want to install some python driver on my system that requires trac.util (from Image.py) but I can't find that anywhere, any suggestions, anyone? Thank you very much, any help is appreciated! Error: File /root/weewx/bin/Image.py,

Benchmarking stripping of Unicode characters which are invalid XML

2012-03-18 Thread Alex Willmer
Last week I was surprised to discover that there are Unicode characters that aren't valid in an XML document. That is regardless of escaping (e.g. #x00;) and unicode encoding (e.g. UTF-8) - not every Unicode string can be stored in XML. The valid characters are (as of XML 1.0) #x9 | #xA | #xD |

A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-23 Thread Alex Willmer
This week I was slightly surprised by a behaviour that I've not considered before. I've long used for i, x in enumerate(seq): # do stuff as a standard looping-with-index construct. In Python for loops don't create a scope, so the loop variables are available afterward. I've sometimes used

Finding x is 1, and x is 'foo' comparisons in a code base

2012-01-17 Thread Alex Willmer
Hello, I'm looking for a way to find the occurrences of x is y comparisons in an existing code base. Except for a few special cases (e.g. x is [not] None) they're a usually mistakes, the correct test being x == y. However they happen to work most of the time on CPython (e.g. when y is a small

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread Alex Willmer
(Direct reply to me, reposted on Jame's behalf) Hi Alex, On Mon, May 9, 2011 at 3:21 PM, Alex Willmer a...@moreati.org.uk wrote: On May 9, 8:10 pm, James Wright jamfwri...@gmail.com wrote: Hello Ian, It does indeed to seem that way. However the script works just fine on other machines

Re: Validating Command Line Options

2011-03-23 Thread Alex Willmer
On Mar 23, 3:20 pm, T misceveryth...@gmail.com wrote: Thanks!  argparse is definitely what I need..unfortunately I'm running 2.6 now, so I'll need to upgrade to 2.7 and hope that none of my other scripts break. Argparse was a third-party module before it became part of the std- lib. You may

Re: argparse and filetypes

2011-03-22 Thread Alex Willmer
On Mar 22, 2:06 pm, Bradley Hintze bradle...@aggiemail.usu.edu wrote: I just started with argparse. I want to simply check the extension of the file that the user passes to the program. I get a ''file' object has no attribute 'rfind'' error when I use os.path.splitext(args.infile).  Here is my

Re: argparse and filetypes

2011-03-22 Thread Alex Willmer
On Mar 22, 2:06 pm, Bradley Hintze bradle...@aggiemail.usu.edu wrote: Hi, I just started with argparse. I want to simply check the extension of the file that the user passes to the program. I get a ''file' object has no attribute 'rfind'' error when I use os.path.splitext(args.infile).

Re: file print extra spaces

2011-03-22 Thread Alex Willmer
On Mar 23, 1:33 am, monkeys paw mon...@joemoney.net wrote: When i open a file in python, and then print the contents line by line, the printout has an extra blank line between each printed line (shown below):   f=open('authors.py')   i=0   for line in f:         print(line)         i=i+1

Re: error in exception syntax

2011-03-09 Thread Alex Willmer
On Mar 9, 6:12 pm, Aaron Gray ang.use...@gmail.com wrote: On Windows I have installed Python 3.2 and PyOpenGL-3.0.1 and am getting the following error :-     File c:\Python32\lib\site-packages\OpenGL\platform\win32.py, line 13       except OSError, err:                 ^ It works okay on

下载 below Download, in python.org site menu

2011-03-06 Thread Alex Willmer
On the English version of http://python.org I'm seeing 下载 as a menu item between Download and Community. AFAICT it's Simplified Chinese for 'download'. Is it's appearance intentional, or a leak through from a translation of the entire page? Regards, Alex PS Tested with 10.0.648.114 (75702) and

Re: subclass urllib2

2011-02-28 Thread Alex Willmer
On Feb 28, 6:53 pm, monkeys paw mon...@joemoney.net wrote: I'm trying to subclass urllib2 in order to mask the version attribute. Here's what i'm using: import urllib2 class myURL(urllib2):      def __init__(self):          urllib2.__init__(self)          self.version = 'firefox' I get

Re: interleave string

2011-02-15 Thread Alex Willmer
On Feb 15, 10:09 am, Wojciech Muła wojciech_m...@poczta.null.onet.pl.invalid wrote: import re s = 'xxaabbddee' m = re.compile((..)) s1 = m.sub(\\1:, s)[:-1] One can modify this slightly: s = 'xxaabbddee' m = re.compile('..') s1 = ':'.join(m.findall(s)) Depending on one's taste this could

Re: Namespaces

2011-01-21 Thread Alex Willmer
On Jan 21, 10:39 am, sl33k_ ahsanbag...@gmail.com wrote: What is namespace? And what is built-in namespace? A namespace is a container for names, like a directory is a container for files. Names are the labels we use to refer to python objects (e.g. int, bool, sys), and each Python object -

Re: Convert unicode escape sequences to unicode in a file

2011-01-11 Thread Alex Willmer
On Jan 11, 8:53 pm, Jeremy jlcon...@gmail.com wrote: I have a file that has unicode escape sequences, i.e., J\u00e9r\u00f4me and I want to replace all of them in a file and write the results to a new file.  The simple script I've created is copied below.  However, I am getting the

Re: How to dump a Python 2.6 dictionary with UTF-8 strings?

2011-01-11 Thread Alex Willmer
On Jan 11, 10:40 pm, W. Martin Borgert deba...@debian.org wrote: Hi, naively, I thought the following code: #!/usr/bin/env python2.6 # -*- coding: utf-8 -*- import codecs d = { u'key': u'我爱中国人' } if __name__ == __main__:     with codecs.open(ilike.txt, w, utf-8) as f:         print f, d

Re: Trying to decide between PHP and Python

2011-01-04 Thread Alex Willmer
On Jan 4, 8:20 pm, Google Poster gopos...@jonjay.com wrote: Can any of you nice folks post a snippet of how to perform a listing of the current directory and save it in a string? Something like this: $ setenv FILES = `ls` Bonus: Let's say that I want to convert the names of the files to

Python comparison matrix

2011-01-03 Thread Alex Willmer
I've created a spreadsheet that compares the built ins, features and modules of the CPython releases so far. For instance it shows: - basestring was first introduced at version 2.3 then removed in version 3.0 - List comprehensions (PEP 202) were introduced at version 2.0. - apply() was a built

Re: Python comparison matrix

2011-01-03 Thread Alex Willmer
On Tuesday, January 4, 2011 12:54:24 AM UTC, Malcolm wrote: Alex, I think this type of documentation is incredibly useful! Thank you. Is there some type of key which explains symbols like !, *, f, etc? There is a key, it's the second tab from the end, '!' wasn't documented and I forgot

Re: Python comparison matrix

2011-01-03 Thread Alex Willmer
Thank you Antoine, I've fixed those errors. Going by the docs, I have VMSError down as first introduced in Python 2.5. -- http://mail.python.org/mailman/listinfo/python-list

Re: list 2 dict?

2011-01-02 Thread Alex Willmer
On Sunday, January 2, 2011 3:36:35 PM UTC, T wrote: The grouper-way looks nice, but I tried it and it didn't work: from itertools import * ... d = dict(grouper(2, l)) NameError: name 'grouper' is not defined I use Python 2.7. Should it work with this version? No. As Ian said grouper()

Re: String building using join

2011-01-02 Thread Alex Willmer
On Sunday, January 2, 2011 5:43:38 PM UTC, gervaz wrote: Sorry, but it does not work def prg3(l): ... return \n.join([x for x in l if x]) ... prg3(t) Traceback (most recent call last): File stdin, line 1, in module File stdin, line 2, in prg3 TypeError: sequence item 0:

Re: Where is win32service

2011-01-02 Thread Alex Willmer
On Sunday, January 2, 2011 6:40:45 PM UTC, catalinf...@gmail.com wrote: I install Python 2.7 on Windows XP. I try use : import win32service import win32serviceutil But I got that error : ImportError: No module named win32service Where is this module ? It's part of the pywin32 (aka

Re: string u'hyv\xe4' to file as 'hyvä'

2010-12-27 Thread Alex Willmer
On Dec 27, 6:47 am, Mark Tolonen metolone+gm...@gmail.com wrote: gintare g.statk...@gmail.com wrote in message In file i find 'hyv\xe4' instead of hyv . When you open a file with codecs.open(), it expects Unicode strings to be written to the file.  Don't encode them again.  Also,

Re: Python creates locked temp dir

2010-12-10 Thread Alex Willmer
On Dec 8, 6:26 pm, Christian Heimes li...@cheimes.de wrote: There isn't a way to limit access to a single process. mkdtemp creates the directory with mode 0700 and thus limits it to the (effective) user of the current process. Any process of the same user is able to access the directory.

Re: Python creates locked temp dir

2010-12-08 Thread Alex Willmer
On Dec 7, 9:03 pm, utabintarbo utabinta...@gmail.com wrote: I am using tempfile.mkdtemp() to create a working directory on a remote *nix system through a Samba share. When I use this on a Windows box, it works, and I have full access to the created dir. When used on a Linux box (through the

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-11-11 Thread Alex Willmer
Alex Willmer a...@moreati.org.uk added the comment: The re module throws an exception for re.compile(r'[\A\w]'). latest regex doesn't, but I don't think the pattern is matching correctly. Shouldn't findall(r'[\A]\w', 'a b c') return ['a'] and findall(r'[\A\s]\w', 'a b c') return ['a', ' b', ' c

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-11-11 Thread Alex Willmer
Alex Willmer a...@moreati.org.uk added the comment: On Thu, Nov 11, 2010 at 10:20 PM, Vlastimil Brom rep...@bugs.python.org wrote: Maybe I am missing something, but the result in regex seem ok to me: \A is treated like A in a character set; I think it's me who missed something. I'd assumed

Re: Would you recommend python as a first programming language?

2010-11-01 Thread Alex Willmer
On Oct 30, 7:16 pm, brad...@hotmail.com wrote: I was thinking of recommending this to a friend but what do you all think? I think 1. Python is a great language, and a good starting point for many people. 2. You really haven't given us much to go on. Regards, Alex --

Re: 'NoneType' object has no attribute 'bind'

2010-10-28 Thread Alex Willmer
On Oct 28, 11:24 am, Alex sigma.z.1...@gmail.com wrote: hi there, I keep getting the message in the Topic field above. Here's my code: self.click2=Button(root,text=Click Me).grid(column=4,row=10) self.click2.bind(Button-1,self.pop2pop) From reading the Tkinter docs grid doesn't itself

Re: Why flat is better than nested?

2010-10-25 Thread Alex Willmer
On Oct 25, 11:07 am, kj no.em...@please.post wrote: In The Zen of Python, one of the maxims is flat is better than nested?  Why?  Can anyone give me a concrete example that illustrates this point? I take this as a reference to the layout of the Python standard library and other packages i.e.

Re: Why flat is better than nested?

2010-10-25 Thread Alex Willmer
On Oct 25, 2:56 pm, Robin Becker ro...@reportlab.com wrote: On 25/10/2010 11:07, kj wrote: In The Zen of Python, one of the maxims is flat is better than nested?  Why?  Can anyone give me a concrete example that illustrates this point? ... I believe that the following illustrates

Re: Problem installing psycopg2 in virtualenv (Ubuntu 10.04, Python 2.5)

2010-10-05 Thread Alex Willmer
On Oct 5, 7:41 am, Pascal Polleunus p...@especific.be wrote: On 05/10/10 00:11, Diez B. Roggisch wrote: Install the python-dev-package. It contains the Python.h file, which the above error message pretty clearly says. Usually, it's a good idea to search package descriptions of debian/ubuntu

Re: if the else short form

2010-09-29 Thread Alex Willmer
On Sep 29, 12:38 pm, Hrvoje Niksic hnik...@xemacs.org wrote: Tracubik affdfsdfds...@b.com writes: Hi all, I'm studying PyGTK tutorial and i've found this strange form: button = gtk.Button((False,, True,)[fill==True]) the label of button is True if fill==True, is False otherwise. The

Re: Plz comment on this code

2010-09-19 Thread Alex Willmer
Your code works (assuming digits gets populated fully), but it's the absolute bare minimum that would. To be brutally honest it's: - unpythonic - you've not used the core features of Python at all, such as for loops over a sequence - poorly formatted - Please read the python style guide and

Re: Plz comment on this code

2010-09-19 Thread Alex Willmer
On Sep 19, 12:20 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message fdd04662-0ae7-46a3-a7d3-d6bb00438...@j19g2000vbh.googlegroups.com, Alex Willmer wrote: # NB Constants are by convention ALL_CAPS SAYS_WHO? Says PEP 8: Constants Constants are usually

Re: Where do I report a bug to the pythonware PIL

2010-09-03 Thread Alex Willmer
On Sep 3, 10:35 am, jc.lopes jc.lo...@gmail.com wrote: Does anyone knows what is the proper way to submit a bug report to pythonware PIL? thanks JC Lopes The Python Image SIG list http://mail.python.org/mailman/listinfo/image-sig Free Support: If you don't have a support contract, please

Re: problem with strptime and time zone

2010-08-25 Thread Alex Willmer
On Aug 25, 8:48 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 45faa241-620e-42c7-b524-949936f63...@f6g2000yqa.googlegroups.com, Alex Willmer wrote: Dateutil has it's own timezone database ... I hate code which doesn’t just use /usr/share/zoneinfo. How many

Re: seach for pattern based on string

2010-08-24 Thread Alex Willmer
On Aug 24, 5:33 pm, richie05 bal richie8...@gmail.com wrote: i am starting to learn python and I am stuck with query I want to generate with python File looks something like this TRACE: AddNewBookD {bookId 20, noofBooks 6576, authorId 41, publishingCompanyId 7} TRACE: AddNewBookD {bookId 21,

Re: problem with strptime and time zone

2010-08-24 Thread Alex Willmer
On Aug 24, 9:45 pm, m_ahlenius ahleni...@gmail.com wrote: whereas this fails: myStrA = 'Sun Aug 22 19:03:06 PDT' gTimeA = strptime( myStrA, '%a %b %d %H:%M:%S %Z') print gTimeA = ,gTimeA ValueError: time data 'Sun Aug 22 19:03:06 PDT' does not match format '%a %b %d %H:%M:%S %Z' Support

Re: Python 2.7 re.IGNORECASE broken in re.sub?

2010-08-16 Thread Alex Willmer
On Aug 16, 12:23 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sun, 15 Aug 2010 17:36:07 -0700, Alex Willmer wrote: On Aug 16, 1:07 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: You're passing re.IGNORECASE (which happens to equal 2) as a count

Re: Python 2.7 re.IGNORECASE broken in re.sub?

2010-08-16 Thread Alex Willmer
On Aug 16, 1:46 pm, Alex Willmer a...@moreati.org.uk wrote: Note that the (?x) flag changes how the expression is parsed. It should be used first in the expression string, or after one or more whitespace characters. If there are non-whitespace characters before the flag, the results

Re: Python 2.7 re.IGNORECASE broken in re.sub?

2010-08-15 Thread Alex Willmer
On Aug 16, 1:07 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: You're passing re.IGNORECASE (which happens to equal 2) as a count argument, not as a flag. Try this instead: re.sub(rpython\d\d + '(?i)', Python27, t) 'Python27' Basically right, but in-line flags must be

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-08-14 Thread Alex Willmer
Alex Willmer a...@moreati.org.uk added the comment: On 14 August 2010 21:24, Matthew Barnett rep...@bugs.python.org wrote: Over to you, Alex. :-) Et voilà, an exciting Saturday evening http://pypi.python.org/pypi/regex/0.1.20100814 Matthew, I'm currently keeping regex in a private bzr

Re: How to match patterns like XX YY XX YY? (regex)

2010-08-07 Thread Alex Willmer
On Aug 7, 4:48 pm, Peng Yu pengyu...@gmail.com wrote: The problem is that I don't know how to capture pattern that repeat itself (like 'a' and 'xy' in the example). I could use 'test\((\w+) (\w+)\)(\w) (\w)', but it will capture something like 'test(a b)x y', which I don't want to. I'm

Re: Sequential Object Store

2010-08-07 Thread Alex Willmer
On Aug 7, 5:26 pm, GZ zyzhu2...@gmail.com wrote: I am wondering if there is a module that can persist a stream of objects without having to load everything into memory. (For this reason, I think Pickle is out, too, because it needs everything to be in memory.) From the pickle docs it looks

Re: The Application cannot locate win32ui.pyd (or Python) (126)

2010-08-04 Thread Alex Willmer
On Aug 4, 2:35 pm, vsoler vicente.so...@gmail.com wrote: Hi all, I just installed python 3.1.2 where I used to have python 2.6.4. I'm working on Win7. The IDLE GUI works, but I get the following message when trying to open *.py files written for py 2.6         The Application cannot

Re: The Application cannot locate win32ui.pyd (or Python) (126)

2010-08-04 Thread Alex Willmer
On Aug 4, 5:19 pm, vsoler vicente.so...@gmail.com wrote: On Aug 4, 5:41 pm, Alex Willmer a...@moreati.org.uk wrote: On Aug 4, 2:35 pm, vsoler vicente.so...@gmail.com wrote: Hi all, I just installed python 3.1.2 where I used to have python 2.6.4. I'm working on Win7. The IDLE

Re: Get name of file from directory into variable

2010-08-03 Thread Alex Willmer
On Aug 3, 11:21 am, loial jldunn2...@gmail.com wrote: In a unix shell script I can do something like this to look in a directory and get the name of a file or files into a variable : MYFILE=`ls /home/mydir/JOHN*.xml` Can I do this in one line in python? Depends if you count imports. import

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-07-25 Thread Alex Willmer
Alex Willmer a...@moreati.org.uk added the comment: On 25 July 2010 03:46, Matthew Barnett rep...@bugs.python.org wrote: issue2636-20100725.zip is a new version of the regex module. This is now packaged and uploaded to PyPI http://pypi.python.org/pypi/regex/0.1.20100725

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-07-13 Thread Alex Willmer
Alex Willmer a...@moreati.org.uk added the comment: On 13 July 2010 22:34, Jonathan Halcrow rep...@bugs.python.org wrote: The most recent version on pypi (20100709) seems to be missing _regex_core from py_modules in setup.py. Sorry, my fault. I've uploaded a corrected version http

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-07-06 Thread Alex Willmer
Alex Willmer a...@moreati.org.uk added the comment: I've packaged Matthew's latest revision and uploaded it to PyPI. This version will build for Python 2 and Python 3, parallel installs will coexist on the same machine. -- ___ Python tracker rep

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-07-06 Thread Alex Willmer
Alex Willmer a...@moreati.org.uk added the comment: On 6 July 2010 18:03, Matthew Barnett rep...@bugs.python.org wrote: The file at http://pypi.python.org/pypi/regex/ was downloaded 75 times, if that's any help. (Now reset to 0 because of the bug fix.) Each release was downloaded between 50

Reminder: 6 days left for EuroPython 2010 talk submissions

2010-04-25 Thread Alex Willmer
The EuroPython 2010 call for papers closes this Friday on 30th April. We've already had many submissions covering Python 3, Python 2.7, IronPython, Game Programming, Testing, Behavior Driven Development, NoSQL, Accessiblilty and others. We still are looking for talks and tutorials on Django,

Reminder: 6 days left for EuroPython 2010 talk submissions

2010-04-24 Thread Alex Willmer
The EuroPython 2010 call for papers closes this Friday on 30th April. We've already had many submissions covering Python 3, Python 2.7, IronPython, Game Programming, Testing, Behavior Driven Development, NoSQL, Accessiblilty and others. We still are looking for talks and tutorials on Django,

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-04-13 Thread Alex Willmer
Alex Willmer a...@moreati.org.uk added the comment: On 13 April 2010 03:21, Matthew Barnett rep...@bugs.python.org wrote: issue2636-20100413.zip is a new version of the regex module. Matthew, When I run test_regex.py 6 tests are failing, with Python 2.6.5 on Ubuntu Lucid and my setup.py

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-04-13 Thread Alex Willmer
Alex Willmer a...@moreati.org.uk added the comment: On 13 April 2010 18:10, Matthew Barnett rep...@bugs.python.org wrote: Anyway, do:    regex.match(ur\p{Ll}, ua)    regex.match(ur'(?u)\w', u'\xe0') really return None? Your results suggest that they won't. Python 2.6.5 (r265:79063

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-04-13 Thread Alex Willmer
Alex Willmer a...@moreati.org.uk added the comment: On 14 April 2010 00:33, Matthew Barnett rep...@bugs.python.org wrote: I think I might have identified the cause of the problem, although I still haven't been able to reproduce it, so I can't be certain. Performed 76 Passed Looks like you

Re: Splitting a string

2010-04-02 Thread Alex Willmer
On Apr 2, 11:12 am, Thomas Heller thel...@ctypes.org wrote: Maybe I'm just lazy, but what is the fastest way to convert a string into a tuple containing character sequences and integer numbers, like this: 'si_pos_99_rep_1_0.ita'  - ('si_pos_', 99, '_rep_', 1, '_', 0, '.ita') This is very

EuroPython 2010 - Open for registration and reminder of participation

2010-03-16 Thread Alex Willmer
EuroPython 2010 - 17th to 24th July 2010 EuroPython is a conference for the Python programming language community, including the Django, Zope and Plone communities. It is aimed at everyone in the Python community, of all skill levels, both users and

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-03-16 Thread Alex Willmer
Alex Willmer a...@moreati.org.uk added the comment: I've adapted the Python 2.6.5 test_re.py as follows, from test.test_support import verbose, run_unittest -import re -from re import Scanner +import regex as re +from regex import Scanner and run it against regex-2010305. Three tests failed

Re: Understanding the CPython dict implementation

2010-03-15 Thread Alex Willmer
On Mar 15, 4:06 am, John Nagle na...@animats.com wrote:     Is this available as a paper?                                 John Nagle It doesn't wppear to be, slides are here: http://us.pycon.org/2010/conference/schedule/event/12/ Alex -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >