[issue4089] linking python2.6.dll crash on windows xp

2008-10-09 Thread Manuel

New submission from Manuel <[EMAIL PROTECTED]>:

On some machines, the application (makehuman, an open source software)
crash, immediately, as soon the user try to double click on the exe. The
problem happen with the version compiled using python 2.6, while the one
compiled with 2.5 work fine.

We have asked to our users to try the installation of  Visual C++ 2005
Redistributable Package, but this hasn't fixed the crash.

Both binary files (compiled using gcc and debug symbols with 2.5 and
with 2.6) are here:

http://www.makehuman.org/tmp/makehuman_test_python25_and_python26.zip

Furthermore:

Installing full python2.6 it work.
Unistalling full python2.6 it don't work.
Installing python26 and deleting C:/python26 folder (without unistall
it), it work again...

thx,

Manuel

--
components: Windows
messages: 74582
nosy: Manuel
severity: normal
status: open
title: linking python2.6.dll crash on windows xp
type: crash
versions: Python 2.6

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



[issue4089] linking python2.6.dll crash on windows xp

2008-10-09 Thread Manuel

Manuel <[EMAIL PROTECTED]> added the comment:

gdb output from one of our users:


warning: LDR: LdrpWalkImportDescriptor() failed to probe python26.dll
for its manifest, ntstatus 0xc0150002


Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program exited with code 0305.
You can't do that without a process to debug.

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



[issue4089] linking python2.6.dll crash on windows xp

2008-10-10 Thread Manuel

Manuel <[EMAIL PROTECTED]> added the comment:

We have fixed the problem installing this:

http://www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en

Anyway, before consider the bug solved, we need to test this solution on
different computers.

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



[issue4089] linking python2.6.dll crash on windows xp

2008-10-10 Thread Manuel

Manuel <[EMAIL PROTECTED]> added the comment:

Yes. This bug can be closed.
The use of python26.dll require last Microsoft Visual C++ 2008
Redistributable Package.

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



[issue45523] Python3 ThreadingHTTPServer fails to send chunked encoded response

2021-10-19 Thread Manuel


New submission from Manuel :

I'm implementing an HTTPServer class that produces a response with 
transfer-encoding chunked mode.

I'm sending the chunks as described in 
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding#chunked_encoding

If I send chunks of length <= 9 bytes the message is received correctly by the 
client, otherwise when sending chunks of length >= 10 bytes, it seems that some 
of them are not received and the message remains stuck in the client waiting 
indefinitely

In attachment an example of the complete code to reproduce the issue, but in 
short, the following code:

# writing 5 chunks of length 10
for i in range(5):
text = str(i+1) * 10  # concatenate 10 chars
chunk = '{0:d}\r\n'.format(len(text)) + text + '\r\n'
self.wfile.write(chunk.encode(encoding='utf-8'))

# writing close sequence
close_chunk = '0\r\n\r\n'
self.wfile.write(close_chunk.encode(encoding='utf-8'))

Produces:
10\r\n
11\r\n
10\r\n
22\r\n
10\r\n
33\r\n
10\r\n
44\r\n
10\r\n
55\r\n
0\r\n
\r\n

In this case the client hangs several minutes without a response 

But if I use length 9 or less instead for example with

text = str(i+1) * 9

the client receives the correct body and the communication ends correctly (in 
about 6ms)

The problem persists with both http.server.ThreadingHTTPServer and 
http.server.HTTPServer
I tried also passing the body as an hard-coded binary string

some version informations:
Python 3.9.2
HTTP Client used: Postman 8.10, curl, Chrome


Thanks a lot for any help
Manuel

--
files: myserver.py
messages: 404300
nosy: manuel_b
priority: normal
severity: normal
status: open
title: Python3 ThreadingHTTPServer fails to send chunked encoded response
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file50369/myserver.py

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



[issue34321] mmap.mmap() should not necessarily clone the file descriptor

2018-08-02 Thread Manuel


New submission from Manuel :

mmap.mmap(fileno, length, flags, prot, access, offset) always clones the file 
descriptor that should be used [1].

The cloning of the file descriptor seems to be done to ensure that the file 
cannot be closed behind mmap's back, but if you are mmap()'ing a lot of memory 
regions of a file this can cause a 'Too many open files' error.

I would suggest to add an option to mmap.mmap() that tells it not to clone the 
file descriptor. This can cause an issue if the file is closed before accessing 
the mmapped region, so this fact should also be pointed out in the 
documentation.

[1] https://github.com/python/cpython/blob/master/Modules/mmapmodule.c#L1159

--
components: Library (Lib)
messages: 322953
nosy: manuels
priority: normal
severity: normal
status: open
title: mmap.mmap() should not necessarily clone the file descriptor
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

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



[issue46070] _PyImport_FixupExtensionObject() regression causing a crash in subintepreters

2021-12-30 Thread Manuel Reimer


Change by Manuel Reimer :


--
nosy: +M-Reimer

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



[issue13711] html.parser.HTMLParser doesn't parse tags in comments in scripts correctly

2012-01-04 Thread Manuel Bärenz

New submission from Manuel Bärenz :

I've attached a script which demonstrates the bug.

When feeding a 

[issue13711] html.parser.HTMLParser doesn't parse tags in comments in scripts correctly

2012-01-04 Thread Manuel Bärenz

Manuel Bärenz  added the comment:

I forgot to say, I'm using python version 3.2.2.

--

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



[issue13711] html.parser.HTMLParser doesn't parse tags in comments in scripts correctly

2012-01-04 Thread Manuel Bärenz

Manuel Bärenz  added the comment:

Oh, I wasn't aware of that.
Then, the bug is actually calling handle_endtag.

--

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



[issue13711] html.parser.HTMLParser doesn't parse tags in comments in scripts correctly

2012-01-04 Thread Manuel Bärenz

Manuel Bärenz  added the comment:

To clarify this even further: Consider
parser_instance.feed("<td></td>")

It should call:
parser_instance.handle_starttag("script", [])
parser_instance.handle_data("")
parser_instance.handle_endtag("script", [])

Instead, it calls:
parser_instance.handle_starttag("script", [])
parser_instance.handle_data("")
parser_instance.handle_endtag("td", [])
parser_instance.handle_endtag("script", [])

--

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



[issue13711] html.parser.HTMLParser doesn't parse tags in comments in scripts correctly

2012-01-04 Thread Manuel Bärenz

Manuel Bärenz  added the comment:

Great! Thank you!

--

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



[issue11982] json.loads() returns str instead of unicode for empty strings

2011-05-02 Thread Manuel Cerón

New submission from Manuel Cerón :

Python 2.7.1:

>>> import json
>>> json.loads('"hello"')
u'hello'
>>> .json.loads('""')
''

Related: issue 10038

--
components: Library (Lib)
messages: 135014
nosy: ceronman
priority: normal
severity: normal
status: open
title: json.loads() returns str instead of unicode for empty strings
type: behavior
versions: Python 2.7

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



[issue11146] Add a feature similar to C++ "using some_namespace"

2011-02-07 Thread Manuel Bärenz

New submission from Manuel Bärenz :

