[issue1519638] Unmatched Group issue - workaround

2008-07-11 Thread Gerard

Gerard <[EMAIL PROTECTED]> added the comment:

Hi All,

I found a workaround for the re.sub method so it does not raise an
exception but returns and empty string when backref-ing an empty group.

This is the nutshell:

When doing a search and replace with sub, replace the group represented
as optional for a group represented as an alternation with one empty
subexpression. So instead of this “(.+?)?” use this “(|.+?)” (without
the double quotes).

If there’s nothing matched by this group the empty subexpression
matches. Then an empty string is returned instead of a None and the sub
method is executed normally instead of raising the “unmatched group” error.

A complete description is in my post:
http://www.gp-net.nl/2008/07/11/solved-python-regex-raising-exception-unmatched-group/


Regards,

Gerard.

--
nosy: +gerardjp
title: Unmatched Group issue -> Unmatched Group issue - workaround

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1519638>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4052] Build on 2.6 on AIX 5.3 fails (syntax error / undeclared identifier subtract)

2008-10-06 Thread Gerard

New submission from Gerard <[EMAIL PROTECTED]>:

I'm using an IBM compiler running in AIX 5.3.
Compilation of Python 2.6 fails (see explanation below).
Compilation of Python 2.5.2 is ok.

/home/xyz/python/Python-2.6$ lslpp -L | grep vac
  vac.C 10.1.0.0C FIBM XL C Compiler
  vac.aix53.lib 10.1.0.0C FXL C for AIX
Libraries for AIX
  vac.include   10.1.0.0C FIBM XL C Compiler Include
  vac.lib   10.1.0.0C FXL C for AIX Libraries
  vac.lic   10.1.0.0C FXL C for AIX Licence
Files
  vacpp.cmp.rte 10.1.0.0C FIBM XL C/C++ Compiler
  vacpp.cmp.tools   10.1.0.0C FIBM XL C/C++ Tools
  vacpp.licAgreement10.1.0.0C FIBM XL C++ Electronic
License
  vacpp.memdbg.aix53.rte10.1.0.0C FIBM XL C/C++ User
Heap/Memory
  vacpp.memdbg.rte  10.1.0.0C FIBM XL C/C++ User
Heap and

Configure --prefix  
runs ok.
Then, make fails:

/home/xyz/python/Python-2.6$ make
cc_r -qlanglvl=extc89 -c  -DNDEBUG -O  -I. -IInclude -I./Include
-I/usr/local/include/  -DPy_BUILD_CORE -o Objects/frameobject.o
Objects/frameobject.c
"Objects/frameobject.c", line 520.9: 1506-046 (S) Syntax error.
"Objects/frameobject.c", line 520.12: 1506-045 (S) Undeclared identifier
subtract.
make: The error code from the last command is 1.

--
components: Build
messages: 74365
nosy: gerard
severity: normal
status: open
title: Build on 2.6 on AIX 5.3 fails (syntax error / undeclared identifier 
subtract)
type: compile error
versions: Python 2.6

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4052>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1519638] Unmatched Group issue - workaround

2009-01-13 Thread Gerard

Gerard  added the comment:

Dear Bobby,

I don't see what would be the part that generates the empty string?

Regards,

Gerard.

___
Python tracker 
<http://bugs.python.org/issue1519638>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1519638] Unmatched Group issue - workaround

2009-02-03 Thread Gerard

Gerard  added the comment:

Bobby,

Can you post the actual text you need this for? The back ref indeed
returns a None. I'm wondering if the regex can be be simplefied and if a
positive lookbehind could solve this.

Symantically speaking ... If there's a "b" then return the "ar", because
then an empty alternate might again be of help.

Kind regards,

Gerard.

___
Python tracker 
<http://bugs.python.org/issue1519638>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1519638] Unmatched Group issue - workaround

2009-02-09 Thread Gerard

Gerard  added the comment:

Matthew,

