[issue10035] sgmllib fail to parse html containing

2010-10-06 Thread halfjuice

halfjuice  added the comment:

Sorry, the URL on the page is sort of broken. The URL contains the "" 
stuff.

I think you're right, the 

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



[issue10035] sgmllib fail to parse html containing

2010-10-06 Thread Georg Brandl

Georg Brandl  added the comment:

The browser needs to be very liberal in what it accepts, since nobody wants 
their page view to break because of such a technicality. This is different for 
a tool like SGMLParser.

In light of this, and because sgmllib is removed anyway in Python 3, I'm 
closing this.

--
status: open -> closed

___
Python tracker 

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



[issue9017] doctest option flag to enable/disable some chunk of doctests?

2010-10-06 Thread harobed

harobed  added the comment:

doctest.SKIP is like #doctest: +DISABLE but he don't have #doctest: +ENABLE 
feature.

doctest.SKIP disable all the bottom of test, DISABLE/ENABLE can SKIP only one 
part of test.

Regards,
Stephane

--

___
Python tracker 

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



[issue10032] os.setuid and os.setgid have unexpected influence on serial module

2010-10-06 Thread Tjeerd Pinkert

Tjeerd Pinkert  added the comment:

Indeed I use Linux, sorry for the inconvenience of not mentioning.

Thanks Ned, I think this is indeed the case. Using os.setgroups with a list of 
group ids (one for the file access, one for the serial port) before switching 
user with os.setgid, os.setuid solved the problem.
I think os.initgroups(username, gid) does just this, only is not yet available 
in my distro.

It could be a feature of os that the groups of the user are set on a os.setuid 
call? Or would this break compatibility with the standard unix library 
behaviour?

To David: Yes you are right, only it would have cost me quite a bit of time to 
strip the code, and I tried this code to see if the behaviour was consistent 
when using other daemon code. Next time I will post my own code.

--

___
Python tracker 

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



[issue10028] test_concurrent_futures fails on Windows Server 2003

2010-10-06 Thread Brian Quinlan

Changes by Brian Quinlan :


--
assignee:  -> bquinlan

___
Python tracker 

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



[issue9017] doctest option flag to enable/disable some chunk of doctests?

2010-10-06 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

I'm not a great doctest user, but did you try to disable the SKIP directive at 
the end? something like "doctest: -SKIP"

--

___
Python tracker 

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



[issue9017] doctest option flag to enable/disable some chunk of doctests?

2010-10-06 Thread Georg Brandl

Georg Brandl  added the comment:

AFAIR +SKIP always only refers to one Example anyway.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-06 Thread Douglas Leeder

Changes by Douglas Leeder :


--
nosy: +Douglas.Leeder

___
Python tracker 

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



[issue10028] test_concurrent_futures fails on Windows Server 2003

2010-10-06 Thread Brian Quinlan

Brian Quinlan  added the comment:

Hey Brian,

Could you try applying the patch that I attached and let me know what error 
message you get?

Cheers,
(the other) Brian

--
keywords: +patch
Added file: http://bugs.python.org/file19137/error.diff

___
Python tracker 

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



[issue9017] doctest option flag to enable/disable some chunk of doctests?

2010-10-06 Thread harobed

harobed  added the comment:

Ok, option +SKIP and -SKIP work well, look test.py file

I need maybe improve the documentation with an +SKIP and -SKIP example ?

Documentation section about SKIP option is here : 
http://docs.python.org/library/doctest.html?highlight=doctest.skip#doctest.SKIP

Regards,
Stephane

--
Added file: http://bugs.python.org/file19138/test.py

___
Python tracker 

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



[issue10037] multiprocessing.pool processes started by worker handler stops working

2010-10-06 Thread Ask Solem

New submission from Ask Solem :

While working on an "autoscaling" (yes, people call it that...) feature for 
Celery, I noticed that the processes created by the _handle_workers thread 
doesn't always work.  I have reproduced this in general, by just using the 
maxtasksperchild feature and letting the workers terminate themselves so this 
seems to have always been an issue (just not easy to reproduce unless workers 
are created with some frequency)

