[issue35943] PyImport_GetModule() can return partially-initialized module

2020-10-23 Thread Atsuo Ishimoto


Atsuo Ishimoto  added the comment:

After this fix, some functions like multiprocessing.Pool cannot be used in 
threaded code(https://bugs.python.org/issue41567).

importerror-sample.tgz contains simplified code to reproduce the same error 
without multiprocessing module. Is this an expected behaviour of this change?

Tested with Python 3.9.0/macOS 10.15.5.

--
nosy: +ishimoto
Added file: https://bugs.python.org/file49537/importerror-sample.tgz

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



[issue41567] multiprocessing.Pool from concurrent threads failure on 3.9.0rc1

2020-10-22 Thread Atsuo Ishimoto


Atsuo Ishimoto  added the comment:

Some my observation at 
https://discuss.python.org/t/differences-between-3-8-and-3-9-in-importing-module/5520
 .

--

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



[issue41567] multiprocessing.Pool from concurrent threads failure on 3.9.0rc1

2020-10-22 Thread Atsuo Ishimoto


Atsuo Ishimoto  added the comment:

multiprocessing module used to work multithread environment until 
https://bugs.python.org/issue35943 merged.

I guess we can make multiprocessing thread-safe again if we move local imports 
to global.
Does it make sense?

--
nosy: +ishimoto

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



[issue36164] Updating Py_InspectFlag programmatically

2019-03-01 Thread Atsuo Ishimoto


New submission from Atsuo Ishimoto :

I sometime use a hack to start interactive console after running script.

.. code-block:: python

   import os

   os.environ['PYTHONINSPECT'] = 'x'
   print("Hello")

This hack works because ``PYTHONINSPECT`` is checked `here 
<https://github.com/python/cpython/blob/master/Modules/main.c#L738>`__ when 
exiting Python.

However, if the script uses ``sys.exit()`` to exit from Python, interactive 
console doen't apper because unhandled ``SystemExit`` exception leads 
``exit()`` call to kill process, without checking ``PYTHONINSPECT``.

.. code-block:: python

   import os, sys

   os.environ['PYTHONINSPECT'] = 'x'
   print("Hello")

   sys.exit(1)  # Interactive console will not start


I think feature to allow updating ``Py_InspectFlag`` is useful, and this is a 
bugs to be fixed. However, setting environment variable to start console is not 
intuituve.

So instead of fixing bug, I would like to propose a small function to set 
``Py_InspectFlag`` to start interactive console after running script.

.. code-block:: python

sys.setinteractiveflag(bool)

Thoughts?

--
components: Interpreter Core
messages: 336993
nosy: ishimoto
priority: normal
severity: normal
status: open
title: Updating Py_InspectFlag programmatically
type: behavior

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



[issue17277] incorrect line numbers in backtrace after removing a trace function

2017-12-20 Thread Atsuo Ishimoto

Change by Atsuo Ishimoto <atsuoishim...@gmail.com>:


--
nosy: +ishimoto

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



[issue16482] pdb.set_trace() clobbering traceback on error

2017-12-20 Thread Atsuo Ishimoto

Change by Atsuo Ishimoto <atsuoishim...@gmail.com>:


--
nosy: +ishimoto

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



[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-29 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

> Benjamin Peterson added the comment:
> 
> The OP probably wants something like the Linux-specific signalfd() syscall.

Yes.

Long explanation:

I have an console text editor written in 
Python/curses(http://kaaedit.github.io/).

This editor didn't work with Python 3.5 because select.select() stop raising 
InterruptedError.

Following is sample code to reproduce. This code displays size of terminal. If 
you resize your terminal, screen is updated and new size is displayed.

---

import curses, select, sys

def main(stdscr):
i=0
while True:
y, x = stdscr.getmaxyx()
stdscr.addstr(i % 10, 0, "%d x:%d y:%d" % (i, x, y))
i+=1
stdscr.refresh()
try:
s=select.select([sys.stdin], [], [])   # wait for user input and 
some sockets.
except InterruptedError:
stdscr.addstr(i % 10, 0, "%d InterruptedError" % i)
i+=1
continue
try:
c=stdscr.get_wch()
except curses.error:
stdscr.addstr(i % 10, 0, "%d curses.error" % i)
i+=1
continue
if c == 'q':
break

curses.wrapper(main)

---

Resizing terminal generates SIGIWNCH signal. In Python 3.4, select.select() 
raises InterruptedError when the signal sent. Also, Ncurses library catches the 
signal and update internal data to reflect new terminal size.

To detect resizing in Python 3.5, I had to set signal handler for SIGWINCH as 
following sample. 

---
import curses, select, sys, signal, os

rfd, wfd = os.pipe()
os.set_blocking(wfd, False)

def f(*args): pass
signal.signal(signal.SIGWINCH, f)
signal.set_wakeup_fd(wfd)

def main(stdscr):
i=0
while True:
y, x = stdscr.getmaxyx()
stdscr.addstr(i, 0, "%d x:%d y:%d" % (i, x, y))
i+=1
stdscr.refresh()
try:
s=select.select([sys.stdin, rfd], [], [])
except InterruptedError:
stdscr.addstr(i, 0, "%d InterruptedError" % i)
i+=1
continue
try:
c=stdscr.get_wch()
except curses.error:
stdscr.addstr(i, 0, "%d curses.error" % i)
i+=1
continue
if c == 'q':
break

curses.wrapper(main)
-

This code doesn't display updated size of terminal because SIGWINCH signal is 
not sent to nurses library. I have to call curses.resizeterm() manually to tell 
new terminal size to nurses.

I don't know this is common situation or not, but In general, it is not safe to 
set signal handler when the signal is used by third-party library.

--

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



[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-29 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

Thank you for good sample. This should be written in PEP 475.

But installing new signal handler can cause different behavior. 

As in my previous example, if other 3rd party libraries(ncurses in my case) 
need to handle the signal, signal is consumed by Python handler and not 
delivered to the library.

--

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



[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-26 Thread Atsuo Ishimoto

New submission from Atsuo Ishimoto:

I expect following code prints '\x1c' when I resize terminal window on 
Linix/Mac terminal.


import select, os, signal

rfd, wfd = os.pipe()
os.set_blocking(wfd, False)

signal.set_wakeup_fd(wfd)
select.select([rfd], [], [])
print(os.read(rfd, 2))


Resizing terminal window make SIGWINCH signal sent to Python process. But 
nothing written to fd I specified to set_wakeup_fd().

I checked Modules/signalmodule.c and found I should assign signal handler for 
the signal I want to wakeup fd. So following code works as I expected.


import select, os, signal

rfd, wfd = os.pipe()
os.set_blocking(wfd, False)

signal.set_wakeup_fd(wfd)

signal.signal(signal.SIGWINCH, lambda *args:0)
select.select([rfd], [], [])
print(os.read(rfd, 2))


Is this an expected behavior of signal.set_wakeup_fd()?

--
components: Library (Lib)
messages: 253468
nosy: ishimoto
priority: normal
severity: normal
status: open
title: signal.set_wakeup_fd() doesn't work if the signal don't have handler
versions: Python 3.5

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



[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-26 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

Okay, so I think this needed to be documented in signal.set_wakeup_fd(). 

IMO this reduces usefulness of set_wakeup_fd(). If I need to install custom 
handler by my self, I can write to fd in my own custom handler.

And,  installing custom handler omits existing handler, but we can not execute 
existing signal handler from python script. In my real-world case, SIGWINCH 
signal does not delivered to curses library. 

pep-475(https://www.python.org/dev/peps/pep-0475/#backward-compatibility) 
claims that 

"For applications using event loops, signal.set_wakeup_fd() is the 
recommanded option to handle signals. "

But I think side effect of signal.set_wakeup_fd() is lager than pep-475 authors 
expected.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
resolution: not a bug -> 
status: closed -> open

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



[issue9949] os.path.realpath on Windows does not follow symbolic links

2014-07-23 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


Removed file: http://bugs.python.org/file26487/issue9949.patch

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



[issue9949] os.path.realpath on Windows does not follow symbolic links

2014-07-23 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

I have unlinked my patch since it doesn't looks correct now. Sorry for 
disturbing.

--

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



[issue19977] Use surrogateescape error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-03-19 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue18113] Memory leak in curses.panel

2013-05-31 Thread Atsuo Ishimoto

New submission from Atsuo Ishimoto:

Objects associated to the panel with panel.set_userptr() are never DECREF()ed. 
Attached file is script to reproduce the leak.

Confirmed with Python2.7/3.3.

--
files: userptr-leak.py
messages: 190433
nosy: ishimoto
priority: normal
severity: normal
status: open
title: Memory leak in curses.panel
versions: Python 2.7, Python 3.3
Added file: http://bugs.python.org/file30438/userptr-leak.py

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



[issue10952] Don't normalize module names to NFKC?

2013-02-24 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue10952] Don't normalize module names to NFKC?

2013-02-24 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

Converting identifiers to NFKC is problematic to work with FULLWIDTH letters 
such as 'a'(FULLWIDTH LATIN SMALL LETTER A).

We can create module named 'aaa.py', but this module could not be imported on 
all platforms I know.

 import aaa
Traceback (most recent call last):
  File stdin, line 1, in module
ImportError: No module named 'aaa'

Talking about Japanese environment, I don't see benefit to normalize variable 
names. FULLWIDTH/HALFWIDTH compatibility characters are commonly used here, and 
they are recognized different characters.  It would be too late to argue, but 
converting to normal form NKC instead of NFKC would be better. Python 
distinguishes small letters and large letters, but doesn't distinguish 
fullwidth and halfwidth. This is a pretty surprising behavior to me.

--

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



[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2013-01-23 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

In Python 3.3, we have contextlib.ExitStack() for multiple contexts. 
So, perhaps we can close this issue?

--

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



[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2012-08-09 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue13119] Newline for print() is \n on Windows, and not \r\n as expected

2012-08-05 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

Antoine Pitrou added the comment:

 We should not convert \n with -u command line option or PYTHONUNBUFFERED was 
 set.

 Why that? What do universal newlines have to do with buffering?

Man page of Python says 

  -u Force  stdin,  stdout  and  stderr to be totally unbuffered.  On
 systems where it matters, also put stdin, stdout and  stderr  in
 binary  mode.   

test_httpservers depends on this behavior, but was implemented as documented in 
Python 3.

--

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



[issue13119] Newline for print() is \n on Windows, and not \r\n as expected

2012-08-05 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

 I don't know which version it is, but current 3.3 says:

Ah, sorry, I thought I was reading latest Man page.

--

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



[issue15555] Default newlines of io.TextIOWrapper

2012-08-04 Thread Atsuo Ishimoto

New submission from Atsuo Ishimoto:

In http://docs.python.org/dev/library/io.html:

  if newline is None, any '\n' characters written are translated to the system 
default line separator, os.linesep. 

But os.linesep is not referred at all. On Windows default newline is always 
'\r\n' on Windows, '\n' otherwise.

--
assignee: docs@python
components: Documentation
messages: 167413
nosy: docs@python, ishimoto
priority: normal
severity: normal
status: open
title: Default newlines of io.TextIOWrapper

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



[issue13119] Newline for print() is \n on Windows, and not \r\n as expected

2012-08-04 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

Fix for test_httpservers

--
Added file: http://bugs.python.org/file26694/issue13119_httpserver.patch

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



[issue13119] Newline for print() is \n on Windows, and not \r\n as expected

2012-08-04 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

Sorry, please ignore the patch 'issue13119_httpserver.patch' I posted above. 

Behavior of -u commandline option in Python3.3 is differ than in Python 2. 

We should not convert newline characters if -u specified? I'll investigate 
more.

--

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



[issue13119] Newline for print() is \n on Windows, and not \r\n as expected

2012-08-04 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

We should not convert \n with -u command line option or PYTHONUNBUFFERED was 
set.

Added a patch to fix error in test_httpservers.

--
Added file: http://bugs.python.org/file26695/issue13119_unbuffered.patch

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



[issue15216] Support setting the encoding on a text stream after creation

2012-08-02 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue13119] Newline for print() is \n on Windows, and not \r\n as expected

2012-08-02 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

On Fri, Aug 3, 2012 at 5:16 AM, STINNER Victor rep...@bugs.python.org wrote:

 I wonder why print(1, file=sys.stderr) returns '1' instead of '1\n'.

 I suppose that you mean returns '1\n' instead of '1'. 

No, sorry for my lame wording.

In the test I submitted, printing to stdout with 

print(1, file=sys.stdout);print(2, file=sys.stdout)

outputs

1\r\n2\r\n

but printing to stderr with 

print(1, file=sys.stderr);print(2, file=sys.stderr) 

outputs

1\r\n2   - no '\r\n' at the end


I wondered why, but this is not specific to Python 3. 
With Python 2.7 

print sys.stderr, 1

doesn't output '\r\n' at the end also. So I think this may 
not be a bug.

--

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



[issue13119] Newline for print() is \n on Windows, and not \r\n as expected

2012-08-01 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

Test for this issue. Tested on Windows7, Ubuntu linux 12.04.

I wonder why print(1, file=sys.stderr) returns '1' instead of '1\n'.

But in Python2.7, print sys.stderr, 1 also returns '1', 
so this might not be a problem.

--
Added file: http://bugs.python.org/file26660/issue13119_test.patch

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



[issue13119] Newline for print() is \n on Windows, and not \r\n as expected

2012-07-31 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

I found 'more' command in Windows7 requires \r\n.

Python 2.7.3:

C:\python -c for i in range(5):print(i)|more
0
1
2
3
4

Python 3.3(trunk):

c:\src\cpython\PCbuildpython -c for i in range(5):print(i)|more
?

--
nosy: +ishimoto

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



[issue15267] tempfile.TemporaryFile and httplib incompatibility

2012-07-30 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

patch contains fix and test for 2.7.
With this patch, AttibuteError is captured as Tim sujested.

--
keywords: +patch
nosy: +ishimoto
Added file: http://bugs.python.org/file26595/issue15267.patch

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



[issue1610654] cgi.py multipart/form-data

2012-07-30 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue8847] crash appending list and namedtuple

2012-07-30 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue14302] Move python.exe to bin/

2012-07-30 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue6132] Implement the GIL with critical sections in Windows

2012-07-30 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue7671] test_popen fails if path contains special char like ;

2012-07-30 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue4722] _winreg.QueryValue fault while reading mangled registry values

