[issue36198] Misleading in library/sets document

2019-03-05 Thread Han


New submission from Han :

Doc/library/sets.rst said operation s.update(t)'s result is "return set s with 
elements added from t".
But update()'s return value is None.
I think change it to "set s with elements added from t" would be better.
So are operations intersection_update(), difference_update(), and 
symmetric_difference_update().

--
assignee: docs@python
components: Documentation
messages: 337192
nosy: DeadmanWalking, docs@python
priority: normal
severity: normal
status: open
title: Misleading in library/sets document
versions: Python 2.7

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



[issue36198] Misleading in library/sets document

2019-03-05 Thread Han


Han  added the comment:

Thanks, I didn't notice the Deprecated sign on the Sets page.

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

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



[issue13546] sys.setrecursionlimit() crashes IDLE

2011-12-07 Thread Ji Han

New submission from Ji Han :

The following code snippet will crash IDLE:

>>> import sys
>>> sys.setrecursionlimit((1<<31)-1)

The crash happens immediately and is consistently reproducible (environment: 
Windows 7 SP1 64-bit, Python 2.7.2 for Windows X86_64).

--
components: None
messages: 148953
nosy: hanji
priority: normal
severity: normal
status: open
title: sys.setrecursionlimit() crashes IDLE
versions: Python 2.7

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



[issue13546] sys.setrecursionlimit() crashes IDLE

2011-12-07 Thread Ji Han

Ji Han  added the comment:

@amaury.forgeotdarc

It says 'python.exe has stopped working'. Details:

  Problem Event Name:   APPCRASH
  Application Name: python.exe
  Application Version:  0.0.0.0
  Application Timestamp:4df4b010
  Fault Module Name:MSVCR90.dll
  Fault Module Version: 9.0.30729.6161
  Fault Module Timestamp:   4dace4e7
  Exception Code:   c0fd
  Exception Offset: 0001edcf
  ... ... ...

P.S. I'm well aware recursions won't go that deep. But crashing IDLE (instead 
of Raising an Error) by simply setting an option is still annoying.

--

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



[issue2818] pulldom cannot handle xml file with large external entity properly

2008-05-11 Thread Luyang Han

New submission from Luyang Han <[EMAIL PROTECTED]>:

when use xml.dom.pulldom module to parse a large xml file, if all the 
information is saved in one xml file, the module can handle it in the 
following way without construction the whole DOM:

events = xml.dom.pulldom.parse('file.xml')
for (event, node) in events:
process(event, node)

But if 'file.xml' contains some large external entities, for example:


&file_external;

Then using the same python snippet above leads to enormous memory 
usage. I did not perform a concrete benchmark, in one case a 3M 
external xml file drained about 1 GB memory. I think in this case it 
might be the whole DOM structure is constructed.

--
components: XML
messages: 66628
nosy: hanselda
severity: normal
status: open
title: pulldom cannot handle xml file with large external entity properly
type: resource usage
versions: Python 2.5

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



[issue38760] Document for urllib.error.HTTPError.headers Should Specify What Version

2019-11-09 Thread Han You


New submission from Han You :

It says "New in version 3.4." so I put `urllib3>=3.4` in my requirements.txt. 
Turned out it is referring to the Python version.

https://docs.python.org/3.7/library/urllib.error.html#urllib.error.HTTPError.headers

--
assignee: docs@python
components: Documentation
messages: 356312
nosy: Han You, docs@python
priority: normal
severity: normal
status: open
title: Document for urllib.error.HTTPError.headers Should Specify What Version
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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



[issue36054] On Linux, os.count() should read cgroup cpu.shares and cpu.cfs (CPU count inside docker container)

2019-11-20 Thread Galen Han


Change by Galen Han :


--
nosy: +Galen Han

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



[issue37248] support conversion of `func(**{} if a else b)`

2019-06-12 Thread Shen Han


Change by Shen Han :


