Giter Club home page Giter Club logo

pyscss's Introduction

pyScss, a Scss compiler for Python

build-status coverage

pyScss is a compiler for the Sass language, a superset of CSS3 that adds programming capabilities and some other syntactic sugar.

Quickstart

You need Python 2.6+ or 3.3+. PyPy is also supported.

Installation:

pip install pyScss

Usage:

python -mscss < style.scss

Python API:

from scss import Compiler
Compiler().compile_string("a { color: red + green; }")

Features

95% of Sass 3.2 is supported. If it's not supported, it's a bug! Please file a ticket.

Most of Compass 0.11 is also built in.

Further reading

Documentation is in Sphinx. You can build it yourself by running make html from within the docs directory, or read it on RTD: http://pyscss.readthedocs.org/en/latest/

The canonical syntax reference is part of the Ruby Sass documentation: http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html

Obligatory

Copyright © 2012 German M. Bravo (Kronuz). Additional credits in the documentation.

Licensed under the MIT license, reproduced in LICENSE.

pyscss's People

Contributors

amotoki avatar atheriel avatar bierik avatar callahad avatar chrisjsewell avatar dcrosta avatar e0ne avatar eevee avatar funvit avatar gavinwahl avatar gone avatar hblanks avatar holgerpeters avatar hrw avatar ivorbosloper avatar jrcartee avatar jstasiak avatar jtuulos avatar kronuz avatar ktmud avatar kwood avatar leoquote avatar masklinn avatar matyasrichter avatar qulogic avatar singingwolfboy avatar tghw avatar tkhyn avatar wojas avatar xen0n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyscss's Issues

Make STATIC_URL, ASSETS_URL configurable

STATIC_URL and ASSETS_URL are currently hardcoded. It would be great if these could be configured by the user so that we can use other URLs for static content.

Please provide NEWS.txt / CHANGELOG

In 487757c you changed the module structure fundamentally. It would be good to announce such changes with a new release. This to my knowledge is often done with a NEWS.txt or in the CHANGELOG file.

Also a major version change is generally a good sign for major changes in the module code.

variable $width in the shorthand "border:" property [v1.0 rc3]

I'm getting an unexpected result for the following code:

$width: 1px;

foo {
    border: $width solid red;
}

I expected the result to be:

foo{border: 1px solid red}

But:

foo{border:.001s olid red}

is returned. It works, if I replace $width by #{$width}.

Scheme-relative URLs treated as comments

e.g.,

