Laszlo, Thank you for your report, for the example .xsd file, and for your notes and guidance.
Give me a bit of time to look into this. generateDS does not have a Github page. The source code repository is at Bitbucket and uses Mecurial for its DRCS: https://bitbucket.org/dkuhlman/generateds More, soon, I hope. Dave On Sat, Jun 16, 2018 at 12:11:08PM +0200, Les wrote: >  Hello, > Here are two more problems. > #1 input encoding > If you install generateDS on Windows + Python3.6, then it will use the > default system encoding for opening XSD files. Even though the XSD file > has this declaration in it: > <?xml version="1.0" encoding="UTF-8"?> > Also there is no option to specify the input encoding of the XSD files. > But in most cases, the XML file will self-contain its encoding and it > should be used. > Here is an example traceback: > c:\Python\Lib\kobak-lib>python -m generateDS --external-encoding utf-8 -o > xsd/api.py -s xsd/apisubs.py xsd/invoiceApi.xsd > Traceback (most recent call last): >  File "C:\Python\Python36-64\Lib\runpy.py", line 193, in > _run_module_as_main >    "__main__", mod_spec) >  File "C:\Python\Python36-64\Lib\runpy.py", line 85, in _run_code >    exec(code, run_globals) >  File > "C:\Users\User\.virtualenvs\kobak-lib-cw59HSqt\Scripts\generateDS.py", > line 7473, in <module> >    main() >  File > "C:\Users\User\.virtualenvs\kobak-lib-cw59HSqt\Scripts\generateDS.py", > line 7455, in main >    superModule=superModule) >  File > "C:\Users\User\.virtualenvs\kobak-lib-cw59HSqt\Scripts\generateDS.py", > line 6925, in parseAndGenerate >    no_redefine_groups=noRedefineGroups, >  File > > "C:\Users\User\.virtualenvs\kobak-lib-cw59HSqt\Scripts\process_includes.py", > line 88, in process_include_files >    doc, ns_dict = prep_schema_doc(infile, outfile, inpath, options) >  File > > "C:\Users\User\.virtualenvs\kobak-lib-cw59HSqt\Scripts\process_includes.py", > line 322, in prep_schema_doc >    doc1 = etree.parse(infile) >  File "src\lxml\etree.pyx", line 3426, in lxml.etree.parse >  File "src\lxml\parser.pxi", line 1860, in lxml.etree._parseDocument >  File "src\lxml\parser.pxi", line 1880, in > lxml.etree._parseFilelikeDocument >  File "src\lxml\parser.pxi", line 1775, in > lxml.etree._parseDocFromFilelike >  File "src\lxml\parser.pxi", line 1186, in > lxml.etree._BaseParser._parseDocFromFilelike >  File "src\lxml\parser.pxi", line 600, in > lxml.etree._ParserContext._handleParseResultDoc >  File "src\lxml\parser.pxi", line 706, in lxml.etree._handleParseResult >  File "src\lxml\etree.pyx", line 316, in > lxml.etree._ExceptionContext._raise_if_stored >  File "src\lxml\parser.pxi", line 370, in > lxml.etree._FileReaderContext.copyToBuffer >  File > "C:\Users\User\.virtualenvs\kobak-lib-cw59HSqt\lib\encodings\cp1250.py", > line 23, in decode >    return codecs.charmap_decode(input,self.errors,decoding_table)[0] > UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position > 5165: character maps to <undefined> > > c:\Python\Lib\kobak-lib> > > I have attached the example XSD. You must also know that I have a > hungarian windows and its default encoding is cp1250. (But that should not > matter because the input encoding is specified by the XSD file itself.) > #2 output encoding > On Python 3, we should not have an option to specify the output encoding. > If you insist on keeping this switch, then it should default to UTF-8 and > not the default system encoding. It is because Python 3 always uses > UTF-8 source file encoding, no matter what. > Does this project have a github page? It would be much better to track > these in issues. > Regards, >   Laszlo > > 2018-06-16 11:44 GMT+02:00 Les <nagy...@gmail.com>: > >  Hello! > pipenv install generateDS > pipenv shell > python > >>> import generateDS > Traceback (most recent call last): >  File "<stdin>", line 1, in <module> >  File > "C:\Users\User\.virtualenvs\kobak-lib-cw59HSqt\Scripts\generateDS.py", > line 179, in <module> >    from six.moves import input > ModuleNotFoundError: No module named 'six' > It seems that generatedDS depends on six, but it is not added as a > dependency. > Cheers, >   Laszlo -- Dave Kuhlman http://www.davekuhlman.org ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ generateds-users mailing list generateds-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/generateds-users