[issue1711603] syslog syscall support for SysLogLogger

2009-06-22 Thread Max Arnold

Max Arnold lwa...@gmail.com added the comment:

Can I vote for this issue?  Many systems with syslog aren't configured
to listen on UDP socket and thus out of the box SysLogHandler does not work.

--
nosy: +LwarX

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1711603
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1711603] syslog syscall support for SysLogLogger

2009-06-22 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

As the docstring and documentation says, you can use
SysLogHandler(/dev/log) or similar to connect to a local syslog using
Unix domain sockets rather than UDP. Doesn't this work for you?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1711603
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5590] pyexpat defines global symbol template_string

2009-06-22 Thread Matthias Klose

Matthias Klose d...@debian.org added the comment:

fixed in rev 73503

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5590
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4949] Constness in PyErr_NewException

2009-06-22 Thread Andreas Kloeckner

Changes by Andreas Kloeckner inf...@tiker.net:


--
versions: +Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4949
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6322] Pdb breakpoints don't work on lines without bytecode

2009-06-22 Thread Andreas Kloeckner

New submission from Andreas Kloeckner inf...@tiker.net:

Take this program:

8 ---
print START

a = [
1
for i in range(10)]
8 ---

as a.py, run python -m pdb a.py, say b 3 to set a breakpoint on
line 3. Say c to start execution. Watch the program finish without
ever hitting the breakpoint.

The problem is that line 3 has no bytecode generated for it, so there's
nothing to break on. Pdb should provide feedback in this case. I'm the
author of PuDB, and I've written code to check for this condition Please
feel free to steal that code, here:

http://is.gd/19fvD

--
components: Library (Lib)
messages: 89597
nosy: inducer
severity: normal
status: open
title: Pdb breakpoints don't work on lines without bytecode
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6322
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1711603] syslog syscall support for SysLogLogger

2009-06-22 Thread Max Arnold

Max Arnold lwa...@gmail.com added the comment:

Is it safe to use single handler instance in multiple loggers or single
stream in multiple handlers?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1711603
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread Andreas Kloeckner

New submission from Andreas Kloeckner inf...@tiker.net:

Steps to reprdocue:

1) Debug a program with a syntax error in pdb. 
2) Get the SyntaxError traceback.
3) Hit q to quit.
4) Another SyntaxError traceback, and you're back at the Pdb prompt.

--
components: Library (Lib)
messages: 89599
nosy: inducer
severity: normal
status: open
title: Py3.1 pdb doesn't deal well with syntax errors
type: behavior
versions: Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6323
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1711603] syslog syscall support for SysLogLogger

2009-06-22 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

Why would you want to use a single handler instance against multiple
loggers? It's safe to do so, but you could get duplicated messages
appearing. I presume you have reviewed the documentation and are aware
that loggers are organised in a hierarchy and that in the normal case,
handlers of all parent loggers are allowed to handle events logged with
a particular logger.

What do you mean by single stream in multiple handlers? In general
this could result in garbled output, if you have multiple threads in
your environment.

Are these questions relevant to this SysLogHandler issue? I couldn't see
a connection with your earlier comment. If not relevant, please post
them on comp.lang.python where you will probably get more people looking
at them, so that the quality of answers is likely to be more helpful to you.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1711603
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1711603] syslog syscall support for SysLogLogger

2009-06-22 Thread Max Arnold

Max Arnold lwa...@gmail.com added the comment:

Sorry, I've read your first reply too fast and incorrectly interpreted
it as recommendation to use stream handler with /dev/log.

Anyway, thank you for clarification.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1711603
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6070] Python 2.6 makes .pyc/.pyo bytecode files executable

2009-06-22 Thread Oleg Broytmann

Oleg Broytmann p...@phd.pp.ru added the comment:

import_patch2.patch doesn't work for me. I patched and compiled Python
2.6.2 and without installing it ran ./python -c import test in the
build directory. It copied executable bits from test.py to test.pyc.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6070
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6070] Python 2.6 makes .pyc/.pyo bytecode files executable

2009-06-22 Thread Marco

Marco marcu...@gmail.com added the comment:

hmm.. the problem is that Windows doesn't support well permissions as
all the other POSIX compliant OSs ...
I've searched for a solution on the web, and I've found a complete
answer on:
http://stackoverflow.com/questions/592448/c-how-to-set-file-permissions-cross-platform

The patch doesn't work well since it only checks for User's permissions
so it works well for that. 
Maybe using the Windows API you can change the permissions as you want.
But since I don't know them, I can't help anymore :(

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6070
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6070] Python 2.6 makes .pyc/.pyo bytecode files executable