I'm not quite sure of the reason yet, but I finally managed to track it down to 
the workers being stuck while receiving from the queue.

The patch attached seems to resolve the issue by polling the queue before 
trying to receive.

I know this is short, I may have some more data later.

--
components: Library (Lib)
files: multiprocessing-worker-poll.patch
keywords: needs review, patch
messages: 118062
nosy: asksol
priority: critical
severity: normal
stage: patch review
status: open
title: multiprocessing.pool processes started by worker handler stops working
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file19139/multiprocessing-worker-poll.patch

___
Python tracker 

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



[issue9017] doctest option flag to enable/disable some chunk of doctests?

2010-10-06 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

harobed, the -SKIP solution does not work. Doctest directives only apply to a 
single line.

After a quick search, I found two workarounds there:
http://stackoverflow.com/questions/1809037/python-doctest-skip-entire-block
- Replace >>> with >>
or
- split the docstring, and add something like "__dont_test__ = " in front of 
the second part; the string becomes part of a statement and won't be parsed.

--

___
Python tracker 

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



[issue10027] os.lstat/os.stat don't set st_nlink on Windows

2010-10-06 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

There are some questions.

1. About my patch, I noticed it removed following code.
   Isn't this needed? I like clean code, but I don't want to
   break anything.

/* Get WIN32_FIND_DATA structure for the path to determine if
   it is a symlink */
if(info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
find_data_handle = FindFirstFileA(path, &find_data);
if(find_data_handle != INVALID_HANDLE_VALUE) {
if(find_data.dwReserved0 == IO_REPARSE_TAG_SYMLINK) {
/* first clear the S_IFMT bits */
result->st_mode ^= (result->st_mode & 017);
/* now set the bits that make this a symlink */
result->st_mode |= 012;
}
FindClose(find_data_handle);
}
}


/* Set S_IFEXEC if it is an .exe, .bat, ... */
dot = strrchr(path, '.');
if (dot) {
if (stricmp(dot, ".bat") == 0 || stricmp(dot, ".cmd") == 0 ||
stricmp(dot, ".exe") == 0 || stricmp(dot, ".com") == 0)
result->st_mode |= 0111;
}

2. About current behavior. when os.stat() is used for junction
   (reparse point, but not simlink), returned information is
   about junction on XP or earlier, but about target folder on
   Vista or above. Is this intended bahavior?

Thank you.

--

___
Python tracker 

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



[issue8359] % formating - TypeError: not all arguments converted during string formatting

2010-10-06 Thread amiadb

amiadb  added the comment:

This bug is very disturbing in Hebrew too.
I need to translate "% hour" to "‫% שעה‬" and its wrong in Hebrew. in Hebrew I 
need to write "שעה אחת" (one hour).

--
nosy: +amiadb

___
Python tracker 

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



[issue10027] os.lstat/os.stat don't set st_nlink on Windows

2010-10-06 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

P.S. Thank you for acceptance. I really wanted to commit
that code!

--

___
Python tracker 

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



[issue9325] Add an option to pdb/trace/profile to run library module as a script

2010-10-06 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue9903] test_concurrent_futures writes on stderr

2010-10-06 Thread Brian Quinlan

Brian Quinlan  added the comment:

Fixed in r85288

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-10-06 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

If nobody objects, I will commit this (with docs) soon. Then I will open a 
separate issue for the http.client / urllib.request integration, since the 
discussion is already quite long here.

--

___
Python tracker 

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



[issue10038] Returntype of json.loads() on strings

2010-10-06 Thread Nik Tautenhahn

New submission from Nik Tautenhahn :

Hi,

before 2.7, an
import json
json.loads('"abc"')

yielded u"abc".

in 2.7 I get
"abc" (a byte string).

I would have expected an entry in "news" or "What's new in 2.7" why this change 
happened. In addition, all examples at http://docs.python.org/library/json are 
wrong for Python 2.7  if json.loads is involved.