In C++, the the approach to the namespace problem is having different 
namespaces that should not contain different definitions of the same name.
Members of a namespace can be accessed explicitly by e.g. calling "std::cout << 
etc." or "using namespace std; cout << etc."

I understand Pythons approach to be "objects can be used as namespaces and 
their attributes are the names they contain". I find this a very beautiful way 
of solving the issue, but it has a downside, in my opinion, because it lacks 
the "using" directive from C++.

If the object is a module, we can of course do "from mymodule import spam, 
eggs". But if it is not a module, this does not work.

Consider for example:

class Spam(object):
def frobnicate(self):
self.eggs = self.buy_eggs()
self.scrambled = self.scramble(self.eggs)
return self.scrambled > 42

This could be easier to implement and read if we had something like:

class Spam(object):
def frobnicate(self):
using self:
eggs = buy_eggs()
scrambled = scramble(eggs)
return scrambled > 42

Of course this opens a lot of conceptual questions like how should this using 
block behave if self doesn't have an attribute called "eggs", but I think it is 
worth considering.

--
messages: 128153
nosy: turion
priority: normal
severity: normal
status: open
title: Add a feature similar to C++ "using some_namespace"
type: feature request

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



[issue2888] pprint produces different output in 2.6 and 3.0

2008-05-23 Thread Manuel Kaufmann

Manuel Kaufmann <[EMAIL PROTECTED]> added the comment:

If the correct way is the first option, we can use this 
patch to solve that error.

I attached diff file. I use Lib/test/test_pprint.py to 
ensure that's works.

--
keywords: +patch
nosy: +humitos
Added file: http://bugs.python.org/file10422/pprint.diff

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



[issue2888] pprint produces different output in 2.6 and 3.0

2008-05-29 Thread Manuel Kaufmann

Manuel Kaufmann <[EMAIL PROTECTED]> added the comment:

Documentation fix.

Added file: http://bugs.python.org/file10464/pprint.rst.diff

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



[issue2834] re.IGNORECASE not Unicode-ready

2008-06-01 Thread Manuel Kaufmann

Manuel Kaufmann <[EMAIL PROTECTED]> added the comment:

I have the same error with the re.LOCALE flag...