2009-06-22 Thread Oleg Broytmann

Oleg Broytmann p...@phd.pp.ru added the comment:

I am not on Windows. I am on Linux.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6070
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5910] kqueue for more than one event is broken.

2009-06-22 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

The patch looks good, but I cannot test it.

--
assignee:  - christian.heimes
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6285] Silent abort on XP help document display

2009-06-22 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

I reproduce the same problem:
In IDLE, add a new entry in Options/Configure/General/Additional Help 
Sources, and browse to the C:\Python31\Docs\Python31*.chm file.
This new entry appears in the Help menu.

Now, if you un-install this version and install another, the file you have 
chosen is no more present, but still listed in the preferences.
This causes errors if you try to open it...

The proposed patch is correct, except that an error in webbrowser is more 
likely to display some 404 error and not raise an exception.

--
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6285
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6324] in expression falls back to __iter__ before __getitem__

2009-06-22 Thread Anthony Foglia

New submission from Anthony Foglia afog...@gmail.com:

I was debugging a class where I defined __getitem__ and __iter__, but 
not __contains__.  The documentation describing this case (at the end of 
section 5.9) is old and hasn't been updated for the iterator protocol.

It should read something like:

For user-defined classes which do not define __contains__() and do 
define __iter__() or __getitem__(), x in y is true if and only if there 
is a value z reachable from iter(y) before iter(y) throws a 
StopIteration exception. (If any other exception is raised, it is as if 
in raised that exception).

Or something better worded.

(I'm using Python 2.5, but I really doubt things have changes in 2.6 or 
2.7.  I don't know enough about 3.0 to know either way.)

--
assignee: georg.brandl
components: Documentation
messages: 89607
nosy: afoglia, georg.brandl
severity: normal
status: open
title: in expression falls back to __iter__ before __getitem__
versions: Python 2.5, Python 2.6, Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6324
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4490] xml/sax/expatreader.py raises AttributeError when run

2009-06-22 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

These functions are already tested, but I think that this kind of code 
also serves to show a basic usage of the module.
Fixed with r73509.

--
nosy: +amaury.forgeotdarc
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4490
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

I tried different combinations, and could not reproduce it (for example, 
the debugged function imports a bad module, or eval() a bad expression)
How did you generate the SyntaxError?

--
nosy: +amaury.forgeotdarc
stage:  - test needed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6323
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread nlopes

nlopes shelika.v...@gmail.com added the comment:

I can reproduce it in my OpenBSD 4.5 box (only one I tried).

This simple code:
print(3
seems to break the pdb flow in python 3.1 the way Andreas described it.

When I tried in 2.7, this is what I get:
-bash-3.2$ ./python -m pdb test.py
SyntaxError: ('invalid syntax', ('test.py', 2, 8, ''))
 string(1)module()
(Pdb) q
[20367 refs]
-bash-3.2$

--
nosy: +nlopes

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6323
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-06-22 Thread Andrew Trick

Andrew Trick andrew.tr...@gmail.com added the comment:

With this patch, I continued to get the following error 
SSL23_GET_SERVER_HELLO
Until my coworker finally found a fix posted by Philippe Biondi:
+++ b/mercurial/keepalive.py
@@ -237,6 +237,8 @@
  else:
  # no (working) free connections were found.  Create a
new one.
  h = http_class(host)
+if hasattr(req,_tunnel_host) and req._tunnel_host:
+h.set_tunnel(req._tunnel_host)
  if DEBUG: DEBUG.info(creating new connection to %s (%d),
   host, id(h))
  self._cm.add(host, h, 0)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1424152
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6324] in expression falls back to __iter__ before __getitem__

2009-06-22 Thread Raymond Hettinger

Changes by Raymond Hettinger rhettin...@users.sourceforge.net:


--
assignee: georg.brandl - rhettinger
nosy: +rhettinger

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6324
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6290] cPickle can misread data type

2009-06-22 Thread Alex James

Alex James ac.ja...@shaw.ca added the comment:

I have now pinpointed the error to a list of infinities (see attached).
When using pickle.py to read the cPickle'd data we get a different, and
more, informative error:
ValueError: invalid literal for float(): 1.#INF

--
Added file: http://bugs.python.org/file14336/cPicktest.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6290
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1298813] sysmodule.c: realpath() is unsafe

2009-06-22 Thread jan matejek

Changes by jan matejek jmate...@suse.cz:


--
nosy: +matejcik

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1298813
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Thanks for the test case.
It appears that 2.7 actually calls exec(execfile(filename)),
when 3.1 directly calls exec(file_content).