--
components: 2to3 (2.x to 3.x conversion tool)
nosy: Shen Han
priority: normal
severity: normal
status: open
title: support conversion of `func(**{} if a else b)`
type: enhancement
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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



[issue37248] support conversion of `func(**{} if a else b)`

2019-06-12 Thread Shen Han


Shen Han  added the comment:

The 2to3 tool cannot convert the following code:
 1. `func(**{} if a else b)`
 2. `func(*[] if a else b)`

I think that problem is rooted the outdated Grammar.txt.

--

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



[issue37248] support conversion of `func(**{} if a else b)`

2019-06-12 Thread Shen Han


Shen Han  added the comment:

This PR https://github.com/python/cpython/pull/12703 solves this problem. But 
haven't been merged.

--

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



[issue37248] support conversion of `func(**{} if a else b)`

2019-06-15 Thread Shen Han


Shen Han  added the comment:

Yes, I think so.

--

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



[issue31231] Travis CI mac test broken:

2017-08-17 Thread Han Lee

New submission from Han Lee:

CPython: master branch

In mac and window create python.exe not python 
https://github.com/python/cpython/blob/master/Makefile.pre.in#L154

But Travis CI and docs use ./python command for test
https://docs.python.org/devguide/

https://travis-ci.org/python/cpython/jobs/265843638
/Users/travis/.travis/job_stages: line 73: ./python: is a directory

--
messages: 300474
nosy: sn0wle0pard
priority: normal
severity: normal
status: open
title: Travis CI mac test broken:

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



[issue31231] Travis CI mac test broken: ./python: is a directory

2017-08-17 Thread Han Lee

Changes by Han Lee :


--
title: Travis CI mac test broken: -> Travis CI mac test broken: ./python: is a 
directory

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