2012-07-30 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue7686] redundant open modes 'rbb', 'wbb', 'abb' no longer work on Windows

2012-07-30 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-30 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue15478] UnicodeDecodeError on OSError on Windows with undecodable (bytes) filename

2012-07-29 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

+1 for keeping the file name unchanged. This solution is not very 
compatible with prior versions, but simple and least-surprise.

I prefer other platforms than Windows to use same method to build OSError.

--

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



[issue9035] os.path.ismount on windows doesn't support windows mount points

2012-07-28 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

Patch to expose GetVolumePathName() and implementation of ismount().
Tested on Windows7/XP.

--
keywords: +patch
Added file: http://bugs.python.org/file26558/issue9035.patch

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



[issue14135] check for locale changes in test.regrtest

2012-07-27 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Patch to check if locale was changed.

Since I'm not sure where to put tests for test.regrtest, I created 
new file, test.test_regrtest.

--
keywords: +patch
nosy: +ishimoto
Added file: http://bugs.python.org/file26540/issue14135.patch

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



[issue9035] os.path.ismount on windows doesn't support windows mount points

2012-07-27 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-26 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

 chcp does only change the OEM code page, whereas Python uses the ANSI code 
 page for sys.getfilesystemencoding().

Sorry, I should have investigated the code more carefully.

 Attached patch win32_bytes_filename.patch tries to solve both issues: the 
 test and UnicodeDecodeError on raising the OSError.