The indirection seems necessary: the SyntaxError is detected by the pdb 
trace function; but this function has to run somehow...
With the patch below, pdb now runs exec(exec(file_content)).

I'm not sure how to write unit tests for pdb.
I don't know if it will be accepted for 3.1 final.

Index: Lib/pdb.py
===
--- Lib/pdb.py  (revision 73505)
+++ Lib/pdb.py  (working copy)
@@ -1211,7 +1211,7 @@
 self.mainpyfile = self.canonic(filename)
 self._user_requested_quit = 0
 with open(filename) as fp:
-statement = fp.read()
+statement = exec(%r) % (fp.read(),)
 self.run(statement)

 # Simplified interface

--
keywords: +needs review, patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6323
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread nlopes

nlopes shelika.v...@gmail.com added the comment:

That fixes it.
It seems to be introduced when committing a fix for issue #1038.

-bash-3.2$ svn diff -r 58126:58127 Lib/pdb.py
Index: Lib/pdb.py
===
--- Lib/pdb.py  (revision 58126)
+++ Lib/pdb.py  (revision 58127)
@@ -1166,12 +1166,8 @@
 self._wait_for_mainpyfile = 1
 self.mainpyfile = self.canonic(filename)
 self._user_requested_quit = 0
-fp = open(filename)
-try:
-script = fp.read()
-finally:
-fp.close()
-statement = 'exec(%s)' % script
+with open(filename) as fp:
+statement = fp.read()
 self.run(statement)

 # Simplified interface

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6323
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6070] Python 2.6 makes .pyc/.pyo bytecode files executable

2009-06-22 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

The patch did not apply for me.  I modified the code by hand based on
the patch file, and on Gentoo linux it worked for me.  Patch that
applies cleanly to trunk attached.

--
nosy: +r.david.murray
priority:  - low
stage:  - test needed
versions: +Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14337/issue6070.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6070
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Good point.
So in the end, we just replaced
exec('%s')# wrong when the text is x='a'
with
exec(%r)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6323
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-06-22 Thread Senthil

Senthil orsent...@gmail.com added the comment:

AndrewTrick: I am assuming your last comment is more relevant to
mercurial's use of the set_tunnel, the facility provided by the patch,
that is solving the issue for you. You had earlier pointed out
mercurial's dependency upon this issue too.

The fix as such stands good and may not require any change. Is my
understanding OK?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1424152
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5230] pydoc reports misleading failure if target module raises an ImportError

2009-06-22 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

OK, I finally had time to come back to this, and figured out what I
think is a final fix.  It passes all the tests we've come up with, at
least.  Let me know if you see any problems with it, and if not I'll
apply it.

--
assignee:  - r.david.murray
versions: +Python 3.2 -Python 3.0
Added file: http://bugs.python.org/file14338/issue5230.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5230
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5230] pydoc reports misleading failure if target module raises an ImportError

2009-06-22 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


Removed file: http://bugs.python.org/file14205/issue5230.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5230
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6290] cPickle can misread data type

2009-06-22 Thread Alexandre Vassalotti

Alexandre Vassalotti alexan...@peadrop.com added the comment:

Thanks for the test case. I will take a look.

--
assignee: georg.brandl - alexandre.vassalotti
components: +Library (Lib) -Documentation, Extension Modules, Windows

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6290
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6290] cPickle can misread data type

2009-06-22 Thread Alexandre Vassalotti

Alexandre Vassalotti alexan...@peadrop.com added the comment:

Could you give me the output of this?

  import cPickle
  print repr(cPickle.dumps([float('+inf'), float('-inf'), float('nan')]))
  print [float('+inf'), float('-inf'), float('nan')]

By the way, are you sure this bug occurs on Python 2.6? Python 2.6 uses
a platform-independent float to string converter (i.e.,
PyOS_double_to_string) which shouldn't output stuff like 1.#INF

Also, can you verify that the bug does not occur with pickle protocol 1
and over?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6290
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-06-22 Thread Andrew Trick

Andrew Trick andrew.tr...@gmail.com added the comment:

I should have pointed out that my secondary problem was a mercurial
dependency on the urllib patch. I just wanted Mercurial users to get a
complete fix. I figure they will be looking for a fix in the python bug
report, and need to be told the fix won't work for them.