Thanx for the heads-up!

Regards,

Gerard.

___
Python tracker 
<http://bugs.python.org/issue1519638>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31905] IPv4Networkcontains raises exception on None

2017-10-30 Thread Gerard Weatherby

New submission from Gerard Weatherby :

Given a IPvNetwork network
if x in network:
   ...

raises an AttributeError instead of returning False.

--
components: Library (Lib)
files: ne.py
messages: 305250
nosy: Gerard Weatherby
priority: normal
severity: normal
status: open
title: IPv4Networkcontains raises exception on None
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47247/ne.py

___
Python tracker 
<https://bugs.python.org/issue31905>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15112] argparse: nargs='*' positional argument doesn't accept any items if preceded by an option and another positional

2014-09-03 Thread leonard gerard

leonard gerard added the comment:

In my opinion this is a bug or it should be explicitly stated in the generated 
usage help string.

--
nosy: +leonard.gerard

___
Python tracker 
<http://bugs.python.org/issue15112>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15112] argparse: nargs='*' positional argument doesn't accept any items if preceded by an option and another positional

2014-09-03 Thread leonard gerard

leonard gerard added the comment:

It seems that delaying positional argument parsing after all optional arguments 
are parsed would be clean and robust.

My understanding is that optional arguments aren't ambiguous and should be 
processed first and removed from the arguments. Then the current pattern 
matching done for positional arguments would work well (in one try).

If you think this would be a better patch I can give it a try.

--

___
Python tracker 
<http://bugs.python.org/issue15112>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11677] make test has horrendous performance on an ecryptfs

2011-09-06 Thread Jason Gerard DeRose

Jason Gerard DeRose  added the comment:

Barry,

I'm suspicious there might be more to the performance issue than just the 
ecryptfs overhead.  While experimenting with a read benchmark, I just happened 
to notice that when reading from an ecryptfs filesystem, the CPU usage is 
unusually high in the *python3* process.

For example:

./benchmark.py /home/.dmedia
  => 149 MB per second
  => top shows 22-24% CPU usage

./benchmark.py /home/jderose/.dmedia
  => 38.9 MB per second
  => top shows 79-85% CPU usage

It's the same physical drive in both cases, but the one in /home/jderose is 
ecryptfs.  If it was just ecryptfs overhead, wouldn't there be lower CPU 
utilization in the python3 process, as there would be a lower throughput coming 
from the kernel, more time waiting on IO?

In both cases, there were 56 files, for a total of 19.5 GB.  I ran this on 
64-bit Ubuntu Oneiric, Python 3.2.2.

Here's the benchmark:

http://bazaar.launchpad.net/~jderose/filestore/multi/view/head:/benchmark.py

--
nosy: +jderose

___
Python tracker 
<http://bugs.python.org/issue11677>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11677] make test has horrendous performance on an ecryptfs

2011-09-06 Thread Jason Gerard DeRose

Jason Gerard DeRose  added the comment:

Oops, I think I don't understand the meaning of top CPU usage, as time tells a 
different story.

Direct ext4:
real2m14.144s
user0m0.260s
sys 0m30.350s

ecryptfs over ext4:
real8m47.130s
user0m0.080s
sys 7m2.080s

--

___
Python tracker 
<http://bugs.python.org/issue11677>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2011-02-05 Thread Gerard van Helden

Gerard van Helden  added the comment:

The reporter imho is 100% right. Simply because of the fact that in the current 
situation, there is no way to supply an argument starting with a dash (not even 
for instance a filename). That is, of course, total nonsense to be dictated by 
the parser library.

--
nosy: +drm

___
Python tracker 
<http://bugs.python.org/issue9334>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3203] sphinx - table of contents doesn't render correctly (html)

2008-06-25 Thread Gerard M. Flanagan

New submission from Gerard M. Flanagan <[EMAIL PROTECTED]>:

A TOC tree should render in HTML as a single 'ul', but in certain
circumstances it appears as multiple ul's.

You can see the effect here:

http://docs.python.org/dev/c-api/index.html

and in fact in the Sphinx documentation itself:

http://sphinx.pocoo.org/contents.html

the 'toctree' here is not an individual entity but a vertical series of
ul's, each of which has a *single* item (li). You may be able to see the
slightly increased space between the ul's which would not be present if
these were all the children of a single parent.

This should be changed so that pages have a unique 'toc' element because:

- it would be easier for css and javascript to manipulate
- there may be accessibility issues (eg. non-visual readers may not 
identify the toc as a single sequence of alternatives)

The reason for the current behaviour can be found in the method
'resolve_toctree' of class sphinx.environment.BuildEnvironment, line 863::

  newnode = addnodes.compact_paragraph('', '', *tocentries)

`tocentries` is a list of `toctrees` [, ,..] each of
which will end up as a ul, while a compact_paragraph has no html
representation; hence the observed effect.

One way to fix this is to replace the above line with the following::

newnode = nodes.bullet_list()
for entry in tocentries:
for item in entry.children:
assert isinstance(item, nodes.list_item)
newnode.append(item)

(and you can also take the opportunity here to add a unique id::

newnode['ids'].append('toc')
)

Note that this new code is a noop if `tocentries` only has one element,
at least as far as html is concerned.

--
assignee: georg.brandl
components: Documentation tools (Sphinx)
messages: 68756
nosy: georg.brandl, grflanagan
severity: normal
status: open
title: sphinx - table of contents doesn't render correctly (html)
type: behavior
versions: Python 2.6, Python 3.0

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3203>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26460] datetime.strptime without a year fails on Feb 29

2020-03-03 Thread Gerard C Weatherby


Gerard C Weatherby  added the comment:

Yes, code that has been working for my organization the past two years just 
broke this weekend.

Meaning depends on context. The straightforward solution is that if no year is 
specified, the return value should default to the current year.

--
nosy: +gera...@alum.mit.edu

___
Python tracker 
<https://bugs.python.org/issue26460>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20093] Wrong OSError message from os.rename() when dst is a non-empty directory

2013-12-28 Thread Jason Gerard DeRose

New submission from Jason Gerard DeRose:

Under Python 3.3, if renaming a directory with `os.rename()` when the 
destination is an existing, non-empty directory, like this:

os.rename('/tmp/foo', '/tmp/bar')

You'll get an OSError with a message like this:

OSError: [Errno 39] Directory not empty: '/tmp/bar'

However, in the current Python 3.4.0b1 package in Ubuntu Trusty, this error 
message will contain the source directory name instead of the destination 
directory name, like this:

OSError: [Errno 39] Directory not empty: '/tmp/foo'

I've attached a test case, which also covers renaming directories relative to 
an open directory descriptor. This test case works on Python 3.3, fails on 
Python 3.4 Beta1.

--
components: Library (Lib)
files: test_os_rename.py
messages: 207058
nosy: jderose
priority: normal
severity: normal
status: open
title: Wrong OSError message from os.rename() when dst is a non-empty directory
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file33285/test_os_rename.py

___
Python tracker 
<http://bugs.python.org/issue20093>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16074] Bad error message in os.rename, os.link, and os.symlink

2013-12-28 Thread Jason Gerard DeRose

Jason Gerard DeRose added the comment:

vajrasky, one more errno to consider:

[Errno 39] Directory not empty: '/tmp/bar'

This is when renaming a directory: src directory exists; dst directory exists 
and is non-empty.

In 3.4 Beta1, this error message now includes the src instead of the dst 
(flipped behaviour from Python 3.3). I'm not sure whether this changed because 
of changes being tracked in this bug on not, so I filed a separate issue: 
http://bugs.python.org/issue20093

--
nosy: +jderose

___
Python tracker 
<http://bugs.python.org/issue16074>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com