[humitos] [~]$ python3.0
Python 3.0a5+ (py3k:63855, Jun  1 2008, 13:05:09)
[GCC 4.1.3 20080114 (prerelease) (Debian 4.1.2-19)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> rx = re.compile('á', re.LOCALE | re.IGNORECASE)
>>> rx.match('Á')
>>> rx.match('á')
<_sre.SRE_Match object at 0x2b955e204d30>
>>> rx = re.compile('Á', re.IGNORECASE | re.LOCALE)
>>> rx.match('Á')
<_sre.SRE_Match object at 0x2b955e204e00>
>>> rx.match('á')
>>> 'Á'.lower() == 'á' and 'á'.upper() == 'Á'
True
>>>

--
nosy: +humitos

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



[issue3085] chapter 17.1.3.5 'Replacing os.popen*' in the Python library reference contains an error

2008-06-21 Thread Manuel Kaufmann

Manuel Kaufmann <[EMAIL PROTECTED]> added the comment:

I fixed this error, I attach the patch.

--
keywords: +patch
nosy: +humitos
Added file: http://bugs.python.org/file10681/libsubprocess.diff

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



[issue1044479] docs for Py_UNICODE are wrong

2008-06-21 Thread Manuel Muradás

Manuel Muradás <[EMAIL PROTECTED]> added the comment:

This looks fixed to me. The current documentation is much more clear.
Look:
http://docs.python.org/api/unicodeObjects.html

--
nosy: +dieresys

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



[issue1044479] docs for Py_UNICODE are wrong

2008-06-21 Thread Manuel Muradás

Manuel Muradás <[EMAIL PROTECTED]> added the comment:

This is the link to the current py_unicode documentation:
http://docs.python.org/dev/c-api/unicode.html

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



[issue449227] rlcompleter add "(" to callables feature

2008-06-21 Thread Manuel Muradás

Manuel Muradás <[EMAIL PROTECTED]> added the comment:

Here is a new patch against 2.6.

--
nosy: +dieresys
Added file: http://bugs.python.org/file10695/rlcompleter2.6.diff

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



[issue3085] chapter 17.1.3.5 'Replacing os.popen*' in the Python library reference contains an error

2008-06-22 Thread Manuel Kaufmann

Manuel Kaufmann <[EMAIL PROTECTED]> added the comment:

This bug was reported on Python 2.5 version and was applied on 2.6 
branch. That's correct?

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



[issue449227] rlcompleter add "(" to callables feature

2008-06-23 Thread Manuel Muradás

Manuel Muradás <[EMAIL PROTECTED]> added the comment:

I have also updated the rlcompleter documentation. Here is the complete
patch.
rlcompleterAndDoc2.6.diff

--
nosy: +facundobatista
Added file: http://bugs.python.org/file10714/rlcompleterAndDoc2.6.diff

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



[issue449227] rlcompleter add "(" to callables feature

2008-06-23 Thread Manuel Muradás

Changes by Manuel Muradás <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file10695/rlcompleter2.6.diff

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



[issue449227] rlcompleter add "(" to callables feature

2008-06-24 Thread Manuel Muradás

Manuel Muradás <[EMAIL PROTECTED]> added the comment:

Guilherme,
Thanks a lot for taking some time to review my patch.
Here is a new version.

Please take another look and tell me what do you think about it.
Thanks again

Added file: http://bugs.python.org/file10721/rlcompleter2.6.diff

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



[issue449227] rlcompleter add "(" to callables feature

2008-06-24 Thread Manuel Muradás

Changes by Manuel Muradás <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file10714/rlcompleterAndDoc2.6.diff

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



[issue3396] rlcompleter can't autocomplete members of callable objects

2008-07-17 Thread Manuel Muradás

Manuel Muradás <[EMAIL PROTECTED]> added the comment:

Oops, you are right. If that is the way we should handle this
regression, I could upload a patch. I also thought we could use
"hasattr", but that means using "getattr" twice. Something like:

if word[:n] == attr and word != "__builtins__" and hasattr(object, word):
val = getattr(object, word)

What do you think about it?

--
nosy: +dieresys

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2010-01-21 Thread Manuel Muradás

Manuel Muradás  added the comment:

Here is a patch for supporting MD5-sess, following RFC2617 specification.

Some comments/warnings:
 * I've only tested the patch against IIS 6.0. I don't know about other servers 
supporting MD5-sess.
 * IIS 6.0 expects the User Agent to send the URI (in the Authorization header) 
without the query string.
 * This patch doesn't add support for Digest sessions. For each request we 
make, we get a new [401|407] message with a new nonce (depending if we're 
talking about a proxy with digest authentication or a web server). Then we 
generate another authenticated request using that nonce. For Digest sessions to 
be fully supported, we should be adding an [WWW|Proxy]-Authenticate header in 
each following request we made to the server using the last nonce. This 
includes both MD5-sess and MD5 digest implementations.
 * A1 is being recalculated for every request. Given the above, this is not a 
real problem.

I'll open a new ticket regarding Digest sessions.

--
keywords: +patch
nosy: +dieresys
Added file: http://bugs.python.org/file15964/urllib2-support_md5-sess.diff

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



[issue7752] Add support for Digest authentication session (reuse nonces)

2010-01-21 Thread Manuel Muradás

New submission from Manuel Muradás :

Description:
As described in issue [2202], for each request we make, we get a new 
[401|407] message with a new nonce (depending if we're talking about a proxy 
with digest authentication or a web server). Then we generate another 
authenticated request using that nonce. For Digest authentication session to be 
fully supported, we should be adding a [WWW|Proxy]-Authenticate header in each 
following request we made to the server using the last nonce sent by the 
server. This will reduce the amount of requests performed, improving the 
performance.


How common browsers behaves:
Browsers implements authentication session by reusing the last nonce 
received from the web server for a given domain and Realm. When a request is 
made to a new URL from the same domain, the browsers doesn't know if that URL 
belongs to the same Realm. If the new URL is a sub-url of any other known URL 
on that Realm, the browsers add the Authorization header to new request. If 
they can't infer the Realm with this method, the Request is sent without the 
header. If the new URL do belongs to the Realm, the Browsers uses the nonce 
included in the response from the sever (with a 401 status code) to make new 
requests to URLs belonging to that Realm.
Regarding proxies with Digest authentication, browsers reuse the last nonce 
for every request made through the proxy.

For example:
URL1 redirects to URL2 and URL2 redirects to URL3:

Notes:
-> = request
<- = response
N  = nonce
C  = client nonce
NC = nonce count

---
[1]
URL1: http://domain/1/1.htm
URL2: http://domain/2/1.htm
URL3: http://domain/1/2.htm

-> GET URL1
<- 401 N1
-> GET URL1 N1 C1 NC1
<- 301 URL2
-> GET URL2
<- 401 N2
-> GET URL2 N2 C2 NC1
<- 301 URL3
-> GET URL3 N2 C2 NC2
<- 200

---
[2]
URL1: http://domain/1.htm
URL2: http://domain/1/1.htm
URL3: http://domain/2/1.htm

-> GET URL1
<- 401 N1
-> GET URL1 N1 C1 NC1
<- 301 URL2
-> GET URL2 N1 C1 NC2
<- 301 URL3
-> GET URL3 N1 C1 NC3
<- 200


About the patch:
I've added a 'http_request' to 'AbstractDigestAuthHandler' to add the 
'*-Authenticate' header before performing the requests.

There is a known problem with this patch: we generate a new 
AuthenticationSession against digest proxies when we are redirected to another 
page (with a 30X code), instead of re-using the previous session (first we send 
the redirected request without the authentication handler, we receive a new 407 
code, and then we send the redirected request again with the new authentication 
handler). This is caused because of the execution order of handlers:
- RedirectHandler generates a new request and calls to self.parent.open
- ProxyDigestAuthHandler tries to find an AuthenticationSession for that 
request but fails ('Request.get_host' returns the web server host)
- ProxyHandler modifies the request (now 'Request.get_host' returns the proxy 
host)

Comments are more than welcome!!

--
components: Library (Lib)
files: urllib2-support_digest_sessions.diff
keywords: patch
messages: 98120
nosy: dieresys
severity: normal
status: open
title: Add support for Digest authentication session (reuse nonces)
type: feature request
versions: Python 2.7
Added file: 
http://bugs.python.org/file15966/urllib2-support_digest_sessions.diff

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



[issue1781] ConfigParser: add_section('DEFAULT') causes duplicate sections.

2008-02-23 Thread Manuel Kaufmann

Manuel Kaufmann added the comment:

I tested the patch and works very well. I modified "Misc/NEWS" file 
beacuse the change wasn't reported and I uploaded diff file 
(NEWS.diff).

--
nosy: +humitos
Added file: http://bugs.python.org/file9492/NEWS.diff

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



[issue1746071] class mutex doesn't do anything atomically

2008-02-23 Thread Manuel Kaufmann

Manuel Kaufmann added the comment:

I tested the patch and I found an error. It was missing a line "if 
call:" in the unlock function. I added it, and tested again with the 
ex.py example and it didn't found any threads locked at the same time.

--
nosy: +humitos
Added file: http://bugs.python.org/file9505/mutex.diff

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



[issue2729] Link error in What's New in Python 2.6

2008-04-30 Thread Manuel Kaufmann

New submission from Manuel Kaufmann <[EMAIL PROTECTED]>:

I found a link error in section "What's New in Python 2.6" to Trac 
project.

I attach the patch file

--
assignee: georg.brandl
components: Documentation
files: patch.diff
keywords: patch
messages: 66028
nosy: georg.brandl, humitos
severity: normal
status: open
title: Link error in What's New in Python 2.6
versions: Python 2.6
Added file: http://bugs.python.org/file10148/patch.diff

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



[issue2757] Little error in unittest documentation

2008-05-04 Thread Manuel Kaufmann

New submission from Manuel Kaufmann <[EMAIL PROTECTED]>:

I found a more Enter

--
assignee: georg.brandl
components: Documentation
files: unittest.diff
keywords: patch
messages: 66214
nosy: georg.brandl, humitos
severity: normal
status: open
title: Little error in unittest documentation
versions: Python 2.6
Added file: http://bugs.python.org/file10192/unittest.diff

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



[issue5158] Document distutils 'depends' option for extensions

2009-02-05 Thread Manuel Balsera

New submission from Manuel Balsera :

Add a paragraph describing distuils depends option.

Its my first patch, let me know if I messed up formmating, etc.

--
components: Distutils
files: setupscript.diff
keywords: patch
messages: 81217
nosy: mbalsera
severity: normal
status: open
title: Document distutils 'depends' option for extensions
versions: Python 2.7, Python 3.1
Added file: http://bugs.python.org/file12946/setupscript.diff

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



[issue39390] shutil.copytree - ignore callback behaviour change

2020-01-19 Thread Manuel Barkhau


New submission from Manuel Barkhau :

In Python 3.8, the types of the parameters to the ignore callable appear to 
have changed.

Previously the `src` parameter was a string and the `names` parameter was a 
list of strings. Now the `src` parameter appears to be either a `pathlib.Path` 
or an `os.DirEntry`, while the `names` parameter is a set of strings.

I would suggest adding the following to the documentation 
https://github.com/python/cpython/blob/master/Doc/library/shutil.rst

   .. versionchanged:: 3.8
  The types of arguments to *ignore* have changed. The first argument 
  (the directory being visited) is a func:`os.DirEntry` or a 
  func:`pathlib.Path`; Previously it was a string. The second argument is
  a set of strings; previously it was a list of strings.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 360271
nosy: docs@python, mbarkhau
priority: normal
severity: normal
status: open
title: shutil.copytree - ignore callback behaviour change
type: behavior
versions: Python 3.8, Python 3.9

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



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-19 Thread Manuel Barkhau


Change by Manuel Barkhau :


--
title: shutil.copytree - ignore callback behaviour change -> shutil.copytree - 
3.8 changed argument types of the ignore callback

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



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-19 Thread Manuel Barkhau


Change by Manuel Barkhau :


--
keywords: +patch
pull_requests: +17462
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18069

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



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-20 Thread Manuel Barkhau


Manuel Barkhau  added the comment:

> This looks like a backward incompatible change in 3.8.

Indeed. 

> Should not copytree convert arguments of the ignore callback to str and list 
> correspondingly?

Well, since any existing code probably expects that behavior (or at least 
probably works if that is the case), I would be for such a change. I'm not sure 
what your policy is though. If there is recently written code that assumes the 
new types, are you OK with that breaking if it is changed back?

I guess since it's an undocumented breaking change, it shouldn't be too much of 
an issue.

--

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



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-21 Thread Manuel Barkhau


Manuel Barkhau  added the comment:

Is there anything I can do to help move this forward?

--

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



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-21 Thread Manuel Barkhau


Manuel Barkhau  added the comment:

Unless somebody else wants to, I could have a go at an PR to update shutil.py

--

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



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-22 Thread Manuel Barkhau


Change by Manuel Barkhau :


--
pull_requests: +17509
pull_request: https://github.com/python/cpython/pull/18122

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



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-24 Thread Manuel Barkhau


Change by Manuel Barkhau :


--
pull_requests: +17554
pull_request: https://github.com/python/cpython/pull/18168

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



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-24 Thread Manuel Barkhau


Manuel Barkhau  added the comment:

> For completeness, a similar problem is present also on python < 3.8

Fair point. I'll have a look.

--

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



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-24 Thread Manuel Barkhau


Manuel Barkhau  added the comment:

> If you pass a string, you will get a string, so existing code will continue 
> to work as before.

Somebody might have code that is running against a flat directory and have 
written their ignore function expecting to get a pathlib.Path, because that's 
the only case they encountered. This change would break their code and so would 
an upgrade to 3.9 with the patch that was just merged.

--

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



[issue40457] Python fails to compile/load _ssl module if OpenSSL is compiled with no-tls1-method

2020-05-31 Thread Manuel Jacob

Manuel Jacob  added the comment:

For the record, I’ve added a comment to the pull request about that 
ssl.PROTOCOL_TLSv1_1 / ssl.PROTOCOL_TLSv1_2 are now defined unconditionally.

https://github.com/python/cpython/commit/6e8cda91d92da72800d891b2fc2073ecbc134d98#r39569316

--
nosy: +mjacob

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



[issue40868] io.TextIOBase.buffer is not necessarily a buffer

2020-06-04 Thread Manuel Jacob


New submission from Manuel Jacob :

https://docs.python.org/dev/library/io.html#io.TextIOBase.buffer says:

"The underlying binary buffer (a BufferedIOBase instance) that TextIOBase deals 
with. This is not part of the TextIOBase API and may not exist in some 
implementations."

It is not necessarily a buffer (a BufferedIOBase instance), e.g. when the 
stdout and stderr streams are set to be unbuffered. Example:

% python -u
Python 3.8.3 (default, May 17 2020, 18:15:42) 
[GCC 10.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import io, sys
>>> sys.stdout
<_io.TextIOWrapper name='' mode='w' encoding='utf-8'>
>>> isinstance(sys.stdout, io.TextIOBase)
True
>>> sys.stdout.buffer
<_io.FileIO name='' mode='wb' closefd=False>
>>> isinstance(sys.stdout.buffer, io.BufferedIOBase)
False

Therefore the name and the documentation are incorrect.

I suggest to deprecate the attribute "buffer", introduce a new attribute with a 
correct name, and forward the old attribute to the new attribute and vice versa 
in the io.TextIOBase class.

I think that "binary" would be a good attribute name for the underlying binary 
stream, as it would be consistent with io.BufferedIOBase.raw (for "the 
underlying raw stream").

--
assignee: docs@python
components: Documentation, IO
messages: 370744
nosy: docs@python, mjacob
priority: normal
severity: normal
status: open
title: io.TextIOBase.buffer is not necessarily a buffer

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



[issue39229] library/functions.rst causes translated builds to fail

2020-06-14 Thread Manuel Kaufmann

Manuel Kaufmann  added the comment:

We are having a similar issue in python-docs-es translation.


cpython/Doc/library/ctypes.rst:: WARNING: inconsistent term references in 
translated message. original: [], translated: [':ref:`evento de auditoría 
`']

https://travis-ci.org/github/python/python-docs-es/builds/698122676


Note that the WARNING does not mention a line number in the RST file. From what 
I could find, this is because the source English sentence is not in the .rst 
file, but it's a RST directive and the sentence comes from Python code: 
https://github.com/python/cpython/blob/6f8c8320e9eac9bc7a7f653b43506e75916ce8e8/Doc/tools/extensions/pyspecific.py#L135-L139

The original RST file, uses the directive here: 
https://github.com/python/cpython/blob/6f8c8320e9eac9bc7a7f653b43506e75916ce8e8/Doc/library/ctypes.rst#L1510


The PO file we are translating, does not have a header with line numbers for 
this paragraph: 
https://github.com/python/python-docs-es/blob/c51c38134ba74e26f73732ed96584325536141d3/library/ctypes.po#L1456-L1459

--
nosy: +humitos

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



[issue40983] Can’t configure encoding used by urllib.request.url2pathname()

2020-06-15 Thread Manuel Jacob

New submission from Manuel Jacob :

On Python 2, it was possible to recover a percent-encoded byte:
>>> from urllib import url2pathname
>>> url2pathname('%ff')
'\xff'

On Python 3, the byte is decoded using the utf-8 encoding and the "replace" 
error handler (therefore there’s no way to recover the byte):
>>> from urllib.request import url2pathname
>>> url2pathname('%ff')
'�'

For my use case (getting the pathname as bytes), it would be sufficient to 
specify a different encoding (e.g. latin-1) or a different error handler (e.g. 
surrogateescape) that makes it possible to recover the byte by encoding the 
result of url2pathname() such that it roundtrips with the encoding and error 
handler internally used by url2pathname() for percent-encoded bytes.

I’m not simply sending a patch, because this might point to a deeper issue. 
Suppose there’s the following script:

import sys
from pathlib import Path
from urllib.request import urlopen
path = Path(sys.argv[1])
path.write_text('Hello, World!')
with urlopen(path.as_uri()) as resp:
print(resp.read())

If I call this script with b'/tmp/\xff' as the argument, it fails with the 
following traceback:

Traceback (most recent call last):
  File "/usr/lib/python3.8/urllib/request.py", line 1507, in open_local_file
stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/�'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test_url2pathname.py", line 6, in 
with urlopen(path.as_uri()) as resp:
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 1485, in file_open
return self.open_local_file(req)
  File "/usr/lib/python3.8/urllib/request.py", line 1524, in open_local_file
raise URLError(exp)
urllib.error.URLError: 

So maybe urllib.request.url2pathname() should use the same encoding and error 
handler as os.fsencode() / os.fsdecode().

--
components: Library (Lib)
messages: 371537
nosy: mjacob
priority: normal
severity: normal
status: open
title: Can’t configure encoding used by urllib.request.url2pathname()

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



[issue40983] urllib.request.url2pathname() unconditionally uses utf-8 encoding and "replace" error handler

2020-06-16 Thread Manuel Jacob

Change by Manuel Jacob :


--
title: Can’t configure encoding used by urllib.request.url2pathname() -> 
urllib.request.url2pathname() unconditionally uses utf-8 encoding and "replace" 
error handler

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



[issue40996] urllib should fsdecode percent-encoded parts of file URIs on Unix

2020-06-16 Thread Manuel Jacob

New submission from Manuel Jacob :

On Unix, file names are bytes. Python mostly prefers to use unicode for file 
names. On the Python <-> system boundary, os.fsencode() / os.fsdecode() are 
used.

In URIs, bytes can be percent-encoded. On Unix, most applications pass the 
percent-decoded bytes in file URIs to the file system unchanged. The remainder 
of this issue description is about Unix, except for the last paragraph.

Pathlib fsencodes the path when making a file URI, roundtripping the bytes e.g. 
passed as an argument:
% python3 -c 'import pathlib, sys; print(pathlib.Path(sys.argv[1]).as_uri())' 
/tmp/a$(echo -e '\xE4')
file:///tmp/a%E4

Example with curl using this URL:
% echo 'Hello, World!' > /tmp/a$(echo -e '\xE4')
% curl file:///tmp/a%E4
Hello, World!

Python 2’s urllib works the same:
% python2 -c 'from urllib import urlopen; 
print(repr(urlopen("file:///tmp/a%E4").read()))'
'Hello, World!\n'

However, Python 3’s urllib fails:
% python3 -c 'from urllib.request import urlopen; 
print(repr(urlopen("file:///tmp/a%E4").read()))' 
Traceback (most recent call last):
  File "/usr/lib/python3.8/urllib/request.py", line 1507, in open_local_file
stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/a�'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 1485, in file_open
return self.open_local_file(req)
  File "/usr/lib/python3.8/urllib/request.py", line 1524, in open_local_file
raise URLError(exp)
urllib.error.URLError: 

urllib.request.url2pathname() is the function converting the path of the file 
URI to a file name. On Unix, it uses urllib.parse.unquote() with the default 
settings (UTF-8 encoding and the "replace" error handler).

I think that on Unix, the settings from os.fsdecode() should be used, so that 
it roundtrips with pathlib.Path.as_uri() and so that the percent-decoded bytes 
are passed to the file system as-is.

On Windows, I couldn’t do experiments, but using UTF-8 seems like the right 
thing (according to https://en.wikipedia.org/wiki/File_URI_scheme#Windows_2). 
I’m not sure that the "replace" error handler is a good idea. I prefer "errors 
should never pass silently" from the Zen of Python, but I don’t a have a strong 
opinion on this.

--
components: Library (Lib), Unicode
messages: 371702
nosy: ezio.melotti, mjacob, vstinner
priority: normal
severity: normal
status: open
title: urllib should fsdecode percent-encoded parts of file URIs on Unix
type: behavior

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



[issue40983] urllib.request.url2pathname() unconditionally uses utf-8 encoding and "replace" error handler

2020-06-16 Thread Manuel Jacob

Manuel Jacob  added the comment:

I’ve created issue40996, which suggests that urllib should fsdecode 
percent-encoded parts of file URIs on Unix. Since the two tickets are very 
related and I’d prefer if the issue was solved more generally for the whole 
module, I close this as a duplicate.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

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



[issue17110] sys.argv docs should explaining how to handle encoding issues

2020-06-17 Thread Manuel Jacob


Manuel Jacob  added the comment:

The actual startup code uses Py_DecodeLocale() for converting argv from bytes 
to unicode. Since which Python version is it guaranteed that Py_DecodeLocale() 
and os.fsencode() roundtrip?

--
nosy: +mjacob

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



[issue41012] Some code comments refer to removed initfsencoding()

2020-06-17 Thread Manuel Jacob


New submission from Manuel Jacob :

Some code comments refer to initfsencoding(), which was however removed after 
Python 3.7.

--
messages: 371779
nosy: mjacob
priority: normal
severity: normal
status: open
title: Some code comments refer to removed initfsencoding()

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



[issue17110] sys.argv docs should explaining how to handle encoding issues

2020-06-18 Thread Manuel Jacob


Manuel Jacob  added the comment:

If the encoding supports it, since which Python version do Py_DecodeLocale() 
and os.fsencode() roundtrip?

The background of my question is that Mercurial goes some extra rounds to 
determine the correct encoding to emulate what Py_EncodeLocale() would do: 
https://www.mercurial-scm.org/repo/hg/file/5.4.1/mercurial/pycompat.py#l157 . 
If os.fsencode() could be used, it would simplify the code. Mercurial supports 
Python 3.5+.

--

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



[issue41051] Flush file after warning is written

2020-06-20 Thread Manuel Jacob

New submission from Manuel Jacob :

Calling warnings.warn() will write to a file, but not flush it. On Python 3.9+, 
it won’t usually be a problem because the file is most likely stderr, which is 
always line-buffered. However, on older Python versions or if a different file 
is used, the current behavior unnecessarily delays the output of the warning. 
This is especially problematic if the warning is about buffering behavior 
itself, as e.g. caused by `open('/tmp/test', 'wb', buffering=1)`.

--
messages: 371934
nosy: mjacob
priority: normal
severity: normal
status: open
title: Flush file after warning is written

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



[issue41051] Flush file after warning is written

2020-06-20 Thread Manuel Jacob


Change by Manuel Jacob :


--
keywords: +patch
pull_requests: +20175
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21000

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



[issue41091] Remove recommendation in curses module documentation to initialize LC_ALL and encode strings

2020-06-23 Thread Manuel Jacob

New submission from Manuel Jacob :

The documentation for the curses module 
(https://docs.python.org/3.9/library/curses.html) has the following note:

> Since version 5.4, the ncurses library decides how to interpret non-ASCII 
> data using the nl_langinfo function. That means that you have to call 
> locale.setlocale() in the application and encode Unicode strings using one of 
> the system’s available encodings. This example uses the system’s default 
> encoding:
> 
> import locale
> locale.setlocale(locale.LC_ALL, '')
> code = locale.getpreferredencoding()
> 
> Then use code as the encoding for str.encode() calls.

The recommendation to call `locale.setlocale(locale.LC_ALL, '')` is problematic 
as it initializes all locale categories to the user settings, which might be 
unintended and is not necessary for curses to work correctly. Initializing 
LC_CTYPE is sufficient for nl_langinfo() to return the correct encoding. 
Current versions of Python (*) initialize LC_CTYPE at interpreter startup. 
Therefore calling locale.setlocale() should not be necessary at all.

The curses module automatically encodes strings. Therefore the recommendation 
to manually encode strings is outdated.

(*) It seems to be the case since 177d921c8c03d30daa32994362023f777624b10d. Why 
was is not previously done on Python 2 and on Python 3 on Windows?

--
assignee: docs@python
components: Documentation
messages: 372178
nosy: docs@python, mjacob
priority: normal
severity: normal
status: open
title: Remove recommendation in curses module documentation to initialize 
LC_ALL and encode strings

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



[issue41091] Remove recommendation in curses module documentation to initialize LC_ALL and encode strings

2020-06-25 Thread Manuel Jacob


Change by Manuel Jacob :


--
keywords: +patch
pull_requests: +20319
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21159

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



[issue41221] Output of print() might get truncated in unbuffered mode

2020-07-06 Thread Manuel Jacob

New submission from Manuel Jacob :

Without unbuffered mode, it works as expected:

% python -c "import sys; sys.stdout.write('x'*4294967296)" | wc -c
4294967296

% python -c "import sys; print('x'*4294967296)" | wc -c 
4294967297

With unbuffered mode, writes get truncated to 2147479552 bytes on my Linux 
machine:

% python -u -c "import sys; sys.stdout.write('x'*4294967296)" | wc -c   
2147479552

% python -u -c "import sys; print('x'*4294967296)" | wc -c 
2147479553

I didn’t try, but it’s probably an even bigger problem on Windows, where writes 
might be limited to 32767 bytes: 
https://github.com/python/cpython/blob/v3.9.0b4/Python/fileutils.c#L1585

Without unbuffered mode, `sys.stdout.buffer` is a `io.BufferedWriter` object.

% python -c 'import sys; print(sys.stdout.buffer)'
<_io.BufferedWriter name=''>

With unbuffered mode, `sys.stdout.buffer` is a `io.FileIO` object.

% python -u -c 'import sys; print(sys.stdout.buffer)' 
<_io.FileIO name='' mode='wb' closefd=False>

`io.BufferedWriter` implements the `io.BufferedIOBase` interface. 
`io.BufferedIOBase.write()` is documented to write all passed bytes. 
`io.FileIO` implements the `io.RawIOBase` interface. `io.RawIOBase.write()` is 
documented to be able to write less bytes than passed.

`io.TextIOWrapper.write()` is not documented to write all characters it has 
been passed, but e.g. `print()` relies on that.

To fix the problem, it has to be ensured that either
* `sys.stdout.buffer` is an object that guarantees that all bytes passed to its 
`write()` method are written (e.g. deriving from `io.BufferedIOBase`), or
* `io.TextIOWrapper` calls the `write()` method of its underlying binary stream 
until all bytes have been written, or
* users of `io.TextIOWrapper` call `write()` until all characters have been 
written.

In the first two possibilities it probably makes sense to tighten the contract 
of `io.TextIOBase.write` to guarantee that all passed characters are written.

--
components: IO
messages: 373151
nosy: mjacob
priority: normal
severity: normal
status: open
title: Output of print() might get truncated in unbuffered mode
type: behavior
versions: Python 3.8

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



[issue41221] Output of print() might get truncated in unbuffered mode

2020-07-06 Thread Manuel Jacob

Manuel Jacob  added the comment:

2147479552 is the 0x7000 bytes limit documented for write() on Linux 
(source: https://man7.org/linux/man-pages/man2/write.2.html). The limit could 
be even smaller in other circumstances or other systems.

I’m adding Victor Stinner to the nosy list, as he added the code limiting 
writes to the console on Windows in e0daff1c61e323d2a39dd8241de67082d1f10fd7, 
and he might have an opinion on the topic.

--
nosy: +vstinner

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



[issue41221] Output of print() might get truncated in unbuffered mode

2020-07-06 Thread Manuel Jacob


Manuel Jacob  added the comment:

`io.TextIOWrapper.write()` returns the length of the passed string instead of 
the actually written number of characters.

% python -u -c "import sys; print(sys.stdout.write('x'*4294967296), 
file=sys.stderr)" | wc -c 
4294967296
2147479552

So the possibility "users of `io.TextIOWrapper` call `write()` until all 
characters have been written" would not be sufficient.

--

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



[issue41221] Output of print() might get truncated in unbuffered mode

2020-07-06 Thread Manuel Jacob

Manuel Jacob  added the comment:

It’s possible to trigger the problem on Unix with much smaller sizes, e.g. by 
interrupting the write() with a signal handler (even if the signal handler 
doesn’t do anything). The following script starts a subprocess doing a 16MiB 
write and sends a signal, which is handled but is a no-op, after reading a bit 
from the pipe:

import signal
import subprocess
import sys

CHILD_PROCESS = '''
import signal, sys
signal.signal(signal.SIGINT, lambda *x: None)
written = sys.stdout.write('x' * 16777216)
print('written:', written, file=sys.stderr, flush=True)
'''

proc = subprocess.Popen(
[sys.executable, '-u', '-c', CHILD_PROCESS],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
read = len(proc.stdout.read(1))
proc.send_signal(signal.SIGINT)
read += len(proc.stdout.read())
stdout, stderr = proc.communicate()
assert stdout == b''
print('stderr:', stderr)
assert read == 16777216, "read: {}".format(read)


% python3 test_interrupted_write.py
stderr: b'written: 16777216\n'
Traceback (most recent call last):
  File "test_interrupted_write.py", line 24, in 
assert read == 16777216, "read: {}".format(read)
AssertionError: read: 69632

If I remove the '-u' that gets passed to the subprocess:

% python3 test_interrupted_write.py
stderr: b'written: 16777216\n'

--

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



[issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory

2020-08-26 Thread Manuel Barkhau


Change by Manuel Barkhau :


--
nosy: +mbarkhau
nosy_count: 6.0 -> 7.0
pull_requests: +21079
pull_request: https://github.com/python/cpython/pull/21971

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



[issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory

2020-08-26 Thread Manuel Barkhau


Manuel Barkhau  added the comment:

This issue cropped up recently in the black project: 
https://github.com/psf/black/issues/1631

It appears to me that PR 7666 was closed without being merged.

I created https://github.com/python/cpython/pull/21971 before I had found this 
issue.

--
versions: +Python 3.10, Python 3.9

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-09-08 Thread Manuel Jacob

Manuel Jacob  added the comment:

I couldn’t reproduce the problem with a freshly compiled Python 3.9.0rc1 on 
Arch Linux. Was this ever reproduced on a non-Red Hat system?

--
nosy: +mjacob

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-09-08 Thread Manuel Jacob


Manuel Jacob  added the comment:

I was running "make all" and I also ran the documentation generator command 
without an error.

However, I tried it again and now it failed the same way as reported. With a 
debug build, I get "Python/Python-ast.c:231: get_ast_state: Assertion `state != 
NULL' failed.".

Sorry for the noise!

--

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



[issue31113] Stack overflow with large program

2017-08-03 Thread Manuel Krebber

New submission from Manuel Krebber:

With a pattern matching library I am generating some Python code that matches 
patterns. For a very big pattern set I generate a Python file which is about 
20MB and has ~300K LOC. When I try to execute the file with Python 3.6.2 on 
Windows 10 (64bit), the interpreter crashes. I do not have the Python source 
locally, but I could get it if necessary. The crash is because of a stack 
overflow when calling dfs() in compile.c. I can attach you the program, but it 
needs some dependencies which currently are only availiable via some Github 
repos.

I will try to split the ig file into multiple smaller ones, but I thought you 
might want to know about an interpreter crash.

--
components: Interpreter Core, Windows
messages: 299689
nosy: Wheerd, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Stack overflow with large program
type: crash
versions: Python 3.6

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



[issue31113] Stack overflow with large program

2017-08-03 Thread Manuel Krebber

Manuel Krebber added the comment:

1) Yes.
2) A .pyc file was not generated.
3) It is always the same location where the error occurs.
4) It did not crash on the linux machine that I tested it on.