On Mon, Jun 22, 2009 at 5:11 PM, Senthil rep...@bugs.python.org wrote:


 Senthil orsent...@gmail.com added the comment:

 AndrewTrick: I am assuming your last comment is more relevant to
 mercurial's use of the set_tunnel, the facility provided by the patch,
 that is solving the issue for you. You had earlier pointed out
 mercurial's dependency upon this issue too.

 The fix as such stands good and may not require any change. Is my
 understanding OK?

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue1424152
 ___


--
Added file: http://bugs.python.org/file14339/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1424152
___I should have pointed out that my secondary problem was a mercurial dependency 
on the urllib patch. I just wanted Mercurial users to get a complete fix. I 
figure they will be looking for a fix in the python bug report, and need to be 
told the fix won#39;t work for them.br
brdiv class=gmail_quoteOn Mon, Jun 22, 2009 at 5:11 PM, Senthil span 
dir=ltrlt;a 
href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;/span 
wrote:brblockquote class=gmail_quote style=border-left: 1px solid 
rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;
br
Senthil lt;a href=mailto:orsent...@gmail.com;orsent...@gmail.com/agt; 
added the comment:br
br
AndrewTrick: I am assuming your last comment is more relevant tobr
mercurial#39;s use of the set_tunnel, the facility provided by the patch,br
that is solving the issue for you. You had earlier pointed outbr
mercurial#39;s dependency upon this issue too.br
br
The fix as such stands good and may not require any change. Is mybr
understanding OK?br
divdiv/divdiv class=h5br
--br
br
___br
Python tracker lt;a 
href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;br
lt;a href=http://bugs.python.org/issue1424152; 
target=_blankhttp://bugs.python.org/issue1424152/agt;br
___br
/div/div/blockquote/divbr
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6325] robotparser doesn't handle URL's with query strings

2009-06-22 Thread Brian Slesinsky

New submission from Brian Slesinsky br...@slesinsky.org:

If a robots.txt file contains a rule of the form:

  Disallow: /some/path?name=value

This pattern will never match a URL passed to can_fetch(), as far as I
can tell.

It's arguable whether this is a bug. The 1994 robots.txt protocol is
silent on whether to treat query strings specially and just says any
URL that starts with this value will not be retrieved. The 1997 draft
standard talks about the path portion of a URL but doesn't give any
examples about how to treat the '?' character in a robots.txt pattern.

Google extends the protocol to allow wildcard characters in a way that
doesn't treat the '?' character specially. See:
http://www.google.com/support/webmasters/bin/answer.py?answer=40360cbid=-1rdq1gi8f11xxsrc=cblev=answer#3

I'll leave aside whether to implement pattern matching, but it seems
like a good idea to do something reasonable when a robots.txt pattern
contains a literal '?', and treating it as a literal character seems
simplest.

Cause: in robotparser.can_fetch(), there is this code which seems to
take only the path (stripping the query string).

 url = urllib.quote(urlparse.urlparse(urllib.unquote(url))[2]) or /

Also, when parsing patterns in the robots.txt file, a '?' character
seems to be automatically URL-escaped. There's nothing in a standards
doc about doing this so I think that might be a bug too.

Tested with python 2.4. I looked at the code in Subversion head and it
doesn't look like there were any changes on the trunk.

--
components: Library (Lib)
messages: 89622
nosy: skybrian
severity: normal
status: open
title: robotparser doesn't handle URL's with query strings
type: behavior
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6325
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6233] ElementTree (py3k) doesn't properly encode characters that can't be represented in the specified encoding

2009-06-22 Thread Jerry Chen

Jerry Chen je...@3rdengine.com added the comment:

The attached patch includes Neil's original additions to test_xml_etree.py.


I also noticed that _encode_entity wasn't being called in ElementTree in
py3k, with the important bit being the nested function
escape_entities(), in conjunction with _escape and _escape_map.

In 2.x, _encode_entity() is used after _encode() throws Unicode
exceptions [1], so I figured it would make sense to take the core
functionality of _escape_entities() and integrate it into _encode in the
same fashion -- when an exception is thrown.

Basically, I:
- changed _escape regexp from using [\x0080-\u] to [\x80-xff]
- extracted _encode_entity.escape_entities() and made it
_escape_entities of module scope
- removed _encode_entity()
- added UnicodeEncodeError exception in _encode()

I'm not sure what the expected outcome is supposed to be when the text
is not type bytes but str. With this patch, the output has
bt#195;#163;t rather than bt#227;t.

Hope this is a step in the right direction.

[1] ElementTree.py:814, ElementTree.py:829, python 2.7 HEAD r50941

--
nosy: +jcsalterego
Added file: http://bugs.python.org/file14340/issue6233-escape_entities.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6233
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com