h1 { background: url(//example.com/path); }

This is perfectly valid CSS2, but the _sl_comment_re pass interprets the // as an inline comment and discards the rest of the line. Naturally, what's left fails to parse correctly.

#000 omitted

Hi,

this mixin:

@mixin bordertest($w: 2px, $color: #000) {
    $params: $w solid $color;
    border: $params;
}

used in:

h1 {
    @include bordertest();
}

results in this output:

h1 {
    border: 2px solid;
}

#000 is gone, which is bad e.g. for text-shadow, which won't work without a color.

if I use any other color than #000 it works

this was a simplified example... my real-world usage is for something like:
(just to clarify why I use $params)

@mixin text-shadow($h-shadow: 1px, $v-shadow: 1px, $blur: 0, $color: #000) {
    $params: $h-shadow $v-shadow $blur $color;

    -moz-text-shadow: $params;
    -webkit-text-shadow: $params;
    text-shadow: $params;
}

Doesn't install on Python 2.5

Error during setup:

File "scss/__init__.py", line 5139
    except Exception as e:
                      ^
SyntaxError: invalid syntax

Afaik "except... as..." was introduced in 2.6.

Logging does not work on debian squeeze

I installed pyscss using 'pip install pyscss', and instead of seeing any messages, only the line

No handlers could be found for logger "scss"

is printed. After digging into the code, and putting the 'logging.basicConfig' call before 'logging.getLogger', it seems to work. I'm not sure about the internals of the logging module, but this seems to be the correct initialization order.

Support local variable modification

The following test from compass (requires compass v0.12, of course) includes a rule-specific variable change, but this is not seen by pyScss.

@import "compass/css3/background-clip";

.background-clip { @include background-clip('border-box'); }

.background-clip-khtml {
  $experimental-support-for-khtml:true;
  @include background-clip('border-box');
}

The resulting CSS should look like:

/* Generated from: background-clip.scss */
.background-clip {
  -webkit-background-clip: border;
  -moz-background-clip: border;
  background-clip: border-box;
}
.background-clip-khtml {
  -webkit-background-clip: border;
  -moz-background-clip: border;
  -khtml-background-clip: border-box;
  background-clip: border-box;
}

but it is missing the -khtml-background-clip bit because the variable $experimental-support-for-khtml is not changed.

Rename pyscss to scss

While I just posted a similar report I'd like to keep things separate:

In #15 the name was changed from scss to pyscss. This issue is about reverting the name change. On a Python module it is IMHO meaningless to prefix your module with py* as it is clear from the scope that this has to be a Python module.

Also somebody else might beat you to it with "scss" and you probably wouldn't want that ;)

Incompatibility With Python 3

pyScss doesn't work at all in Python 3. I realize this probably isn't the biggest priority; still, is there any effort to begin porting it, even using 2to3?

media queries close bug

scss looks like:

@media (max-width:1024px) { 
  .wrap {
    padding: 10px 0; 
   }
}

but we getting

@media (max-width:1024px) {
  .wrap {
    padding: 10px 0;
}

Data URLs don't survive the parser.

background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABHNCSVQICAgIfAhkiAAAAONJREFUKJGVkj1uwkAQhb+1KJwCUbpOFQkqTkDDCZCg4ABOwQ1yBU7g9KSIRE5AQ8+PhERBxRHAQnJwdmeXIvKPYsmErxo9zZt5qx3lnHPvH1sWyyN19HvPhOMuKppt3GJ55DMa1BpGr18EgQ/DcO7+AisHq4o+DOfOqx1bwloLQOM/zUYMYqQwXFPNk7+rNCq1zutz/AKA9ztB7m8xpUhaC6e4jecpAFrNPQDxpYOIYEUw5UhpmhYxUHmdJAliLWJMrjUAku8r+qcQM07nuPqu7OPeJh20qZoyptGBIPBRj57GDcloi1OJCvEHAAAAAElFTkSuQmCC);

turns to:

background: url(data:image/png;
  base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABHNCSVQICAgIfAhkiAAAAONJREFUKJGVkj1uwkAQhb+1KJwCUbpOFQkqTkDDCZCg4ABOwQ1yBU7g9KSIRE5AQ8+PhERBxRHAQnJwdmeXIvKPYsmErxo9zZt5qx3lnHPvH1sWyyN19HvPhOMuKppt3GJ55DMa1BpGr18EgQ/DcO7+AisHq4o+DOfOqx1bwloLQOM/zUYMYqQwXFPNk7+rNCq1zutz/AKA9ztB7m8xpUhaC6e4jecpAFrNPQDxpYOIYEUw5UhpmhYxUHmdJAliLWJMrjUAku8r+qcQM07nuPqu7OPeJh20qZoyptGBIPBRj57GDcloi1OJCvEHAAAAAElFTkSuQmCC);

sass (whitespace aware) syntax

Any plans supporting original Sass (whitespace, no braces) syntax in addition to SCSS (braces) syntax? Imo Sass syntax is preferable to the human eye ... but then I am a Pythoneer so ... :)

Expand variables before parsing function parameters

In compass, there's a function in grid-background that does something like:

  @for $i from 0 to $total {
    // do stuff
    $grid: join($grid, ($column-color $a, $column-color $g));
  }
  // other stuff...
  $gradient: linear-gradient(left, $grid);

To pyScss, it thinks that there are only two parameters to linear-gradient, but with the ruby parser, $grid seems to be expanded first, and then the function parameters are determined. The problem with pyScss's version is that the linear-gradient code can no longer find any colour-stops and outputs garbage.

Problem @else if expression.

Using version v1.0 rc3 (20110301)

The @else if demo in Sass's documentation page[1] does not work as expected. For the following sass code:
$type: monster;
p {
@if $type == ocean {
color: blue;
} @else if $type == matador {
color: red;
} @else if $type == monster {
color: green;
} @else {
color: black;
}
}
The expected output is:
p{color:green} (or p{color:#008000})

But the generated output actually is:
p{color:#000}

[1] : http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#id34

darken() compiles to an invalid CSS color

I'm having problems with the following SCSS code:

$blueDark: #0064CD;
$linkColor: $blueDark;
$linkColorHover: darken($linkColor, 15%);

a:hover {
    color: $linkColorHover;
}

In the compiled CSS, the color value is invalid and ends up getting ignored by the browser (Chrome):

a:hover {
    color: rgb(0, 24.582%, 50.392%)
}

As you can see, a percentage mark is missing after the red color value.

Is there a possibility to compile all colors with no alpha channel to regular hex colors (and not rgb() with percentages)?

@media bug

@option compress:no;

h2{
    background: green;
    @media screen{
        background:blue;
    }
}

h1{
    background:yellow;
}

Compiles to:

h2 {
  background: #008000;
}
@media screen {
  h2 {
    background: blue;
}
h1 {
  background: yellow;
  }
}

The h1 tag ends inside the media screen.

Base64 coded images

The Parser breaks base64 encoded urls, because it stops at the first semicolon in the url.

background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwA...")

Parsis SCSS old syntax

Hello this is more a support request than a bug!

Is possible to use old SASS syntax instead of new SCSS syntas? I've tried to compile some sass files, with no success...

Thanks, great project!

Inline-image makes certain images too heavy

I have a jpg that has a size of 21.1 kB. After encoding it using inline-image() the size of my CSS file increased by 138.5 kB!

Image: http://kikowebdesign.com/tests/banner.jpg
pyScss version 1.1.3
python version 2.6.1

I switched to this compiler after support for klen's scss compiler (https://github.com/klen/python-scss) was dropped and I found that after the switch, most of the inline-images increased in bulk in the stylesheet. (Some surpassed 32 kB and were no longer rendered in IE8).

Expand mixin default values at use-time

Something like the following:

$foo: black;

@mixin test($param: $foo) {
  color: $param;
}

$foo: green;
body {
  @include test;
}

will result in:

/* Generated from: test.scss */
body {
  color: #000000;
}

but the Ruby parser outputs:

body {
  color: green; }

Ignoring the change to hex, pyScss outputs the wrong colour.

More complete example of using pyScss and @import

Hello, I have a bit of code in a Django view that will open an scss file and run it through the scss.compile(). I used the example code from the docs but the @import doesn't work, which makes sense because the Scss library wouldn't have a clue as to where the imported file would be located.

The problem is, I can't seem to find a way to give pyScss a hint as to where to find such files. I think I've found a way to hard-code it in the module itself, but that is not a super idea, even though I'm using this module in a virtual env, because I have several scss files to use and each of them has a different root that @imports will be relative too.

Could you share an example of how a person would do that? The current example looks like this:

    from scss import Scss
    css = Scss()
    css.compile("a { color: red + green; }")

What would be awesome is to deal with scenarios like this:

    css.compile('@import "file2.scss"; a {color: red + green; }')

or

    css.compile(file='file1.scss')
    # file1.scss contains a line such as @import "file2.scss"

Is this possible? If so, I'd love to know how to do it.

mixin variable scope [v1.0 rc3]

Within a mixin, the value of a global variable is used instead of the provided argument:

$width: 150px;

@mixin foo($width) {
    width: $width;
}

$other_width: 100px;

.foo {
    @include foo($other_width);
}

I expected the following result:

.foo{width:100px}

But

.foo{width:150px}

is returned. It works as expected, if you move the definition $width: 150px below the mixin.

trouble with @font-face format

@font-face {
  font-family: 'Maiden Orange';
  font-style: normal;
  font-weight: normal;
  src: local('Maiden Orange'), local('MaidenOrange-Regular'), url('/static/fonts/MaidenOrange.woff') format('woff');
}

gets parsed to

@font-face {
  font-family: Maiden Orange;
  font-style: normal;
  font-weight: normal;
  src: local(Maiden Orange), local(MaidenOrange-Regular),
    url(/static/fonts/MaidenOrange.woff) format(woff);
}

The problem is that "format(woff)" without the quotes around woff is not recognized by firefox/chrome.

Multiline comments removed?

Are multiline comments preserved in compiled css? I done some tests, and seems that multiline comments are stripped during compilation

Can build c extension.

On OSX Lion:

 Running setup.py install for pyScss
    Scanning acceleration disabled (_speedups not found)!
    building 'scss._speedups' extension
    llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scss/src/_speedups.c -o build/temp.macosx-10.7-intel-2.7/scss/src/_speedups.o
    In file included from scss/src/_speedups.c:13:
    scss/src/scanner.h:15:18: error: pcre.h: No such file or directory
    In file included from scss/src/_speedups.c:13:
    scss/src/scanner.h:30: error: expected specifier-qualifier-list before ‘pcre’
    In file included from scss/src/_speedups.c:13:
    scss/src/scanner.h:15:18: error: pcre.h: No such file or directory
    In file included from scss/src/_speedups.c:13:
    scss/src/scanner.h:30: error: expected specifier-qualifier-list before ‘pcre’
    lipo: can't open input file: /var/folders/sm/fjkyjc9n1_g84jhk2s77vqq00000gn/T//ccxNkcyp.out (No such file or directory)
    ==========================================================================
    WARNING: The C extension could not be compiled, speedups are not enabled.
    Failure information, if any, is above.
    Retrying the build without the C extension now.

Add support for debug_info (for use with FireSass)

From http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#options

":debug_info
When set to true, causes the line number and file where a selector is defined to be emitted into the compiled CSS in a format that can be understood by the browser. Useful in conjunction with the FireSass Firebug extension for displaying the Sass filename and line number. Automatically disabled when using the :compressed output style."

It'd be great to be able to use pyScss with Firebug/FireSass (https://addons.mozilla.org/en-US/firefox/addon/firesass-for-firebug/)

-ms prefix for _linear_gradient(*args):

I've added:

def to__ms():
        return StringValue('-ms-' + to__s)
ret.to__ms = to__ms

to _linear_gradient(*args) function, and it works for my immediate needs. Compass added -ms linear gradient experimental support a few days ago, but it lacks support in pyscss.

Im not sure if im doing it the right way or if there are more -ms prefixes to be added to other features.

(Semi-valid CSS) IE filters can't be parsed

IE had these filter things, and support for them is enabled in Compass by default. They look like:

  filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0,
    startColorstr='#FFFFFFFF', endColorstr='#FF000000');

But this totally trips up the parser.

Fortunately, versions of IE that used this sort of thing are dying out. I don't know whether the work required to fix this would be small enough to justify fixing it.

Single quoted strings not preserved

The SCSS input .foo:after { content: '\2715'; } currently results in .foo:after { content: \2715; }, which is invalid CSS.

Using double quotes works: .foo:after { content: "\2715"; }

Looking at the code, it looks like it's being converted into a StringValue instead of a QuotedStringValue. StringValue appears to be intended for unquoted identifiers. QuotedStringValues is currently only used for double-quoted strings, and single-quoted strings are mishandled.

media queries are duplicated

I added a test in my branch https://github.com/fschulze/pyScss/tree/media-query-splitting which shows, that media queries are duplicated. This:

@media (max-width:1024px) {
  body {
    background: red;
  }
  div {
    background: blue;
  }
}

Currently becomes this:

@media (max-width:1024px) {
  body {
    background: #ff0000;
  }
}
@media (max-width:1024px) {
  div {
    background: #0000ff;
  }
}

But should be this:

@media (max-width:1024px) {
  body {
    background: #ff0000;
  }
  div {
    background: #0000ff;
  }
}

I tried to fix it myself, but have no clue what is going on in the code.

python2.5 has no next() builtin

--- ep-scss-0.8.71.orig/scss/control.py
+++ ep-scss-0.8.71/scss/control.py
@@ -47,12 +47,12 @@
     def value(self):
         it = iter(self.data)
         try:
-            first = next(it)
+            first = it.next()
             while True:
-                res = next(it)
+                res = it.next()
                 op = OPRT.get(res.strip(), None)
                 if op:
-                    second = next(it)
+                    second = it.next()
                     first = op(first, second)

                     if op == OPRT['and'] and not first:

did help me.

Test: <'font-size'> [ / <'line-height'> ]

Hello,
just another test...
Regards,
Daniele

Test: <'font-size'> [ / <'line-height'> ], see: http://www.w3.org/TR/CSS2/fonts.html#propdef-font
>>> print css.compile('''
... @option compress: no;
... a {
...  font: 12px/14px sans-serif;
... }
... ''') #doctest: +NORMALIZE_WHITESPACE
a {
  font: 12px/14px sans-serif;
}

helpers are not defined

Compass defines several helper functions that can be called within SCSS files or frameworks. Not all of these are parsed or defined in pyScss. For example, create a base.scss file containing the following:

@option compress: no;
@import "blueprint";
+blueprint-grid;

Copy the latest Blueprint and Compass frameworks from the Compass 0.11.beta.2, and run scss.py making sure to include the directories containing those frameworks. The output file mostly looks good, but line 317 reads:

#{enumerate(".pull", 1, 24)} {

and line 394 reads:

#{enumerate(".push", 1, 24)} {

I've posted this in a gist to demonstrate. It appears that these helpers aren't even being parsed, since scss isn't throwing any errors.

Configuration not thread safe

To change the configuration programmatically you currently need to set constants in the module. This is not thread-safe which might be an issue if you have say, different applications in a shared process, both using pyScss.

It would be better if a parser or configuration could be created and passed around, e.g.,

parser = Parser(load_path=['./', ...])
parser.parse(string)

Make PROJECT_ROOT configurable

I've installed pyScss via Macports, and I have a symbolic link from /opt/local/bin/scss to the scss.py script. As a result, the script detects PROJECT_ROOT as /opt/local/bin, which is incorrect: bin directories should only contain executable files, not library files. Can pyScss be more intelligent in how it sets PROJECT_ROOT -- even if it's as simple as detecting if the directory ends in bin and if so, replacing it with lib?

Sidenote: if you install the rb-compass port from Macports, the framework files are placed in /opt/local/lib/ruby/gems/1.8/gems/compass-0.10.6/frameworks/. Would it make sense to have pyScss to check that directory (or maybe a few version-based variations) for frameworks? Doing so might be a little bit too smart, doing something that the user wouldn't reasonably expect. On the other hand, it would be very convenient. This is not necessarily a feature request: just an idea to think about.

Command-line mode would not work until I combined tool.py and __init__.py

On Win64 using Python 2.7, I kept getting an ImportError that moduel "sccs" did not contain "main" entry point. I finally copied all of tool.py into the bottom of __init__.py and then cleaned up a few errors with imports and then it worked.

I'm new to python so I'm not sure what the real problem is.

Test: extend on pseudo-class

Hello,
I started using pyScss on existing stylesheet(s).
I factored out some test.
Fell free to ask me any question.

Thanks in advance,
Daniele

Test: extend on pseudo-class
>>> print css.compile('''
... @option compress: no, short_colors: no;
... a.button:hover {
... color: #000000;
... }
... button:hover {
... @extend a.button:hover;
... }
... ''') #doctest: +NORMALIZE_WHITESPACE
a.button:hover, button:hover {
  color: #000000;
}

Add "watch" functionality, similar to Ruby's sass tool

The sass tool installed with Ruby's haml gem has an awesome feature where you can watch a file or a directory, and whenever any of those .scss files are changed, the .css files are instantly and automatically recompiled from the newly changed .scss file. Would it be possible to add this feature to pyScss? klen just added it to his python-scss module, so you might be able to borrow his code.

As a stopgap measure until then, it's possible to use the GNU watch command to recompile every few seconds, but it would be better if this functionality was baked in and uses fewer system resources than constantly recompiling.

The black color is incorrectly parsed with !default

I had a line

$text_color: black !default;

But even if this variable was defined nowhere else, when using it, it is substituted to an empty string.

Turns out that during parsing the $text_color variable was incorrectly assigned the value '!default'. When _get_properties processes the value (python variable), which is a ListValue in this case, it iterates over the k, v pairs of its dictionary. Every v is compared to the string '!default', but surprisingly the equality ColorValue('black') == '!default' holds, and afterwards everything is screwed up.

This is because the comparison operator of ColorValue tries to convert the other operand to a ColorValue, and the string '!default' flawlessly converts to black! Checking the ColorValue constructor shows that there an unhandled case, after realizing that the color type is neither 'rgb', 'rgba', 'hsl', 'hsla', an exception should be thrown instead of returning silently while the instance is uninitialized, and later treated as black.

With this fix it seems to work OK.

Using of variables in media queries

Unless I've done something wrong latest build seemed to have a problem accepting:

@media screen and (orientation:portrait) and (max-width:$ipad_portrait_width){
body {
width : $ipad_portrait_width;
}
}

while it worked perfectly with:

@media screen and (orientation:portrait) and (max-width:768px){
body {
width : $ipad_portrait_width;
}
}

Of course, easy to come around for now, but maybe can make it as a fix in a future revision ?
thanks

Wrapping on hyphens

Scss uses textwrap witch by default wraps on hyphens, that breaks css syntax for example no-
repeat.

Fix:
wrap = textwrap.TextWrapper(break_long_words=False, break_on_hyphens=False)
instead of:
wrap = textwrap.TextWrapper(break_long_words=False)

_headers() overwrites passed parameters

I'm using the headings() function like so:

#{headings(4)} {
    background-color: rgb(100,100,100);
}

According to the Compass docs, this should generate rules for h1 through h4, but instead I get:

h1 {
    background-color: #646464;
}

The error seems to be in __init__.py:_headers:

if isinstance(frm, StringValue) and frm.value.lower() == 'all':
    frm = 1
    to = 6
else:
    frm = 1
    try:
        to = int(getattr(frm, 'value', frm))
    except ValueError:
        to = 6

The assignment of 1 to frm before the try block that assigns to seems to be the problem. It needs to be assigned after to has been determined from it (so after the try block).

scss.Scss().compile(u"\xa0") causes Python (2.7.2) to segfault

This seems to happen for any unicode string with unrecognized characters.

In case it matters, I used pip to install pyScss, which seemed to compile the _speedups module without any problems.

Here's a gdb session with a backtrace:

1:~/ans/venv/answeb/answeb/public% gdb python
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /home/ben/ans/venv/bin/python...done.
(gdb) run
Starting program: /home/ben/ans/venv/bin/python
warning: the debug information found in "/lib/ld-2.11.1.so" does not match "/lib/ld-linux.so.2" (CRC mismatch).

[Thread debugging using libthread_db enabled]
Python 2.7.2 (default, Aug 24 2011, 22:13:27)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from scss import Scss
Scss().compile(u"\xa0")

Program received signal SIGSEGV, Segmentation fault.
BlockLocator_iternext (self=0x1) at scss/src/block_locator.c:440
440 scss/src/block_locator.c: No such file or directory.
in scss/src/block_locator.c
(gdb) bt
#0 BlockLocator_iternext (self=0x1) at scss/src/block_locator.c:440
#1 0xf79971d0 in scss_BlockLocator_iternext (self=0xf7e13310) at scss/src/_speedups.c:65
#2 0x080d7436 in PyEval_EvalFrameEx (f=0x81ebc94, throwflag=0) at Python/ceval.c:2497
#3 0x080de87b in PyEval_EvalCodeEx (co=0xf7d3d188, globals=0xf7d3157c, locals=0x0, args=0xf7d519a0, argcount=7, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253
#4 0x0813a697 in function_call (func=0xf7b2c8ec, arg=0xf7d51994, kw=0x0) at Objects/funcobject.c:526
#5 0x0805f675 in PyObject_Call (func=0xf7b2c8ec, arg=0xf7d51994, kw=0x0) at Objects/abstract.c:2529
#6 0x080da4b1 in ext_do_call (f=0x828a0bc, throwflag=0) at Python/ceval.c:4326
#7 PyEval_EvalFrameEx (f=0x828a0bc, throwflag=0) at Python/ceval.c:2705
#8 0x080de87b in PyEval_EvalCodeEx (co=0xf7d2d800, globals=0xf7d3157c, locals=0x0, args=0x826513c, argcount=7, kws=0x8265158, kwcount=0, defs=0x0, defcount=0, closure=0xf79155ec) at Python/ceval.c:3253
#9 0x080dc3fa in fast_function (f=0x8264fe4, throwflag=0) at Python/ceval.c:4109
#10 call_function (f=0x8264fe4, throwflag=0) at Python/ceval.c:4034
#11 PyEval_EvalFrameEx (f=0x8264fe4, throwflag=0) at Python/ceval.c:2666
#12 0x080de87b in PyEval_EvalCodeEx (co=0xf7d3d0f8, globals=0xf7d3157c, locals=0x0, args=0xf7e1db58, argcount=1, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253
#13 0x0813a697 in function_call (func=0xf7b2c87c, arg=0xf7e1db4c, kw=0x0) at Objects/funcobject.c:526
#14 0x0805f675 in PyObject_Call (func=0xf7b2c87c, arg=0xf7e1db4c, kw=0x0) at Objects/abstract.c:2529
#15 0x080da4b1 in ext_do_call (f=0x82e42fc, throwflag=0) at Python/ceval.c:4326
#16 PyEval_EvalFrameEx (f=0x82e42fc, throwflag=0) at Python/ceval.c:2705
#17 0x080de87b in PyEval_EvalCodeEx (co=0xf7d2d800, globals=0xf7d3157c, locals=0x0, args=0x81ed6b8, argcount=1, kws=0x81ed6bc, kwcount=0, defs=0x0, defcount=0, closure=0xf792266c) at Python/ceval.c:3253
#18 0x080dc3fa in fast_function (f=0x81ed564, throwflag=0) at Python/ceval.c:4109
#19 call_function (f=0x81ed564, throwflag=0) at Python/ceval.c:4034
#20 PyEval_EvalFrameEx (f=0x81ed564, throwflag=0) at Python/ceval.c:2666
#21 0x080de87b in PyEval_EvalCodeEx (co=0xf7d2dbf0, globals=0xf7d3157c, locals=0x0, args=0xf7d35ef8, argcount=2, kws=0x0, kwcount=0, defs=0xf7b29db8, defcount=1, closure=0x0) at Python/ceval.c:3253
#22 0x0813a697 in function_call (func=0xf7b2c6f4, arg=0xf7d35eec, kw=0x0) at Objects/funcobject.c:526
#23 0x0805f675 in PyObject_Call (func=0xf7b2c6f4, arg=0xf7d35eec, kw=0x0) at Objects/abstract.c:2529
#24 0x080da4b1 in ext_do_call (f=0x827094c, throwflag=0) at Python/ceval.c:4326
#25 PyEval_EvalFrameEx (f=0x827094c, throwflag=0) at Python/ceval.c:2705
#26 0x080de87b in PyEval_EvalCodeEx (co=0xf7d2d800, globals=0xf7d3157c, locals=0x0, args=0x82eb0b4, argcount=2, kws=0x82eb0bc, kwcount=0, defs=0x0, defcount=0, closure=0xf792d7cc) at Python/ceval.c:3253
#27 0x080dc3fa in fast_function (f=0x82eaf7c, throwflag=0) at Python/ceval.c:4109
#28 call_function (f=0x82eaf7c, throwflag=0) at Python/ceval.c:4034
#29 PyEval_EvalFrameEx (f=0x82eaf7c, throwflag=0) at Python/ceval.c:2666
#30 0x080de87b in PyEval_EvalCodeEx (co=0xf7d28380, globals=0xf7e1135c, locals=0xf7e1135c, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253
#31 0x080de9c7 in PyEval_EvalCode (co=0xf7d28380, globals=0xf7e1135c, locals=0xf7e1135c) at Python/ceval.c:667
#32 0x080fe8c0 in run_mod (fp=0xf7f79440, filename=0x81557d6 "", flags=0xffffd158) at Python/pythonrun.c:1346
#33 PyRun_InteractiveOneFlags (fp=0xf7f79440, filename=0x81557d6 "", flags=0xffffd158) at Python/pythonrun.c:845
#34 0x080feae6 in PyRun_InteractiveLoopFlags (fp=0xf7f79440, filename=0x81557d6 "", flags=0xffffd158) at Python/pythonrun.c:765
#35 0x080ff362 in PyRun_AnyFileExFlags (fp=0xf7f79440, filename=0x81557d6 "", closeit=0, flags=0xffffd158) at Python/pythonrun.c:734
#36 0x0805b776 in Py_Main (argc=0, argv=0xffffd244) at Modules/main.c:599
#37 0x0805a992 in main (argc=-136993728, argv=0x81c00a4) at ./Modules/python.c:23

(gdb)

If I can provide any additional information, just let me know.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.