I have tried to split the code up into multiple files, but it still crashes. I 
have uploaded the file to http://wheerd.de/generated.zip
If you want I can also provide the code with multiple files.

--

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



[issue31113] Stack overflow with large program

2017-08-04 Thread Manuel Krebber

Manuel Krebber added the comment:

I have already tried to reduce the nesting, but it still crashes. I have to 
admit that ~20 levels of nesting are still quite a lot. But I am surprised that 
so few levels of nesting already are a problem for the parser... I have 
attached the generated code with reduced nesting.

--
Added file: http://bugs.python.org/file47058/generated.zip

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



[issue31113] Stack overflow with large program

2017-08-06 Thread Manuel Krebber

Manuel Krebber added the comment:

@Serhiy That would require me to compile Python myself though, right? Is there 
a reason why the limit is only for try/for and not for if?

@Antoine Well, the goal is to be able to generate Python 2 compatible code . I 
will try to split the code into more functions and see if that helps...

--

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



[issue29830] pyexpat.errors doesn't have __spec__ and __loader__ set

2017-03-16 Thread Manuel Jacob

New submission from Manuel Jacob:

The same applies to pyexpat.model.

It seems like pyexpat is the only builtin module which has submodules (errors, 
model).

Normally, as I understand it, the module gets imported given a spec and the 
import machinery ensures that this spec ends up in the __spec__ attribute of 
the module.  But in this case only pyexpat gets imported by importlib.  The 
submodules are added when initializing the module.