Looks good to me. Thank you!

--

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



[issue10296] ctypes catches BreakPoint error on windows 32

2012-07-26 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue15093] ntpath.isdir returns False for directory symlinks

2012-07-26 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

On Windows, 'target_is_directory' is required for directory symlink.

python -c import os; os.mkdir('bar'); os.symlink('bar', 'foo', 
target_is_directory=True); print(os.path.isdir('foo'))
True

Should we automatically specify target_is_directory if target exists and the 
target is a directory?

--
nosy: +ishimoto

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



[issue15093] ntpath.isdir returns False for directory symlinks

2012-07-26 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

ah, thank you for pointer! I should have googled before I wrote.

--

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



[issue15093] ntpath.isdir returns False for directory symlinks

2012-07-26 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Jason: You can re-activate test you disabled if you use target_is_directory. 
Please take a look at a issue15093.patch.

--
keywords: +patch
Added file: http://bugs.python.org/file26527/issue15093.patch

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



[issue15093] ntpath.isdir returns False for directory symlinks

2012-07-26 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

I think we can close this ticket as won't fix.

--

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



[issue12034] check_GetFinalPathNameByHandle() suboptimal

2012-07-26 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Patch to cache result of check_GetFinalPathNameByHandle().

--
keywords: +patch
nosy: +ishimoto
Added file: http://bugs.python.org/file26535/issue12034.patch

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Yes, I know #13374, that's why I wrote

 This is a byte-api issue on Windows, so we may be able to simply skip 
 this test.

