[issue1187] pipe fd handling issues in subprocess.py on POSIX

2008-05-15 Thread Dustin J. Mitchell

Dustin J. Mitchell <[EMAIL PROTECTED]> added the comment:

Hmm.. I see why you didn't write a unit test for this!

Attached is a patch with a unit test that tickles this behavior, along 
with Andrew's fix.

Added file: http://bugs.python.org/file10338/1187-dustin.patch

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



[issue1187] pipe fd handling issues in subprocess.py on POSIX

2008-08-02 Thread Dustin J. Mitchell

Dustin J. Mitchell <[EMAIL PROTECTED]> added the comment:

Thoughts on this patch?

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



[issue1625509] 'imp' documentation does not mention that lock is re-entrant

2008-05-10 Thread Dustin J. Mitchell

Dustin J. Mitchell <[EMAIL PROTECTED]> added the comment:

Patch attached.

--
keywords: +patch
Added file: http://bugs.python.org/file10258/1625509.patch

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



[issue1174606] Reading /dev/zero causes SystemError

2008-05-10 Thread Dustin J. Mitchell

Dustin J. Mitchell <[EMAIL PROTECTED]> added the comment:

While it is a sensible fix for the signed/unsigned problem, David's patch 
still fails regrtest on my system (amd64), after OOM-killing random other 
processes :(

Andrew's suggestion makes a lot of sense here.  Does it make sense for 
new_buffersize to return (PY_SSIZE_T_MAX+1) in this case, to trigger an 
overflow (in addition to David's patch)?

--
nosy: +djmitche

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



[issue1792] o(n*n) marshal.dumps performance for largish objects with patch

2008-05-10 Thread Dustin J. Mitchell

Dustin J. Mitchell <[EMAIL PROTECTED]> added the comment:

This test passes -- is this ready to commit?

I see a reduction from 1.9s to 1.5s for the test script in msg59715.

--
nosy: +djmitche

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



[issue1174606] Reading /dev/zero causes SystemError

2008-05-10 Thread Dustin J. Mitchell

Dustin J. Mitchell <[EMAIL PROTECTED]> added the comment:

Improved fix; this passes test_file on my system.

--
keywords: +patch
Added file: http://bugs.python.org/file10266/1174606.patch

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



[issue1187] pipe fd handling issues in subprocess.py on POSIX

2008-05-10 Thread Dustin J. Mitchell

Dustin J. Mitchell <[EMAIL PROTECTED]> added the comment:

I see that, on running your fix_fileno.py, nothing is output to 
/tmp/stdout.test.  I don't necessarily see the link to your fix.  Could 
you describe the problem and/or add comments to your patch to explain why 
these checks are made?

--
nosy: +djmitche

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



[issue1174606] Reading /dev/zero causes SystemError

2008-05-10 Thread Dustin J. Mitchell

Dustin J. Mitchell <[EMAIL PROTECTED]> added the comment:

Thanks, Adam -- requested changes made

Added file: http://bugs.python.org/file10271/1174606-2.patch

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



[issue1174606] Reading /dev/zero causes SystemError

2008-05-10 Thread Dustin J. Mitchell

Dustin J. Mitchell <[EMAIL PROTECTED]> added the comment:

Ack, sorry.  My 'vi' settings should now be correct.

Added file: http://bugs.python.org/file10274/1174606-3.patch

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



[issue3353] make built-in tokenizer available via Python C API

2017-03-13 Thread Dustin J. Mitchell

Dustin J. Mitchell added the comment:

If the patch still applies cleanly, I have no issues with you or anyone opening 
a PR.  I picked this up several years ago at the PyCon sprints, and don't 
remember a thing about it, nor have I touched any other bit of the CPython 
source since then.  So any merge conflicts would be very difficult for me to 
resolve.

--

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



[issue3353] make built-in tokenizer available via Python C API

2015-06-29 Thread Dustin J. Mitchell

Dustin J. Mitchell added the comment:

This seems to have stalled out after the PyCon sprints.  Any chance the final 
patch can be reviewed?

--

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



[issue24530] `import..as` fails where `import` does not

2015-06-29 Thread Dustin J. Mitchell

New submission from Dustin J. Mitchell:

Reproduction:

# main.py
import foo.bar

# foo/__init__.py
# (empty)

# foo/bar/__init__.py
import foo.bar.bing as bing

# foo/bar/bing.py
# (empty)

Result:

dustin@euclid ~/tmp $ python3.3 main.py 
Traceback (most recent call last):
  File "main.py", line 1, in 
import foo.bar
  File "/home/dustin/tmp/foo/bar/__init__.py", line 1, in 
import foo.bar.bing as bing
AttributeError: 'module' object has no attribute 'bar'

dustin@euclid ~/tmp $ python2.7 main.py 
Traceback (most recent call last):
  File "main.py", line 1, in 
import foo.bar
  File "/home/dustin/tmp/foo/bar/__init__.py", line 1, in 
import foo.bar.bing as bing
AttributeError: 'module' object has no attribute 'bar'

If you remove the `as bing` from `foo/bar/__init__.py`, all is well.  
Similarly, `from foo.bar import bing` works fine, as does `from foo.bar import 
bing as bing`.

I don't see anything in 
https://docs.python.org/3/reference/simple_stmts.html#import that suggests this 
is expected behavior.

--
components: Interpreter Core
messages: 245941
nosy: djmitche
priority: normal
severity: normal
status: open
title: `import..as` fails where `import` does not
type: behavior
versions: Python 2.7, Python 3.3

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



[issue19543] Add -3 warnings for codec convenience method changes

2015-04-13 Thread Dustin J. Mitchell

Dustin J. Mitchell added the comment:

This fixes the four cases Nick referred to, although not in the functions 
expected:

 - str.encode no longer exists
 - unicode.decode no longer exists
 - encoders used by str.encode must return bytes (does not apply to 
codecs.encode)
 - decoders used by unicode.decode must return unicode (does not apply to 
codecs.decode)

--
keywords: +patch
nosy: +djmitche
Added file: http://bugs.python.org/file38979/issue19543.patch

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



[issue3353] make built-in tokenizer available via Python C API

2015-04-14 Thread Dustin J. Mitchell

Dustin J. Mitchell added the comment:

>From my read of this bug, there are two distinct tasks mentioned:

 1. make PyTokenizer_* part of the Python-level API
 2. re-implement 'tokenize' in terms of that Python-level API

#1 is largely complete in Andrew's latest patch, but that will likely need:
 * rebasing
 * hiding struct fields
 * documentation

#2 is, I think, a separate project.  There may be good reasons *not* to do this 
which I'm not aware of, and barring such reasons the rewrite will be difficult 
and could potentially change behavior like issue2180.  So I would suggest 
filing a new issue for #2 when #1 is complete.  And I'll work on #1.

--
nosy: +djmitche

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



[issue3353] make built-in tokenizer available via Python C API

2015-04-14 Thread Dustin J. Mitchell

Dustin J. Mitchell added the comment:

Here's an updated patch for #1:

Existing Patch:
 - move tokenizer.h from Parser/ to Include/
 - Add PyAPI_Func to export tokenizer functions

New:
 - Removed unused, undefined PyTokenizer_RestoreEncoding
 - Include PyTokenizer_State with limited ABI compatibility (but still 
undocumented)
 - namespace the struct name (PyTokenizer_State)
 - Documentation

I'd like particular attention to the documentation for the tokenizer -- I'm not 
entirely confident that I have documented the functions correctly!  In 
particular, I'm not sure how PyTokenizer_FromString handles encodings.

There's a further iteration possible here, but it's beyond my understanding of 
the tokenizer and of possible uses of the API. That would be to expose some of 
the tokenizer state fields and document them, either as part of the limited ABI 
or even the stable API.  In particular, there are about a half-dozen struct 
fields used by the parser, and those would be good candidates for addition to 
the public API.

If that's desirable, I'd prefer to merge a revision of my patch first, and keep 
the issue open for subsequent improvement.

--
Added file: http://bugs.python.org/file38992/issue3353.patch

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



[issue3353] make built-in tokenizer available via Python C API

2015-04-14 Thread Dustin J. Mitchell

Dustin J. Mitchell added the comment:

New:
 - rename token symbols in token.h with a PYTOK_ prefix
 - include an example of using the PyTokenizer functions
 - address minor review comments

--
Added file: http://bugs.python.org/file38999/issue3353-2.patch

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