Also, importlib's BuiltinImporter assumes that a builtin module is never a 
package.  Is this reasonable in this case?

--
messages: 289737
nosy: mjacob
priority: normal
severity: normal
status: open
title: pyexpat.errors doesn't have __spec__ and __loader__ set

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



[issue29830] pyexpat.errors doesn't have __spec__ and __loader__ set

2017-03-17 Thread Manuel Jacob

Manuel Jacob added the comment:

You're of course right that pyexpat is an extension module and not a builtin 
module.  I was confused because on PyPy it's a builtin module.

But the same question applies for ExtensionFileLoader.is_package().  It returns 
False in the case of pyexpat.  This function looks a bit strange to me anyway.  
It assumes the definition of what a package is for pure Python modules and 
applies it to extension modules.

--

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



[issue29446] Improve tkinter 'import *' situation

2019-02-24 Thread Manuel Cerón

Change by Manuel Cerón :


--
nosy: +ceronman

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



[issue25026] (FreeBSD/OSX) Fix fcntl module to accept 'unsigned long' type commands for ioctl(2).

2019-02-24 Thread Manuel Cerón

Change by Manuel Cerón :


--
nosy: +ceronman

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



[issue18299] Change script_helper to use universal_newlines=True in _assert_python

2019-02-24 Thread Manuel Cerón