Any insight on this?

best regards,
Nik

--
assignee: d...@python
components: Documentation, Library (Lib)
messages: 118069
nosy: d...@python, llnik
priority: normal
severity: normal
status: open
title: Returntype of json.loads() on strings
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue10038] Returntype of json.loads() on strings

2010-10-06 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee: d...@python -> bob.ippolito
nosy: +bob.ippolito

___
Python tracker 

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



[issue10038] Returntype of json.loads() on strings

2010-10-06 Thread Fred L. Drake, Jr.

Fred L. Drake, Jr.  added the comment:

This is related to this issue from simplejson:
http://code.google.com/p/simplejson/issues/detail?id=28

This problem is why I still use simplejson 1.x; moving forward to simplejson 
2.x or Python's json is unlikely.

--
nosy: +fdrake

___
Python tracker 

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



[issue10038] Returntype of json.loads() on strings

2010-10-06 Thread Nik Tautenhahn

Nik Tautenhahn  added the comment:

Well, Ok, if I take bob's comment from the simplejson Issue, I can understand 
that some people want byte strings. But then I would like to have something 
like a "parse_str" hook, to enhance my json-Decoder or maybe a keyword argument 
for the default json-Decoder...

--

___
Python tracker 

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



[issue10032] os.setuid and os.setgid have unexpected influence on serial module

2010-10-06 Thread Ned Deily

Ned Deily  added the comment:

"It could be a feature of os that the groups of the user are set on a os.setuid 
call? Or would this break compatibility with the standard unix library 
behaviour?"

The POSIX system interface specification specifically prohibits that: "The 
setuid() function shall not affect the supplementary group list in any way."

http://www.opengroup.org/onlinepubs/009695399/functions/setuid.html

--

___
Python tracker 

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-10-06 Thread Mads Kiilerich

Mads Kiilerich  added the comment:

I'm sorry to make the discussion longer ...


>From a Python user/programmers point of view it would be nice if 
>http://docs.python.org/library/ssl.html also clarified what "validation" means 
>(apparently that the cert chain all the way from one of ca_certs is valid and 
>with valid dates, except that CRLs not are checked?). It could perhaps be 
>mentioned next to the ca_certs description. It would also be nice to see an 
>example with subjectAltName, both with DNS and IP entries.

Has it been tested that the way Python uses OpenSSL really checks both 
notBefore and notAfter?


Some comments to the patch. Some of them are just thoughts that can be ignored, 
but I think some of them are relevant.

_dnsname_to_pat:

AFAICS * shouldn't match the empty string. I would expect "fail(cert, 
'.a.com')".

I would prefer to fail to the safe side and only allow a left-most wildcard and 
thus not allow multiple or f* wildcards, just like 
draft-saintandre-tls-server-id-check-09 suggests.

I would prefer to not use re for such an important task where clarity and 
correctness is so important. If we only allow left-most wildcards it shouldn't 
be necessary.

match_hostname:

I don't understand "IP addresses are not accepted for hostname". I assume that 
if commonName specifies an IP address then a hostname with this address is 
valid. So isn't it more that "subjectAltName iPAddress isn't supported"? But 
wouldn't it be better and simpler to simply support iPAddress - either as the 
only check iff hostname "looks" like an IP address, alternatively in all cases 
check against both DNS and IP entries?

"dnsnames" doesn't say much about what it is. Perhaps "unmatched"?

"if san: ... else: ..." would perhaps be a bit clearer.

"doesn't match with either of (%s)" ... isn't the paranthesis around the list 
elements too pythonic for a message intended for end users?

Separate error messages for subjectAltName and commonName could be helpful.

I assume it should be "no appropriate _commonName_" to match "subjectAltName".

test:

cert for example.com is defined twice.


Finally:

How about unicode and/or IDN hostnames?

--

___
Python tracker 

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



[issue9163] test_gdb fails

2010-10-06 Thread Tom Morris

Tom Morris  added the comment:

Did this fix actually make the 2.7 release?  I just installed 2.7 on 64-bit 
Ubuntu and ran into the same problem.

