[issue23041] csv needs more quoting rules

2019-12-15 Thread Yoong Hor Meng


Yoong Hor Meng  added the comment:

There is a real requirement for csv to handle an empty field vs a empty string 
"""".  csv.QUOTE_NOTNULL could be useful.

--
nosy: +yoonghm
versions: +Python 3.8 -Python 3.6

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



[issue37331] logging.handlers.DatagramHandler sends bad data to socketserver.DatagramRequestHandler

2019-06-18 Thread Yoong Hor Meng


New submission from Yoong Hor Meng :

`pysyslog.py`
- A UDP server listens at 0.0.0.0:514 for syslog messages.

`syslogmsg_gen.py`
- Send syslog message to local syslog server via 127.0.0.1:514


Error:

Exception has occurred: UnicodeDecodeError
'utf-8' codec can't decode byte 0xd7 in position 381: invalid continuation byte
  File "C:\pysyslog.py", line 21, in handle
data = self.request[0].decode('utf-8')
  File "C:\pysyslog.py", line 28, in 
server.serve_forever(poll_interval=0.5)

--
components: Library (Lib)
files: attachment.md
messages: 346005
nosy: yoonghm
priority: normal
severity: normal
status: open
title: logging.handlers.DatagramHandler sends bad data to 
socketserver.DatagramRequestHandler
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48426/attachment.md

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



[issue37331] logging.handlers.DatagramHandler sends bad data to socketserver.DatagramRequestHandler

2019-06-18 Thread Yoong Hor Meng


Yoong Hor Meng  added the comment:

I did some checks, I discovered the following:

logging.handlers.DatagramHandler() sends data in the following format:
1. message length
2. message itself which consists of 
   a. Creation time in ASCII format
   b. Creation time in seconds, ms
   c. Filename, line no
   d. Message level
   e. Message
   f. Logger name
   etc.

Item 1. is packed using struct.pack(">L")
Item 2. is packed using pickle

The message format is not mentioned in any of the standard Python document.  
Also it may not be compatible with third-party syslog message library or 
generator.

--

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



[issue37460] importlib.import_module("test.test_curses") could not import by libregrtest

2019-06-30 Thread Yoong Hor Meng


New submission from Yoong Hor Meng :

test_curses.py was skipped during unit test.  I manually ran the test via 
debugger:

python3 -m pdb /home/s/lib/python3.8/test/regrtest.py test_curses 

It showed error at 

../lib/python3.8/test/libregrtest/runtest.py(215)_runtest_inner2():

210 abstest = get_abs_module(ns, test_name) 
 211

  212 # remove the module from 
sys.module to reload it if it was already imported  
213 support.unload(abstest) 
 
214 
 215  -> the_module 
= importlib.import_module(abstest)  
  216   

   217 # If the test has a test_ma
 in, that will run the appropriate  
   218 # tests.  If not, use normal unittest test 
loading.
  219 test_runner = getattr(the_module, "test_main", None)  
   220 if 
test_runner is None:

test.support.ResourceDenied: Use of the 'curses' resource not enabled 

However, it was possible to load the module

import importlib
the_module = importlib.import_module('test.test_curses')
print(the_module)

--
components: Library (Lib)
messages: 346952
nosy: yoonghm
priority: normal
severity: normal
status: open
title: importlib.import_module("test.test_curses") could not import by 
libregrtest
versions: Python 3.8

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



[issue37460] importlib.import_module("test.test_curses") could not import by libregrtest

2019-06-30 Thread Yoong Hor Meng


Yoong Hor Meng  added the comment:

https://bugs.python.org/issue5356 mentioned that one has to pass 

-ucurses to regrtest.py

It works.  However the Makefile does not pass the information to regrtest.py 
when calling test_curses.py

--

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



[issue37460] importlib.import_module("test.test_curses") could not import by libregrtest

2019-06-30 Thread Yoong Hor Meng


Yoong Hor Meng  added the comment:

I installed libncurses5-dev and ran configure again:

./configure \
  --with-openssl=/usr
  --enable-optimizations

It could be build without skipping test_curses. It seems that regrtest.py looks 
for libncurses5-dev during configure state.

...
Run tests sequentially
0:00:00 load avg: 0.52 [  1/423] test_grammar
0:00:00 load avg: 0.52 [  2/423] test_opcodes
0:00:00 load avg: 0.52 [  3/423] test_dict
0:00:02 load avg: 0.52 [  4/423] test_builtin
0:00:05 load avg: 0.52 [  5/423] test_exceptions
0:00:26 load avg: 0.52 [  6/423] test_types
0:00:27 load avg: 0.52 [  7/423] test_unittest
0:00:57 load avg: 0.52 [  8/423] test_doctest -- test_unittest passed in 30 sec 
585 ms
0:01:17 load avg: 0.52 [  9/423] test_doctest2
0:01:17 load avg: 0.52 [ 10/423] test_support
0:02:22 load avg: 0.52 [ 11/423] test___all__ -- test_support passed in 1 min 4 
sec
0:02:33 load avg: 0.52 [ 12/423] test___future__
0:02:33 load avg: 0.52 [ 13/423] test__locale
0:02:34 load avg: 0.52 [ 14/423] test__opcode
0:02:34 load avg: 0.52 [ 15/423] test__osx_support
0:02:35 load avg: 0.52 [ 16/423] test__xxsubinterpreters
0:02:46 load avg: 0.52 [ 17/423] test_abc
0:02:47 load avg: 0.52 [ 18/423] test_abstract_numbers
0:02:48 load avg: 0.52 [ 19/423] test_aifc
0:02:50 load avg: 0.52 [ 20/423] test_argparse
0:03:01 load avg: 0.52 [ 21/423] test_array
0:03:09 load avg: 0.52 [ 22/423] test_asdl_parser
0:03:10 load avg: 0.52 [ 23/423] test_ast
0:03:20 load avg: 0.52 [ 24/423] test_asyncgen
0:03:22 load avg: 0.52 [ 25/423] test_asynchat
0:03:25 load avg: 0.52 [ 26/423] test_asyncio
Future exception was never retrieved
future: 
BrokenPipeError
Future exception was never retrieved
future: 
BrokenPipeError
Future exception was never retrieved
future: 
BrokenPipeError
Future exception was never retrieved
future: 
BrokenPipeError
test test_asyncio failed
0:07:47 load avg: 0.52 [ 27/423] test_asyncore -- test_asyncio failed in 4 min 
22 sec
0:07:47 load avg: 0.52 [ 28/423] test_atexit -- test_asyncore skipped
0:07:50 load avg: 0.52 [ 29/423] test_audioop
0:07:50 load avg: 0.52 [ 30/423] test_audit
0:08:06 load avg: 0.52 [ 31/423] test_augassign
0:08:07 load avg: 0.52 [ 32/423] test_base64
0:08:12 load avg: 0.52 [ 33/423] test_baseexception
0:08:13 load avg: 0.52 [ 34/423] test_bdb
0:08:14 load avg: 0.52 [ 35/423] test_bigaddrspace
0:08:15 load avg: 0.52 [ 36/423] test_bigmem
0:08:16 load avg: 0.52 [ 37/423] test_binascii
0:08:17 load avg: 0.52 [ 38/423] test_binhex
0:08:17 load avg: 0.52 [ 39/423] test_binop
0:08:18 load avg: 0.52 [ 40/423] test_bisect
0:08:19 load avg: 0.52 [ 41/423] test_bool
0:08:20 load avg: 0.52 [ 42/423] test_buffer
0:08:57 load avg: 0.52 [ 43/423] test_bufio -- test_buffer passed in 37 sec 284 
ms
0:09:15 load avg: 0.52 [ 44/423] test_bytes
0:09:24 load avg: 0.52 [ 45/423] test_bz2
...


I ran all this in wsl.

--

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



[issue37460] importlib.import_module("test.test_curses") could not import by libregrtest

2019-06-30 Thread Yoong Hor Meng


Yoong Hor Meng  added the comment:

I just find it strange that libncursesw5-dev  is used during compilation but 
libncurses5-dev is used for testing.

--
stage:  -> resolved
status: open -> closed
type:  -> compile error

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



[issue35703] Underscores in numeric literals cannot be before or after decimal (.)

2019-01-10 Thread Yoong Hor Meng


New submission from Yoong Hor Meng :

s = 1_234.567_8
print(float(s))  # It works

s = 1_234._567
print(float(s))  # It does not work

s = 1_234_.567
print(float(s))  # It does not work too

--
components: Interpreter Core
messages: 68
nosy: yoonghm
priority: normal
severity: normal
status: open
title: Underscores in numeric literals cannot be before or after decimal (.)
type: crash
versions: Python 3.6, Python 3.7

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



[issue35703] Underscores in numeric literals cannot be before or after decimal (.)

2019-01-10 Thread Yoong Hor Meng


Change by Yoong Hor Meng :


--
stage:  -> resolved
status: pending -> closed

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



[issue35725] Using for...in.. generator-iterator

2019-01-11 Thread Yoong Hor Meng


New submission from Yoong Hor Meng :

def f():
print('-- Start --')
yield 1
print('-- Middle --')
yield 2
print('-- Finished --')
yield 3

gen = f()
for x in gen:
print('Another things ...')
next(gen)


The output:

-- Start --
Another things ...
-- Middle --
-- Finished --
Another things ...

I noticed that the generator function will execute whenever it is in the 
for...in loop.  Is it expected? I do not see it documented anywhere. Thanks.

--
components: Interpreter Core
messages: 333510
nosy: yoonghm
priority: normal
severity: normal
status: open
title: Using for...in.. generator-iterator
type: behavior
versions: Python 3.7

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