Do you think we need a patch to avoid UnicodeDecodeError raised? 
Or should we change test to skip this?

--

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Here's another try:

In this patch:

- skip test_nonascii_abspath() test since it fails on some code pages.

- Added a test to reproduce bug on latin code pages.

- Use repr(filename) only if decode failed. This is more backward-compatible 
and does not lose any information.

--
Added file: http://bugs.python.org/file26517/issue15441_2.patch

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

martin: while os.mkdir(b'\xe7w\xf0') succeeds, but strangely enough, subsequent 
os.chdir(b'\xe7w\xf0') fails.

This is not a bug in Python, but Windows issue.

--

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Updated patch again.

In this patch, byte object is passed as argument to WindowsError as Victor's 
patch.

I prefer to fix PyErr_SetFromWindowsErrWithFilename() over path_error(), 
because PyErr_SetFromWindowsErrWithFilename() is public API, so someone may use 
PyErr_SetFromWindowsErrWithFilename() for their own extension modules.

--
Added file: http://bugs.python.org/file26518/issue15441_3.patch

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



[issue5619] Pass MS CRT debug flags into subprocesses

2012-07-24 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Atsuo Ishimoto

New submission from Atsuo Ishimoto ishim...@gembook.org:

test_posixpath.PosixCommonTest.test_nonascii_abspath fails on Japanese edition
of Windows.

If a file name was invalid byte character, os.chdir() raises 
UnicodeDecodeError()
instead of WindowsError.

This is a byte-api issue on Windows, so we may be able to simply skip this test.

==
ERROR: test_nonascii_abspath (test.test_posixpath.PosixCommonTest)
--
Traceback (most recent call last):
  File C:\cygwin\home\ishimoto\src\cpython\lib\test\test_genericpath.py, line
318, in test_nonascii_abspath
with support.temp_cwd(b'\xe7w\xf0'):
  File C:\cygwin\home\ishimoto\src\cpython\lib\contextlib.py, line 48, in __en
ter__
return next(self.gen)
  File C:\cygwin\home\ishimoto\src\cpython\lib\test\support.py, line 614, in t
emp_cwd
os.chdir(path)
UnicodeDecodeError: 'mbcs' codec can't decode bytes in position 0--1: No mapping
for the Unicode character exists in the target code page.

--

--
components: Unicode, Windows
files: test_nonascii_abspath.patch
keywords: patch
messages: 166300
nosy: ezio.melotti, ishimoto
priority: normal
severity: normal
status: open
title: test_posixpath fails on Japanese edition of Windows
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file26500/test_nonascii_abspath.patch

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