Change by Manuel Cerón :


--
nosy: +ceronman

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



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2019-02-24 Thread Manuel Cerón

Change by Manuel Cerón :


--
nosy: +ceronman

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



[issue35360] Update SQLite to 3.26 in Windows and macOS installer builds

2019-02-27 Thread Manuel Cerón

Change by Manuel Cerón :


--
nosy: +ceronman

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



[issue23864] issubclass without registration only works for "one-trick pony" collections ABCs.

2019-02-27 Thread Manuel Cerón

Change by Manuel Cerón :


--
nosy: +ceronman

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



[issue25737] array is not a Sequence

2019-02-27 Thread Manuel Cerón

Change by Manuel Cerón :


--
nosy: +ceronman

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



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2019-03-04 Thread Manuel Cerón

Change by Manuel Cerón :


--
nosy:  -ceronman

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



[issue5831] Doc mistake : threading.Timer is *not* a class

2009-09-04 Thread Manuel Kaufmann

Manuel Kaufmann  added the comment:

I deleted this function and I renamed the class _Timer to Timer. I
attached the patch

--
keywords: +patch
nosy: +humitos
Added file: http://bugs.python.org/file14831/threading.Issue.5831.patch

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



[issue7570] Error in urllib2 example

2009-12-23 Thread Manuel Muradás