python -c "import sysconfig; print sysconfig.get_config_vars()['PY_CFLAGS']"
-fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes 
-I. -IInclude -I./Include  -DPy_BUILD_CORE

Python 2.7 (r27:82500, Oct  6 2010, 12:53:54) 
[GCC 4.4.1] on linux2

uname -a
Linux tfmorris-laptop 2.6.31-22-generic #65-Ubuntu SMP Thu Sep 16 16:21:34 UTC 
2010 x86_64 GNU/Linux

--
nosy: +tfmorris

___
Python tracker 

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



[issue8028] self.terminate() from a multiprocessing.Process raises AttributeError exception

2010-10-06 Thread 5houston

5houston  added the comment:

Yes I could. You can find it attached.

--
Added file: http://bugs.python.org/file19140/minCrashing.py.bz2

___
Python tracker 

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-10-06 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> From a Python user/programmers point of view it would be nice if
> http://docs.python.org/library/ssl.html also clarified what
> "validation" means (apparently that the cert chain all the way from
> one of ca_certs is valid and with valid dates, except that CRLs not
> are checked?). It could perhaps be mentioned next to the ca_certs
> description. It would also be nice to see an example with
> subjectAltName, both with DNS and IP entries.

As mentioned in the patch, IP entries are not supported.
I'm planning to do a couple of doc updates as part of the commit, but
any doc suggestions should go in a separate issue IMO. This will make
things more manageable.

> Has it been tested that the way Python uses OpenSSL really checks both
> notBefore and notAfter?

I just checked and, yes, it does (but only if you specify CERT_OPTIONAL
or CERT_REQUIRED, of course).

> AFAICS * shouldn't match the empty string. I would expect "fail(cert,
> '.a.com')".

Good point.

> I would prefer to fail to the safe side and only allow a left-most
> wildcard and thus not allow multiple or f* wildcards, just like
> draft-saintandre-tls-server-id-check-09 suggests.

Well, RFC 2818 allows them, and I see no point in being stricter.

> I would prefer to not use re for such an important task where clarity
> and correctness is so important. If we only allow left-most wildcards
> it shouldn't be necessary.

I'm not convinced that manual parsing is really more readable than
regular expressions, and wildcards are a pretty obvious use case for
regular expressions. Perhaps it's a matter of habit.

> match_hostname:
> 
> I don't understand "IP addresses are not accepted for hostname". I
> assume that if commonName specifies an IP address then a hostname with
> this address is valid. So isn't it more that "subjectAltName iPAddress
> isn't supported"?

Indeed. But, strictly speaking, there are no tests for IPs, so it
shouldn't be taken for granted that it works, even for commonName.
The rationale is that there isn't really any point in using an IP rather
a host name.

> But wouldn't it be better and simpler to simply support iPAddress -
> either as the only check iff hostname "looks" like an IP address,
> alternatively in all cases check against both DNS and IP entries?

Well, that's additional logic to code. I'm not sure it's worth it,
especially given that the function is called match_hostname in the first
place.

> "doesn't match with either of (%s)" ... isn't the paranthesis around
> the list elements too pythonic for a message intended for end users?

Hmm, perhaps.

> Separate error messages for subjectAltName and commonName could be
> helpful.

That depends if you're an end user or an SSL expert, I guess. end users
don't know what subjectAltNames and commonNames are.

> I assume it should be "no appropriate _commonName_" to match
> "subjectAltName".

Ah, yes.

> cert for example.com is defined twice.

Right.

> How about unicode and/or IDN hostnames?

I haven't looked how these work in the context of certificate checking.
I would prefer to tackle that separately if needed, but someone can
provide a patch for this if they want.

--

___
Python tracker 

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



[issue9163] test_gdb fails

2010-10-06 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Did this fix actually make the 2.7 release?

Are you sure you posted to the right issue? I fail to see the
relationship between your message and the original report.

If you found a bug in Python 2.7, please report it as a
separate issue.

--

___
Python tracker 

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