changed name of test method. In the old patch, new test method shadowed 
existing one.

--
Added file: http://bugs.python.org/file26502/test_nonascii_abspath_2.patch

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


Removed file: http://bugs.python.org/file26500/test_nonascii_abspath.patch

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


Removed file: http://bugs.python.org/file26502/test_nonascii_abspath_2.patch

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

I'm sorry, I generated a patch in wrong direction.

--
Added file: http://bugs.python.org/file26506/issue15441.patch

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



[issue15207] mimetypes.read_windows_registry() uses the wrong regkey, creates wrong mappings

2012-07-24 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

This patch looks good to me.

I generated a patch for current trunk, with some cosmetic changes.

--
nosy: +ishimoto
Added file: http://bugs.python.org/file26507/issue15207.patch

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



[issue2122] mmap.flush does not check for errors on windows

2012-07-24 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue13837] test_shutil fails with symlinks enabled under Windows

2012-07-23 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Error in test_move_dangling_symlink is fixed by #9949

--

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



[issue9949] os.path.realpath on Windows does not follow symbolic links

2012-07-22 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Yet another patch to support symlink on Windows.

--
nosy: +ishimoto
Added file: http://bugs.python.org/file26487/issue9949.patch

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



[issue15411] os.chmod() does not follow symlinks on Windows

2012-07-21 Thread Atsuo Ishimoto

New submission from Atsuo Ishimoto ishim...@gembook.org:

os.chmod() should check symlinks if followsymlinks option is True on Windows. 

This is a cause of failure of test case 

   test.test_shutil.TestShutil.test_copymode_follow_symlinks