New submission from Manuel Muradás :

We've found an error in an urllib2 example with Proxy Basic
authentication. This is the example with the error:
{{{
This example replaces the default ProxyHandler with one that uses
programmatically-supplied proxy URLs, and adds proxy authorization
support with ProxyBasicAuthHandler.

proxy_handler = urllib2.ProxyHandler({'http':
'http://www.example.com:3128/'})
proxy_auth_handler = urllib2.HTTPBasicAuthHandler()
proxy_auth_handler.add_password('realm', 'host', 'username', 'password')

opener = build_opener(proxy_handler, proxy_auth_handler)
# This time, rather than install the OpenerDirector, we use it directly:
opener.open('http://www.example.com/login.html')
}}}

Attached you will find a patch with the fix.

--
assignee: georg.brandl
components: Documentation
files: urllib2.patch
keywords: patch
messages: 96843
nosy: dieresys, georg.brandl
severity: normal
status: open
title: Error in urllib2 example
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file15668/urllib2.patch

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



[issue7291] urllib2 cannot handle https with proxy requiring auth

2009-12-23 Thread Manuel Muradás

Manuel Muradás  added the comment:

Hi! 2.6 backport is missing an argument in _set_tunnel definition. It
should be:

def _set_tunnel(self, host, port=None, headers=None):

--
nosy: +dieresys

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



[issue7291] urllib2 cannot handle https with proxy requiring auth

2009-12-23 Thread Manuel Muradás

Manuel Muradás  added the comment:

The patch fixes only when you pass the authentication info in the proxy
handler's URL. Like:

proxy_handler = urllib2.ProxyHandler({'https':
'http://user:p...@proxy-example.com:3128/'})

But setting the authentication using a ProxyBasicAuthHandler is still
broken:

proxy_auth_handler = urllib2.ProxyBasicAuthHandler()
proxy_auth_handler.add_password('realm', 'proxy-example.com:3128',
'user', 'pass')

In the attached file (urllib2_with_proxy_auth_comparison.py) we've wrote
a comparison between what works with HTTP and HTTPS.

The problem is the 407 error never reaches the ProxyBasicAuthHandler
because HTTPConnection._tunnel raises an exception when the http
response status code is not 200.

--
Added file: 
http://bugs.python.org/file15669/urllib2_with_proxy_auth_comparison.py

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



[issue5421] Irritating error message by socket's sendto method

2009-03-05 Thread Manuel Hermann

New submission from Manuel Hermann :

When sending unexpected data via a socket's sentdo method, a TypeError
is raised with the fallowing message: "sendto() takes exactly 3
arguments (2 given)". But two arguments are sufficient.