[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-16 Thread Han Shaowen

New submission from Han Shaowen :

What I am talking is like:

Python 3.6.0 (default, Feb 28 2018, 15:41:04)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> from datetime import datetime
>>> time.time()
1523942154.3787892
>>> datetime.now().timestamp()
1523942165.202865
>>> datetime.utcnow().timestamp()
1523913372.362377

Apparently, datetime.now().timestamp() give me right unix timestamp while 
utcnow().timestamp() doesn't.

Fellas what do you think about this?

--
components: Extension Modules
messages: 315377
nosy: Han Shaowen
priority: normal
severity: normal
status: open
title: Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get 
correct UTC timestamp.
type: behavior
versions: Python 3.6

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



[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Han Shaowen

Han Shaowen  added the comment:

Guys, what I said is the doc in help(datetime.timestamp) is 'Return POSIX 
timestamp as float.' So I assumed it is irrelevant to time zone, considering 
POSIX timestamp's definition. If it is then datetime.now and datetime.utcnow 
should return the same timestamp. But datetime.now().timestamp return a correct 
timestamp which I checked in the website https://www.unixtimestamp.com/ but 
datetime.utcnow().timestamp did not.

:)

--

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



[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Han Shaowen

Han Shaowen  added the comment:

Hohoho, I found the full-version doc. This issue over. Thanks Tim, Ned and 
Brett. And sorry about something improper I said, I respect female Pythonista.

--

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



[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2009-05-22 Thread Wentao Han

New submission from Wentao Han :

The invocation of socket.getfqdn to get FQDN of the host may delay for 
several seconds on some platforms when no appropriate host name is found. 
This causes lag when using SimpleXMLRPCServer and other class derived from 
BaseHTTPServer for every request.

--
components: Library (Lib)
messages: 88188
nosy: aerodonkey
severity: normal
status: open
title: Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag
type: performance
versions: Python 2.6

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



[issue6120] zipfile.ZipFile's extractall works inproperly under Windows

2009-05-26 Thread Wentao Han

New submission from Wentao Han :

On Windows, if you extract all files from a zip file which containing 
subdirectories by zipfile.ZipFile's extractall method, a WindowsError will 
be raised.

--
components: Library (Lib)
messages: 88400
nosy: aerodonkey
severity: normal
status: open
title: zipfile.ZipFile's extractall works inproperly under Windows
type: behavior
versions: Python 2.6

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



[issue23388] datetime.strftime('%s') does not take timezone into account

2015-02-03 Thread Han Choongwoo

Changes by Han Choongwoo :


--
nosy: +tunz

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



[issue10574] email.header.decode_header fails if the string contains multiple directives

2010-11-28 Thread Roy H. Han

New submission from Roy H. Han :

email.header.decode_header fails for the following message subject:
::


email.header.decode_header('=?UTF-8?B?MjAxMSBBVVRNIENBTEwgZm9yIE5PTUlO?==?UTF-8?B?QVRJT05TIG9mIFZQIGZvciBNZW1iZXJz?==?UTF-8?B?aGlw?=')


If the directives are removed and the padding problems are fixed, the subject 
parses correctly.
::

email.header.decode_header('=?UTF-8?B?%s==?=' % 
'=?UTF-8?B?MjAxMSBBVVRNIENBTEwgZm9yIE5PTUlO?==?UTF-8?B?QVRJT05TIG9mIFZQIGZvciBNZW1iZXJz?==?UTF-8?B?aGlw?='.replace('=?UTF-8?B?',
 '').replace('?', '').replace('=', ''))

--
components: Library (Lib)
messages: 122772
nosy: starsareblueandfaraway
priority: normal
severity: normal
status: open
title: email.header.decode_header fails if the string contains multiple 
directives
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1

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



[issue10574] email.header.decode_header fails if the string contains multiple directives

2010-11-28 Thread Roy Hyunjin Han

Roy Hyunjin Han  added the comment:

Currently using the following workaround.

import re
import email.header

def decodeSafely(x):
match = re.search('(=\?.*?\?B\?)', x)
if not match:
return x
encoding = match.group(1)
return email.header.decode_header('%s%s==?=' % (encoding, 
x.replace(encoding, '').replace('?', '').replace('=', '')))

--

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



[issue10574] email.header.decode_header fails if the string contains multiple directives

2010-11-28 Thread Roy Hyunjin Han

Roy Hyunjin Han  added the comment:

Improved workaround to handle another degenerate case where the encoded string 
is in between non-encoded strings.

import re
import email.header

pattern_ecre = re.compile(r'((=\?.*?\?[qb]\?).*\?=)', re.VERBOSE | 
re.IGNORECASE | re.MULTILINE)

def decodeSafely(x):
match = pattern_ecre.search(x)
if not match:
return x
string, encoding = match.groups()
stringBefore, string, stringAfter = x.partition(string)
return stringBefore + email.header.decode_header('%s%s==?=' % (encoding, 
string.replace(encoding, '').replace('?', '').replace('=', '')))[0][0] + 
stringAfter

print 
decodeSafely('=?UTF-8?B?MjAxMSBBVVRNIENBTEwgZm9yIE5PTUlO?==?UTF-8?B?QVRJT05TIG9mIFZQIGZvciBNZW1iZXJz?==?UTF-8?B?aGlw?=')
print decodeSafely('"=?UTF-8?B?QVVUTSBIZWFkcXVhcnRlcnM=?="')

--

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



[issue10574] email.header.decode_header fails if the string contains multiple directives

2010-11-28 Thread Roy Hyunjin Han

Roy Hyunjin Han  added the comment:

The following code seems to solve the first case just as well.  It seems that 
it is a problem of missing whitespace.

email.header.decode_header('=?UTF-8?B?MjAxMSBBVVRNIENBTEwgZm9yIE5PTUlO?==?UTF-8?B?QVRJT05TIG9mIFZQIGZvciBNZW1iZXJz?==?UTF-8?B?aGlw?='.replace('?==?',
 '?= =?'))

--

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



[issue10574] email.header.decode_header fails if the string contains multiple directives

2011-01-22 Thread Roy Hyunjin Han

Roy Hyunjin Han  added the comment:

2010/11/30 R. David Murray :
> Out of curiosity, which email program is it that is producing these invalid 
> headers?

I lost the headers for the original email, so I don't know which email
program created the invalid headers.

On searching for messages from the same address, it seems most of the
messages originate from a marketing company called informz.net, but in
rare instances there is a non-standard X-Mailer header:
- ColdFusion 8 Application Server (via JavaMail)
- IBM Lotus Domino Access for MS Outlook (2003) Release 7.0.2 September 26, 2006

Messages sent via informz.net generally parse correctly, so I am
guessing it might have been one of the X-Mailers above.

--

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



[issue1597850] Cross compiling patches for MINGW

2008-10-07 Thread Han-Wen Nienhuys

Han-Wen Nienhuys <[EMAIL PROTECTED]> added the comment:

I'm still interested in this, but the last time I did anything, I jumped
through all the hoops (see conversation here), and not a single change
was put into trunk. I'm not very enthousiastic about spending a lot time
on this again.

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



[issue1597850] Cross compiling patches for MINGW

2008-10-07 Thread Han-Wen Nienhuys

Han-Wen Nienhuys <[EMAIL PROTECTED]> added the comment:

@Luke

the compiling strategy for Python (IIRC) is to compile everything,
including modules that will never work, and use compiler errors as a
signal to not include a module in the result. 

this is what I end up with for 2.4

./usr/bin/libpython2.4.dll
./usr/bin/imageop.dll
./usr/bin/_codecs_hk.dll
./usr/bin/_codecs_jp.dll
./usr/bin/_heapq.dll
./usr/bin/_random.dll
./usr/bin/cPickle.dll
./usr/bin/cStringIO.dll
./usr/bin/regex.dll
./usr/bin/collections.dll
./usr/bin/_locale.dll
./usr/bin/_testcapi.dll
./usr/bin/_codecs_tw.dll
./usr/bin/pyexpat.dll
./usr/bin/_hotshot.dll
./usr/bin/mmap.dll
./usr/bin/math.dll
./usr/bin/binascii.dll
./usr/bin/array.dll
./usr/bin/smtpd.py
./usr/bin/cmath.dll
./usr/bin/audioop.dll
./usr/bin/_codecs_kr.dll
./usr/bin/parser.dll
./usr/bin/itertools.dll
./usr/bin/_csv.dll

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



[issue10574] email.header.decode_header fails if the string contains multiple directives

2012-07-04 Thread Roy Hyunjin Han

Roy Hyunjin Han  added the comment:

> This is fixed by the fix to issue 1079, but we have decided that fix can't be 
> backported because it is a behavior change that might break existing working 
> programs.

Thanks for this update.

--

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



[issue1597850] Cross compiling patches for MINGW

2013-02-02 Thread Han-Wen Nienhuys

Han-Wen Nienhuys added the comment:

yeah, whatever.

(only 7 years to close an issue. Yay for open-source.)

--
status: open -> closed

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



[issue1598] unexpected response in imaplib

2014-07-17 Thread Roy Hyunjin Han

Roy Hyunjin Han added the comment:

Is imaplib choking on the IBM-specific X-MIMETrack header?  Is Lotus Notes 
properly formatting the multi-line headers?  Can RFC822 headers contain the 
PIPE | symbol?

--

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



[issue1598] unexpected response in imaplib

2014-07-18 Thread Roy Hyunjin Han

Roy Hyunjin Han added the comment:

Hi Lita,

I no longer have access to a Domino server.

I'm not sure whether there are enough users trying to access Domino with 
imaplib for this to warrant investigation.

RHH

--

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



[issue1598] unexpected response in imaplib

2014-07-18 Thread Roy Hyunjin Han

Roy Hyunjin Han added the comment:

Yes, I think closing this issue is reasonable.  If the error reappears, we can 
just reopen it.

--

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



[issue1598] unexpected response in imaplib

2009-03-24 Thread Roy H. Han

Roy H. Han  added the comment:

I'm also getting the same error retrieving a message through IMAP from a
Lotus Notes server.


Traceback (most recent call last):
  File "mail.py", line 152, in 
if 'setup' == argument: setup()
  File "mail.py", line 61, in archive
for message in imapBox.read(includes=includes,
excludes=[mail_store_imap.folder_trash]):
  File "/var/www/pylons/scout/scout/lib/mail_store_imap.py", line 89, in
read
returnCode, data = self.server.fetch(messageIndex, '(RFC822)')
  File "/usr/lib/python2.5/imaplib.py", line 437, in fetch
typ, dat = self._simple_command(name, message_set, message_parts)
  File "/usr/lib/python2.5/imaplib.py", line 1055, in _simple_command
return self._command_complete(name, self._command(name, *args))
  File "/usr/lib/python2.5/imaplib.py", line 887, in _command_complete
raise self.abort('command: %s => %s' % (name, val))
imaplib.abort: command: FETCH => unexpected response: ')'

--
nosy: +starsareblueandfaraway

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



[issue1598] unexpected response in imaplib

2009-03-24 Thread Roy H. Han

Roy H. Han  added the comment:

Using a different format, it seems the message involves cryptographic
keys signed by Lotus Notes?

>>> server.fetch(407, '(BODY.PEEK[HEADER] FLAGS)')

To: pers...@place.com
Subject: subject
Message-ID: 
Date: Tue, 28 Oct 2008 17:53:22 -0400
From: per...@place.com
Content-Type: multipart/mixed; boundary="=_mixed 007839E2852574F0_="
MIME-Version: 1.0
X-Mailer: Lotus Notes Release 7.0.2 September 26, 2006
X-MIMETrack: S/MIME Sign by Notes Client on Person(Release
7.0.2|September 26, 2006) at 10/28/2008 05:53:11 PM,Serialize by Notes
Client on Person(Release 7.0.2|September 26, 2006) at 10/28/2008
05:53:11 PM,Serialize complete at 10/28/2008 05:53:11 PM,S/MIME Sign
failed at 10/28/2008 05:53:11 PM: The cryptographic key was not
found,S/MIME Sign by Notes Client on Person(Release 7.0.2|September 26,
2006) at 10/28/2008 05:53:19 PM,Serialize by Notes Client on
Person(Release 7.0.2|September 26, 2006) at 10/28/2008 05:53:19
PM,Serialize complete at 10/28/2008 05:53:20 PM,S/MIME Sign failed at
10/28/2008 05:53:20 PM: The cryptographic key was not found

--

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



[issue24070] Exceptions and arguments disappear when using argparse inside with statement

2015-04-28 Thread Roy Hyunjin Han

New submission from Roy Hyunjin Han:

Exceptions and arguments disappear when using argparse inside a "with" 
statement.  The behavior was confusing and frustrating because I could not 
pinpoint why certain arguments were missing or unrecognized.

Unhandled exceptions inside the with statement typically trigger a traceback, 
unless __exit__ returns True, in which the exception is "swallowed" 
(https://www.python.org/dev/peps/pep-0343/).

However, the NameError exception and tile_indices argument disappear because of 
a premature sys.exit 
(https://hg.python.org/cpython/file/default/Lib/argparse.py#l2385).

```
"""
$ python exception-in-with.py
EXPECTED
Traceback (most recent call last):
  File "exception-in-with.py", line 51, in 
abc  # !!!
NameError: name 'abc' is not defined
ACTUAL
usage: exception-in-with.py [-h] --image_path PATH
exception-in-with.py: error: argument --image_path is required

$ python exception-in-with.py --image_path x
EXPECTED == ACTUAL
Traceback (most recent call last):
  File "exception-in-with.py", line 51, in 
abc  # !!!
NameError: name 'abc' is not defined

$ python exception-in-with.py --image_path x --tile_indices 1
EXPECTED
Traceback (most recent call last):
  File "exception-in-with.py", line 51, in 
abc  # !!!
NameError: name 'abc' is not defined
ACTUAL
usage: exception-in-with.py [-h] --image_path PATH
exception-in-with.py: error: unrecognized arguments: --tile_indices 1
"""
from argparse import ArgumentParser


class Starter(object):

def __init__(self):
self.argument_parser = ArgumentParser()

def __enter__(self):
return self

def __exit__(self, exception_type, exception_value, exception_traceback):
self.argument_parser.parse_args()

def add_argument(self, *args, **kw):
self.argument_parser.add_argument(*args, **kw)


with Starter() as starter:
starter.add_argument('--image_path', metavar='PATH', required=True)
abc  # !!!
starter.add_argument('--tile_indices', metavar='INTEGER')
```

--
components: Library (Lib)
files: argparse-with-exception.py
messages: 242192
nosy: invisibleroads
priority: normal
severity: normal
status: open
title: Exceptions and arguments disappear when using argparse inside with 
statement
type: behavior
versions: Python 2.7, Python 3.3
Added file: http://bugs.python.org/file39227/argparse-with-exception.py

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



[issue24070] Exceptions and arguments disappear when using argparse inside with statement

2015-05-06 Thread Roy Hyunjin Han

Roy Hyunjin Han added the comment:

The behavior may not be surprising from a technical perspective, but it is 
unintuitive.

I think exceptions inside a with statement should trigger a traceback, unless 
you are saying that it is the responsibility of the author to catch and raise 
the exception inside __exit__, which feels to me like a workaround that is 
specific to parse_args.

--

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



[issue6283] Cannot build extension in amd64 using msvc9compiler

2009-06-14 Thread Alex Shih-Han Lin

New submission from Alex Shih-Han Lin :

OS is Windows 7 x64, python using 2.6.2 amd64, SDK installed, but when I
build some module by setup.py, it always traceback ValueError.

running build
running build_py
running build_ext
building 'genshi._speedups' extension
Traceback (most recent call last):
  File "C:\Genshi-0.5.1\setup.py", line 116, in 
'build_ext': optional_build_ext}
  File "C:\Python26\lib\distutils\core.py", line 152, in setup
dist.run_commands()
  File "C:\Python26\lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
  File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
  File "C:\Python26\lib\distutils\command\build.py", line 134, in run
self.run_command(cmd_name)
  File "C:\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
  File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
  File "C:\Genshi-0.5.1\setup.py", line 39, in run
build_ext.run(self)
  File "C:\Python26\lib\distutils\command\build_ext.py", line 345, in run
self.build_extensions()
  File "C:\Python26\lib\distutils\command\build_ext.py", line 471, in
build_extensions
self.build_extension(ext)
  File "C:\Genshi-0.5.1\setup.py", line 45, in build_extension
build_ext.build_extension(self, ext)
  File "C:\Python26\lib\distutils\command\build_ext.py", line 536, in
build_extension
depends=ext.depends)
  File "C:\Python26\lib\distutils\msvc9compiler.py", line 448, in compile
self.initialize()
  File "C:\Python26\lib\distutils\msvc9compiler.py", line 358, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
  File "C:\Python26\lib\distutils\msvc9compiler.py", line 274, in
query_vcvarsall
raise ValueError(str(list(result.keys(
ValueError: [u'path']

I printed out the variables "result", it only had key 'path'.

--
components: Library (Lib)
messages: 89348
nosy: alexsh
severity: normal
status: open
title: Cannot build extension in amd64 using msvc9compiler
type: compile error
versions: Python 2.6

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



[issue6283] Cannot build extension in amd64 using msvc9compiler

2009-06-14 Thread Alex Shih-Han Lin

Alex Shih-Han Lin  added the comment:

yes, I have already installed VS 2008 (but it is Express Edition for VC,
VB ,C#...I have no money to buy standard edition.)

--

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