(#13837)

--
components: Library (Lib), Windows
files: chmod_symlink_win32.patch
keywords: patch
messages: 165996
nosy: ishimoto
priority: normal
severity: normal
status: open
title: os.chmod() does not follow symlinks on Windows
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file26462/chmod_symlink_win32.patch

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



[issue13837] test_shutil fails with symlinks enabled under Windows

2012-07-21 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Error in test_copymode_follow_symlinks is adderessed in #15411.

--
nosy: +ishimoto

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



[issue15411] os.chmod() does not follow symlinks on Windows

2012-07-21 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Patch updated. Check symlinks only if supported by platform.

--
Added file: http://bugs.python.org/file26463/issue1492704_new_2.patch

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



[issue15411] os.chmod() does not follow symlinks on Windows

2012-07-21 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


Removed file: http://bugs.python.org/file26463/issue1492704_new_2.patch

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



[issue15411] os.chmod() does not follow symlinks on Windows

2012-07-21 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


Added file: http://bugs.python.org/file26464/chmod_symlink_win32_2.patch

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



[issue7171] Add inet_ntop and inet_pton support for Windows

2012-07-16 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Implementation of inet_pton and inet_ntop by WSAAddressToStringA and
WSAStringToAddressA for Windows.

Conversion of IPv6 address might fail if IPv6 is 
not installed.

Tested on Windows XP SP3 and Windows7.

--
keywords: +patch
nosy: +ishimoto
Added file: http://bugs.python.org/file26392/issue7171.patch

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



[issue1492704] distinct error type from shutil.move()

2012-07-16 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Cleaned up the patch.

Gennadiy added a test of shutil.move(), but SameFileError 
will be raised only if shutil.copy() was called. 

Am I missing something?

--
nosy: +ishimoto
Added file: http://bugs.python.org/file26394/issue1492704_new.patch

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



[issue1492704] distinct error type from shutil.move()

2012-07-16 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Behavior is not changed at all.

I fixed test_shutil.py to test if SameFileError is raised in
shutil.copy() instead of shutil.move().

--

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



[issue1492704] distinct error type from shutil.move()

2012-07-16 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

So, the title of this issue is misleading.

The patch originally proposed by Zooko does not raise SameFileError in
shutil.move(). If source and destination is same file, shutil.move() may
raise exception, but the exception is NOT SameFileError but OSError or 
something.

shutil.copy() raises SameFileError if source and destination is same file.

--

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



[issue1492704] distinct error type from shutil.move()

2012-07-16 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Well, I happy to improve patch. 

But, on Linux and Windows, shutil.move() does not raise any exception if source 
and destination are identical. If we change the behavior, I'm afraid we would 
break a lot of existing applications.

--

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



[issue1492704] distinct error type if shutil.copyfile() fails because of src and dst are the same file

2012-07-16 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Ooops, shutil.move() will raise SameFileError if destination is directory. I'll 
investigate the patch further more.

--

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



[issue1492704] distinct error type if shutil.copyfile() fails because of src and dst are the same file

2012-07-16 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Patch updated.

- SameFileError is now derived from EnvironmentError.
- Fixed documentation.
- Fixed test method name.

I investigated this patch:

- shutil.copyfile() and shutil.copy() raises SameFileError if source and 
destination are same file.

- shutil.move() never raises SameFileError. shutil.move() may raise exception 
if source and dest are same file, but it depends on underlying implementation 
of platform. Linux and Windows don't raise exception in this case.

- I am opposed to change shutil.move() to raise SameFileError, because such 
incompatible change can break existing applilcations.

--
Added file: http://bugs.python.org/file26401/issue1492704_new_2.patch

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



[issue1492704] distinct error type if shutil.copyfile() fails because of src and dst are the same file

2012-07-16 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

 - SameFileError is now derived from EnvironmentError.

Why?

oh, sorry, I misunderstood you suggested to do so.

--

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



[issue1492704] distinct error type if shutil.copyfile() fails because of src and dst are the same file

2012-07-16 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Patch updated.

- SameFileError is reverted to be derived from shutil.Error as original patch.

--
Added file: http://bugs.python.org/file26406/issue1492704_new_3.patch

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



[issue13247] os.path.abspath returns unicode paths as question marks

2011-10-26 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

On Wed, Oct 26, 2011 at 3:36 PM, Yuval Greenfield
rep...@bugs.python.org wrote:

 If the current situation isn't fixed though - you just can't use the 
 resulting path for almost anything. Do you have a use case Ishimoto?

I don't have use case. But does raising UnicodeEncodeError fix
problems?  It could break existing code, but I don't see much
difference over WindowsError caused by the broken file names.

 The fact is you shouldn't be doing os.path.abspath(b'.') in windows to begin 
 with.

Agreed. So I think adding Windows specific check to Byte API does not
improve situation, but increase complexity of std lib.

--

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



[issue13247] os.path.abspath returns unicode paths as question marks

2011-10-25 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

-1 from me.

- I hate to see Unicode exceptions here. It would be an another source of 
mysterious Unicode exception. Programmers and users would be confused by error 
message. If you make such characters error, Python should raise an OSError or 
such.

- File names with '?' are fine to display informations to users. Not all file 
names are nessesary to be used to open files.

- I don't think filenames cannot be decoded in ANSI code page are rare enough 
to be ignored. I use Japanese edition of windows, but I sometime receive files 
with Chinese or German names. 

Or, in some case, I have to change codepage with 'chcp 437' command to run 
console application made for American environment. I seldom run such 
application in these days, though.

--
nosy: +ishimoto

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



[issue13247] os.path.abspath returns unicode paths as question marks

2011-10-25 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

On Wed, Oct 26, 2011 at 9:12 AM, STINNER Victor rep...@bugs.python.org wrote:

 STINNER Victor victor.stin...@haypocalc.com added the comment:

 Le 26/10/2011 01:32, Atsuo Ishimoto a écrit :
 - I don't think filenames cannot be decoded in ANSI code page are rare 
 enough to be ignored.

 The issue is able being able to be noticied of encoding errors.

This patch solve nothing, but just raises exception. It can break
existing codes. Also, I don't think it worth to add weired behavior to
Python std lib. I'll be surprised if *Byte* API raised an
UnicodeEncodeError.

 Anyway, you must use the Unicode API on Windows. If you use the Unicode
 API, filenames are no more encoded and code pages are no more used, so
 bye bye Unicode errors!


Agreed. So I would like to suggest not to adding unnecessary
complexity to the Byte API.

--

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



[issue11346] Generator object should be mentioned in gc module document

2011-02-27 Thread Atsuo Ishimoto

New submission from Atsuo Ishimoto ishim...@gembook.org:

In the gc.garbage of the library ref of gc module, 
  
  ... this list contains only objects with __del__() methods.

This is not true, since gc.garbage will contain generator object with 
try-finally block.

--
assignee: docs@python
components: Documentation
messages: 129631
nosy: docs@python, ishimoto
priority: normal
severity: normal
status: open
title: Generator object should be mentioned in gc module document

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



[issue11346] Generator object should be mentioned in gc module document

2011-02-27 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Oh, Not only try-finally block, generators contains try-except or with block 
will be added to gc.garbage.

--

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



[issue3665] Support \u and \U escapes in regexes

2010-07-10 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Here's an updated patch for py3k branch. 
As per Georg's comment, I added to check codepoint in the character 
ranges, conversion to the surrogate pairs. I also added check to raise 
exception if codepoint  0x10.
I with to English speakers to fix error messages in the patch.

--
nosy: +ishimoto
Added file: http://bugs.python.org/file17939/3665.patch

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



[issue1079] decode_header does not follow RFC 2047

2009-04-08 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

+1 for Tony's patch.

This patch reverts fix for Issue1582282 filed by tkikuchi.
I cannot understand the rationale for solution proposed in
Issue1582282. How does the fix make easier to read mails from 
Entourage?

--
nosy: +ishimoto, tkikuchi

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



[issue5640] Wrong print() result when unicode error handler is not 'strict'

2009-04-02 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

I tested with py3k branch and worked fine. Thank you.

--
versions: +Python 2.6, Python 2.7

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



[issue5640] Wrong print() result when unicode error handler is not 'strict'

2009-04-01 Thread Atsuo Ishimoto

New submission from Atsuo Ishimoto ishim...@gembook.org:

In Python 3(both 3.0.1 and SVN repo), if I set 
PYTHONIOENCODING=ShiftJIS:backslashreplace, print()
outputs wrong result.

 print(\xff)
\xff\xff

Obviously, '\xff' should be printed instead of '\xff\xff'.

Following is what io module does to print string.

 import codecs
 e=codecs.getincrementalencoder(ShiftJIS)(backslashreplace)
 e.encode(\xff)
b'\\xff'
 e.encode(\n)
b'\\xff\n'

io module never supply final=True to the encoder.

--
components: Unicode
messages: 84987
nosy: ishimoto
severity: normal
status: open
title: Wrong print() result when unicode error handler is not 'strict'
type: behavior
versions: Python 3.0, Python 3.1

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



[issue5110] Printing Unicode chars from the interpreter in a non-UTF8 terminal raises an error (Py3)

2009-04-01 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

My proposal to make backslashreplace a default error handler 
for interactive session was rejected by Guido [1].

Does something like
  PYTHONIOENCODING=ascii:backslashreplace
work for you? With PYTHONIOENCODING, you can effectively make
backslashreplace a default error handler for your environment.


[1]: http://mail.python.org/pipermail/python-3000/2008-May/013928.html

--
nosy: +ishimoto

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



[issue5126] Space character returns false from isprintable() method

2009-02-01 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

I'm sorry, looks like my fault.

I attached a patch to fix issue. This patch contains re-generated
unicodetype_db.h. I downloaded Unicode 5.1.0 and Unicode 3.2.0 files
from unicode.org to re-generate.

--
keywords: +patch
Added file: http://bugs.python.org/file12915/5126.diff

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



[issue4846] Py_UNICODE_ISSPACE causes linker error

2009-01-05 Thread Atsuo Ishimoto

New submission from Atsuo Ishimoto ishim...@gembook.org:

When I use Py_UNICODE_ISSPACE() in my C++ extension, I got following error.

test.obj : error LNK2019: unresolved external symbol
__declspec(dllimport) unsigned char const * const _Py_ascii_whitespace
(__imp_?_Py_ascii_whitespace@@3QBEB) referenced in function struct
_object * __cdecl fff(struct _object *,struct _object *)
(?fff@@YAPAU_object@@p...@0@Z)

Py_ascii_whitespace defined in unicodeobject.h should be enclosed by
'extern C {' block for C++ support.

Tested with Python 2.6.1/VS2008 express.

--
messages: 79160
nosy: ishimoto
severity: normal
status: open
title: Py_UNICODE_ISSPACE causes linker error
type: compile error
versions: Python 2.6

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



[issue4491] email.Header.decode_header() doesn't work if encoded-word was separeted by CRLF

2008-12-02 Thread Atsuo Ishimoto

New submission from Atsuo Ishimoto [EMAIL PROTECTED]:

email.Header.decode_header() doesn't work if encoded-word was separeted
by CRLF. 

For exmaple, decode_header('=?iso-8859-1?q?hello?=\r\n world.') returns
[('=?iso-8859-1?q?hello?=\r\n world.', None)], not [('hello',
'iso-8859-1'), (' world.', None)].

This bug was caused by rev.54371, bug #1582282. I attached a patch to
fix problem and test-case.

--
components: Library (Lib)
files: email.patch
keywords: patch
messages: 76755
nosy: ishimoto
severity: normal
status: open
title: email.Header.decode_header() doesn't work if encoded-word was separeted 
by CRLF
type: behavior
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file12196/email.patch

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



[issue2630] repr() should not escape non-ASCII characters

2008-06-11 Thread Atsuo Ishimoto

Atsuo Ishimoto [EMAIL PROTECTED] added the comment:

Great, thank you!

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



[issue2630] repr() should not escape non-ASCII characters

2008-06-03 Thread Atsuo Ishimoto

Atsuo Ishimoto [EMAIL PROTECTED] added the comment:

This patch contains following changes.

- Added the new C API PyObject_ASCII() for consistency.
- Added the new string formatting operater for str.format() and
PyUnicode_FromFormat.

Added file: http://bugs.python.org/file10507/diff6.txt

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



[issue2630] repr() should not escape non-ASCII characters

2008-06-03 Thread Atsuo Ishimoto

Atsuo Ishimoto [EMAIL PROTECTED] added the comment:

BTW, are new C APIs and functions should be ported to Python 2.6 for
compatibility, without modifing repr() itself? If so, I'll prepare a
patch for Python 2.6.

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



[issue2630] repr() should not escape non-ASCII characters

2008-06-03 Thread Atsuo Ishimoto

Atsuo Ishimoto [EMAIL PROTECTED] added the comment:

Thank you for your review! 
I filed a new patch just before I see your comments.

On Tue, Jun 3, 2008 at 7:13 PM, Georg Brandl [EMAIL PROTECTED] wrote:

 Georg Brandl [EMAIL PROTECTED] added the comment:

 Review:

 * Why is an empty string not printable? In any case, the empty string
 should be among the test cases for isprintable().

Well, my intuition came from str.islower() was wrong. An empty string is
printable, of cource.

 * Why not use PyUnicode_DecodeASCII instead of
 PyUnicode_FromEncodedObject? It should be a bit faster.


Okay, thank you.

 * If old-style string formatting gets %a, .format() must get a !a
 specifier.

I added the format string in my latest patch.

 * The ascii() and repr() tests should be expanded so that both test the
 same set of objects, and the expected differences. Are there tests for
 failing cases?


Okay, thank you.

 * This is just return ascii (in builtin_ascii):
 +   if (ascii == NULL)
 +   return NULL;
 +
 +   return ascii;

Fixed in my latest patch.


 * For PyBool_FromLong(1) and PyBool_FromLong(0) there is Py_RETURN_TRUE
 and Py_RETURN_FALSE. (You're not to blame, the rest of unicodeobject.c
 seems to use them too, probably a legacy.)

Okay, thank you.


 * There appear to be some space indentations in tab-indented files like
 bltinmodule.c and vice versa (unicodeobject.c).


I think bltinmodule.c is fixed with latest patch, but I don't know what
is correct indentation for unicodeobject.c. I guess latest patch is
acceptable.

 * C docs/isprintable() docs: The spec
 +   Characters defined in the Unicode character database as Other
 +   or Separator other than ASCII space(0x20) are not considered
 +   printable.
 is unclear, better say All character except those ... are considered
 printable.

 * ascii() docs:
 +   the non-ASCII
 +   characters in the string returned by :func:`ascii`() are hex-escaped
 +   to generate a same string as :func:`repr` in Python 2.

 should be

 the non-ASCII characters in the string returned by :func:`repr` are
 backslash-escaped (with ``\x``, ``\u`` or ``\U``) to generate 


Okay, thank you.

 * makeunicodedata: len(list(n for n in names if n is not None)) could
 better be expressed as sum(1 for n in names if n is not None).

I don't want to change here, because this is reversion of rev 63378.

 One more thing: with r63891 the encoding and errors arguments for the
 creation of sys.stderr were made configurable; you'll have to adapt the
 patch so that it defaults to backslashescape but can be overridden by
 PYTHONIOENCODING.

I think sys.stderr should be default to 'backslashreplace' always. I'll
post a messege to Py3k-list later.


 Otherwise, the patch is fine IMO. (I'm surprised that only so few tests
 needed adaptation, that's a sign that we're not testing Unicode enough.)


Thank you very much! I'll file new patch soon.

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



[issue2630] repr() should not escape non-ASCII characters

2008-06-03 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file10511/diff7.txt

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



[issue2630] repr() should not escape non-ASCII characters

2008-06-03 Thread Atsuo Ishimoto

Atsuo Ishimoto [EMAIL PROTECTED] added the comment:

I updated the patch as per Georg's advice.

Added file: http://bugs.python.org/file10511/diff7.txt

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



[issue2630] repr() should not escape non-ASCII characters

2008-06-03 Thread Atsuo Ishimoto

Atsuo Ishimoto [EMAIL PROTECTED] added the comment:

I'm sorry, I missed a file to be uploaded. diff7_1.txt is correct file.

Added file: http://bugs.python.org/file10512/diff7_1.txt

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



[issue2630] repr() should not escape non-ASCII characters

2008-05-28 Thread Atsuo Ishimoto

Atsuo Ishimoto [EMAIL PROTECTED] added the comment:

docdiff1.txt contains a documentation for functions I added.

Added file: http://bugs.python.org/file10456/docdiff1.txt

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



[issue2630] repr() should not escape non-ASCII characters

2008-05-06 Thread atsuo ishimoto

atsuo ishimoto [EMAIL PROTECTED] added the comment:

  No need to change anything, the diff is just too big for the code
  review tool (Rietveld), but since it consists only of numbers we don't
  need to review it anyway. :)

I wonder why unicodename_db.h have not updated after 
makeunicodedata.py was modified. If new makeunicodedata.py 
breaks something, I should remove the chage to unicodename_db.h 
from this patch (My patch works whether unicodename_db.h is 
updated or not.). I'll post a question to python-3000 list.

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



[issue2630] repr() should not escape non-ASCII characters

2008-05-05 Thread atsuo ishimoto

atsuo ishimoto [EMAIL PROTECTED] added the comment:

I forgot to mention to Modules/unicodename_db.h. 

The current unicodename_db.h looks it was generated
by old Tools/unicode/makeunicodedata.py. This patch
includes newly generated unicodename_db.h, but we 
can exclude the change if not necessary.

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



[issue2630] repr() should not escape non-ASCII characters

2008-05-04 Thread atsuo ishimoto

atsuo ishimoto [EMAIL PROTECTED] added the comment:

New patch agaist current py3k branch.

All the regr tests faild by my patch is now fixed as far as I 
can run.
I also modified a doctest module a bit, so should be reviewed
by module owners.

Added file: http://bugs.python.org/file10193/diff3.txt

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



  1   2   >