Examples for Python 2.x:
import socket
my_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

# this will succeed
my_socket.sendto("Foobar", ("localhost", 514))

# these will fail with above error message
my_socket.sendto(u"Umlaut ä", ("localhost", 514))
my_socket.sendto(1, ("localhost", 514))


Examples for Python 3:
import socket
my_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

# this will succeed
my_socket.sendto("No Umlaut".encode("ascii"), ("localhost", 514))

# these will fail with above error message
my_socket.sendto("No Umlaut", ("localhost", 514))
my_socket.sendto(1, ("localhost", 514))

--
components: Library (Lib)
messages: 83187
nosy: helduel
severity: normal
status: open
title: Irritating error message by socket's sendto method
versions: Python 2.4, Python 2.5, Python 2.6, Python 3.0

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



[issue5435] test_httpservers on Debian Testing

2009-03-23 Thread Manuel Kaufmann

Manuel Kaufmann  added the comment:

I downloaded py3k branch and ran the tests with a regular user. All test
pass OK.

SVN Revision: 70469

--
nosy: +humitos
Added file: http://bugs.python.org/file13400/httpservers_test

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



[issue5435] test_httpservers on Debian Testing

2009-03-23 Thread Manuel Kaufmann

Manuel Kaufmann  added the comment:

I think it isn't a problem / bug, rather than it's a protection method
to don't execute this test or cgi stuff with root user.

In the middle, it change a userid to 'nobody', then if you are logged in
as root, it can change the userid and then you don't have permission to
write in the disk; and if you are logged in with as a regular user it
can't change the userid and works OK.

--

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



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-26 Thread Manuel Krebber

New submission from Manuel Krebber:

There currently is no type in the types module for the slot 
wrappers/wrapper_descriptor types.

I would like to have something like

WrapperDescriptor = type(object.__init__)

added to it (or maybe even add it to MethodType). This would be helpful to 
check more easily if some object is a method.

I can create a pull request for this if desired.

--
components: Library (Lib)
messages: 286304
nosy: Wheerd
priority: normal
severity: normal
status: open
title: Add the 'wrapper_descriptor' type to the types module
type: enhancement

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



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-26 Thread Manuel Krebber

Changes by Manuel Krebber :


--
keywords: +patch
Added file: 
http://bugs.python.org/file46420/0001-Added-SlotWrapperType-and-MethodWrapperType-to-the-t.patch

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



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-26 Thread Manuel Krebber

Manuel Krebber added the comment:

I would suggest the names SlotWrapperType and MethodWrapperType because I think 
they match their string representations the closest.

For checking whether something is a method/function one could also use 
inspect.isroutine (or inspect.ismethoddescriptor), but that is inconsistent 
with regards to builtin and python methods:

>>> import inspect
>>> inspect.isroutine(object.__init__)
True
>>> inspect.isroutine(object().__init__)
False
>>> class A:
...   def f(self):
... pass
...
>>> inspect.isroutine(A.f)
True
>>> inspect.isroutine(A().f)
True

Maybe a function to detect the second case is needed.

--

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



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-26 Thread Manuel Krebber

Manuel Krebber added the comment:

I added some docs, but I am not sure what I would want to test here. There are 
no tests for types.BuiltinMethodType either. Maybe the string representation of 
it could be tested, but an isinstance test seems pretty redundant. I hope this 
patch file works better, I created the last one with git diff.

--
Added file: http://bugs.python.org/file46425/slot-wrapper-types.patch

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



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-26 Thread Manuel Krebber

Manuel Krebber added the comment:

Alright, I added some tests and tried it again with the patch.

--
Added file: http://bugs.python.org/file46427/slot-wrapper-types.patch

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



[issue26355] Emit major version based canonical URLs for docs

2017-01-27 Thread Manuel Krebber

Manuel Krebber added the comment:

I create the last diff without creating a commit, so maybe this one works 
better.

--
nosy: +Wheerd
Added file: http://bugs.python.org/file46428/slot-wrapper-types.patch

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



[issue26355] Emit major version based canonical URLs for docs

2017-01-27 Thread Manuel Krebber

Changes by Manuel Krebber :


Removed file: http://bugs.python.org/file46428/slot-wrapper-types.patch

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



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-27 Thread Manuel Krebber

Manuel Krebber added the comment:

I created the last patch without commiting, so maybe this one will work 
properly with the revision tool.

--
Added file: http://bugs.python.org/file46429/slot-wrapper-types.patch

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



[issue26355] Emit major version based canonical URLs for docs

2017-01-27 Thread Manuel Krebber

Manuel Krebber added the comment:

Sorry, I accidentally replied to the worng issue -.-

--

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



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-30 Thread Manuel Krebber

Manuel Krebber added the comment:

Okay, I added MethodDescriptorType to the types module and updated the docs. 
Hope this is okay now.

--
Added file: http://bugs.python.org/file46455/slot-wrapper-types.patch

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



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-02-01 Thread Manuel Krebber

Manuel Krebber added the comment:

One question I was wondering about is whether those types should be checked by 
inspect.isroutine() as well.

--

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



[issue29418] inspect.isroutine does not return True for some bound builtin methods

2017-02-02 Thread Manuel Krebber

New submission from Manuel Krebber:

Some of the builtin methods are not recognized as such by inspect.isroutine(). 
inspect.ismethoddescriptor() only returns True for the unbound versions of the 
methods but not the bound ones.

For example:

>>> inspect.isroutine(object.__str__)
True
>>> inspect.isroutine(object().__str__)
False

The second one should also return True as it does for user-defined classes:

>>> class A:
... def f(self):
... pass
>>> inspect.isroutine(A.f)
True
>>> inspect.isroutine(A().f)
True

The types needed for that have already been added to the types module in issue 
#29377. Here is the commit: 
https://github.com/python/cpython/commit/1947d33a0a1c2ba006397579ec6235528faea9fd

--
components: Library (Lib)
messages: 286752
nosy: Wheerd, levkivskyi, yselivanov
priority: normal
severity: normal
status: open
title: inspect.isroutine does not return True for some bound builtin methods
type: behavior

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



[issue27393] Command to activate venv in Windows has wrong path

2016-06-26 Thread Manuel Kaufmann

New submission from Manuel Kaufmann:

The `venv` module has a bug in the command to activate it on Windows.

In 3.3 and 3.4 the bar used is wrong: `/` instead `\`

* https://docs.python.org/3.4/library/venv.html#creating-virtual-environments
* https://docs.python.org/3.3/library/venv.html#creating-virtual-environments


In 3.5 and 3.6 that section was converted to a table with the commands and they 
are missing the `\` in the command path:

* https://docs.python.org/3.5/library/venv.html#creating-virtual-environments
* https://docs.python.org/dev/library/venv.html#creating-virtual-environments

--
assignee: docs@python
components: Documentation
files: venv-windows-command.patch
keywords: patch
messages: 269299
nosy: docs@python, facundobatista, humitos
priority: normal
severity: normal
status: open
title: Command to activate venv in Windows has wrong path
type: enhancement
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file43543/venv-windows-command.patch

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



  1   2   >